Build fails: Swig source step of building PyTrilinos fails with execvp: /bin/sh: Argument list too long
Created by: casparvl
@trilinos/pytrilinos
Current Behavior
I am trying to build Trilinos 12.10.1 with python support. I ran into this issue (https://github.com/trilinos/Trilinos/issues/2434) where the build fails with an error 'execvp: /bin/sh: Argument list too long'. I fixed that by setting the suggested
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON
CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES=ON
CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES=ON
Which works well for the compilation part. However, the 'Swig source' step triggers the same error message, and clearly, doesn't respect these CMake flags.
[ 94%] Swig source /scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/packages/PyTrilinos/src/LOCA.Epetra.Interface.i cd /scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/BUILD/packages/PyTrilinos/src && /hpc/eb/RedHatEnterpriseServer7/SWIG/3.0.12-foss-2017b-Python-2.7.14/bin/swig -python -I/scratch/sha red/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/BUILD/packages/PyTrilinos/doc/Doxygen -noproxydel -outdir PyTrilinos/LOCA/Epetra -c++ -I/scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-201 7b-Python-2.7.14/trilinos-12.10.1-Source/BUILD -I/scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/BUILD/packages/PyTrilinos/src
[[[cut out a few hundred lines here]]]
-I/scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/BUILD /packages/teuchos/remainder/src -I/scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/packages/teuchos/numerics/src -o /scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python -2.7.14/trilinos-12.10.1-Source/BUILD/packages/PyTrilinos/src/LOCA.Epetra.InterfacePYTHON_wrap.cpp /scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/packages/PyTrilinos/src/LOCA.Epetra.I nterface.i make[2]: execvp: /bin/sh: Argument list too long make[2]: *** [packages/PyTrilinos/src/LOCA.Epetra.InterfacePYTHON_wrap.cpp] Error 127 make[2]: Leaving directory
/scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/BUILD'
make[1]: *** [packages/PyTrilinos/src/CMakeFiles/PyTrilinos_LOCA_Epetra_Interface.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Leaving directory /scratch/shared/jenkins/test/build/Trilinos/12.10.1/foss-2017b-Python-2.7.14/trilinos-12.10.1-Source/BUILD'
Possible Solution
Other then shortening the prefix on my end (which is tricky because I use EasyBuild as a build system, which produces somewhat long prefixes), is there anything that could be done on your end to fix this issue?
I can imagine even a shorter prefix is just a temporary relief, as future versions may trigger even more includes. Thus, I think a more permanent solution for these excessively long command lines may be needed on your end anyway.
Steps to Reproduce
To reproduce: pick a long enough prefix (and possibly build enough of Trilinos' components to get a long link line).
Related Issues
- Follows up on (somewhat) related issue https://github.com/trilinos/Trilinos/issues/2434