Patch from H. Pabst: Avoid (very) long paths ultimately leading to "make[2]: execvp: /bin/sh: Argument list too long". The issue can be reproduced when CP2K is checked out into a deeper (but still reasonable) location (file system).

svn-origin-rev: 18266
This commit is contained in:
Patrick Seewald 2018-02-13 14:03:20 +00:00
parent e5b9c92be8
commit 5bdf02ce97
2 changed files with 16 additions and 9 deletions

View file

@ -69,19 +69,20 @@ LIBCUSMM_DIR := $(shell find $(SRCDIR) -type d -name "libcusmm")
ALL_PREPRETTY_DIRS = $(shell find $(SRCDIR) -type d -name preprettify)
ALL_PKG_FILES = $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "PACKAGE")
OBJ_SRC_FILES = $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.F")
OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.c")
OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.cpp")
OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.cxx")
OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.cc")
OBJ_SRC_FILES = $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.F")
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.c")
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.cpp")
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.cxx")
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.cc")
ifneq ($(NVCC),)
OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" ! -name "libcusmm.cu" -name "*.cu")
OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" ! -name "libcusmm.cu" -name "*.cu")
OBJ_SRC_FILES += $(LIBCUSMM_DIR)/libcusmm.cu
endif
# Include also source files which won't compile into an object file
ALL_SRC_FILES = $(OBJ_SRC_FILES)
ALL_SRC_FILES = $(strip $(subst $(NULL) .,$(NULL) $(SRCDIR),$(NULL) $(OBJ_SRC_FILES)))
ALL_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.f90")
ALL_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.h")
ALL_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.hpp")
@ -355,7 +356,7 @@ ifeq ($(LD_SHARED),)
@$(TOOLSRC)/build_utils/check_archives.py $(firstword $(AR)) $(SRCDIR) $(LIBDIR)
endif
@echo "Resolving dependencies for $(ONEVERSION) ... "
@$(TOOLSRC)/build_utils/makedep.py $(OBJDIR)/all.dep $(MODDEPS) $(MAKEDEPMODE) $(ARCHIVE_EXT) $(OBJ_SRC_FILES)
@$(TOOLSRC)/build_utils/makedep.py $(OBJDIR)/all.dep $(MODDEPS) $(MAKEDEPMODE) $(ARCHIVE_EXT) $(SRCDIR) $(OBJ_SRC_FILES)
# on stage 4, load the rules generated by makedep.py
ifeq ($(INCLUDE_DEPS), true)

View file

@ -25,7 +25,13 @@ def main():
mod_format = sys.argv[2]
mode = sys.argv[3]
archive_ext = sys.argv[4]
src_files = sys.argv[5:]
src_dir = sys.argv[5]
src_files_tmp = sys.argv[6:]
src_files = []
for fn_part in src_files_tmp:
fn_part = fn_part[1:]
fn = src_dir + fn_part
src_files.append(fn)
if(mod_format not in ('lower', 'upper', 'no')):
error('Module filename format must be eighter of "lower", "upper", or "no".')
if(mode not in ('normal', 'hackdep', 'mod_compiler')):