easybuilders / easybuild-easyconfigs

A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
371 stars 699 forks source link

ARGoS-3.0.0-beta59-GCC-11.2.0.eb fails to build with eb --rpath #15544

Open casparvl opened 2 years ago

casparvl commented 2 years ago

The main argos3 executable is not rpath-ed correctly, therefore the sanity check fails:

== sanity checking...
== ... (took 1 secs)
== FAILED: Installation ended unsuccessfully (build directory: /scratch-shared/casparl/ARGoS/3.0.0-beta59/GCC-11.2.0): build failed (first 300 chars): Sanity check failed: One or more required libraries not found for /home/casparl/.local/easybuild/Centos8/2021/software/ARGoS/3.0.0-beta59-GCC-11.2.0/bin/argos3:     linux-vdso.so.1 (0x00007fff965d4000)
        libargos3core_simulator.so => not found
        libdl.so.2 => /lib64/libdl.so.2 (0x000014dd8db53000)
        libpt (took 2 mins 16 secs)
== Results of the build can be found in the log file(s) /scratch-shared/casparl/eb-8nachfc1/easybuild-ARGoS-3.0.0-beta59-20220524.193826.KVlOL.log

I think the reason it is not RPATH-ed is that CMAKE's configure seems to pick up on the real compilers, rather than the rpath wrappers:

== 2022-05-24 19:38:29,944 run.py:233 INFO running cmd:  cmake -DCMAKE_INSTALL_PREFIX=/home/casparl/.local/easybuild/Centos8/2021/software/ARGoS/3.0.0-beta59-GCC-11.2.0 -DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER='gcc' -DCMAKE_C_FLAGS='-O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno' -DCMAKE_CXX_COMPILER='g++' -DCMAKE_CXX_FLAGS='-O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno' -DCMAKE_Fo
rtran_COMPILER='gfortran' -DCMAKE_Fortran_FLAGS='-O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno' -DCMAKE_SKIP_RPATH=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE -DARGOS_
DOCUMENTATION=OFF -DARGOS_INSTALL_LDSOCONF=OFF -DARGOS_BUILD_NATIVE=ON -DCMAKE_CXX_COMPILER=g++ /gpfs/scratch1/shared/casparl/ARGoS/3.0.0-beta59/GCC-11.2.0/argos3-3.0.0-beta59/src
== 2022-05-24 19:38:34,061 run.py:623 INFO cmd " cmake -DCMAKE_INSTALL_PREFIX=/home/casparl/.local/easybuild/Centos8/2021/software/ARGoS/3.0.0-beta59-GCC-11.2.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_
C_COMPILER='gcc' -DCMAKE_C_FLAGS='-O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno' -DCMAKE_CXX_COMPILER='g++' -DCMAKE_CXX_FLAGS='-O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno' -DCMAKE_Fortran_COMPILER='gfortran' -DCMAKE_Fortran_FLAGS='-O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno' -DCMAKE_SKIP_RPATH=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE -DARGOS_DOCUMENTATION=OFF -DARGOS_INSTALL_LDSOCONF=OFF -DARGOS_BUILD_NATIVE=ON -DCMAKE_CXX_COMPILER=g++ /gpfs/scratch1/shared/casparl/ARGoS/3.0.0-beta59/GCC-11.2.0/argos3-3.0.0-beta59/src" exited with exit code 0 and output:
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/casparl/.local/easybuild/Centos8/2021/software/GCCcore/11.2.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/casparl/.local/easybuild/Centos8/2021/software/GCCcore/11.2.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

I think it should have picked up on based on the PATH:

== 2022-05-24 19:38:29,927 filetools.py:525 INFO Command g++ found at /home/casparl/.local/easybuild/Centos8/2021/software/GCCcore/11.2.0/bin/g++
== 2022-05-24 19:38:29,929 filetools.py:1882 INFO Creating directory /scratch-shared/casparl/eb-8nachfc1/tmpuzq1h10_/rpath_wrappers/gxx_wrapper (parents: True, set_gid: True, sticky: False)
== 2022-05-24 19:38:29,929 filetools.py:1734 INFO Adjusting permissions recursively for /scratch-shared/casparl/eb-8nachfc1/tmpuzq1h10_/rpath_wrappers/gxx_wrapper
== 2022-05-24 19:38:29,930 filetools.py:1734 INFO Adjusting permissions recursively for /scratch-shared/casparl/eb-8nachfc1/tmpuzq1h10_/rpath_wrappers/gxx_wrapper/g++
== 2022-05-24 19:38:29,930 environment.py:91 INFO Environment variable PATH set to /scratch-shared/casparl/eb-8nachfc1/tmpuzq1h10_/rpath_wrappers/gxx_wrapper:/scratch-shared/casparl/eb-8nachfc1/tmpuzq1h10_/rpath_wrappers/gcc_wrapper:/home/casparl/.local/easybuild/Centos8/2021/software/motif/2.3.8-GCCcore-11.2.0/bin:

Not sure why it doesn't. Anyway, the verbose link command shows that it indeed invokes the real compiler by full path when linking argos3:

[ 30%] Linking CXX executable argos3
...
/home/casparl/.local/easybuild/Centos8/2021/software/GCCcore/11.2.0/bin/g++ -O2 -ftree-vectorize -O2 -mavx2 -fno-math-errno -Wall -Wno-unknown-pragmas -mtune=native -march=native -O3 -DNDEBUG -O3
-DNDEBUG -L/home/casparl/.local/easybuild/Centos8/2021/software/motif/2.3.8-GCCcore-11.2.0/lib64 -L/home/casparl/.local/easybuild/Centos8/2021/software/motif/2.3.8-GCCcore-11.2.0/lib -L/home/casparl/.local/easybuild/Centos8/2021/software/freeglut/3.2.1-GCCcore-11.2.0/lib64 -L/home/casparl/.local/easybuild/Centos8/2021/software/freeglut/3.2.1-GCCcore-11.2.0/lib -L/home/casparl/.local/easybuild/Centos8/2021/software/Qt5/5.15.2-GCCcore-11.2.0/lib64 -L/home/casparl/.local/easybuild/Centos8/2021/software/Qt5/5.15.2-GCCcore-11.2.0/lib -L/home/casparl/.local/easybuild/Centos8/2021/software/FreeImage/3.18.0-GCCcore-11.2.0/lib64 -L/home/casparl/.local/easybuild/Centos8/2021/software/FreeImage/3.18.0-GCCcore-11.2.0/lib -L/home/casparl/.local/easybuild/Centos8/2021/software/Lua/5.4.3-GCCcore-11.2.0/lib64 -L/home/casparl/.local/easybuild/Centos8/2021/software/Lua/5.4.3-GCCcore-11.2.0/lib -L/home/casparl/.local/easybuild/Centos8/2021/software/GCCcore/11.2.0/lib64 -L/home/casparl/.local/easybuild/Centos8/2021/software/GCCcore/11.2.0/lib CMakeFiles/argos3.dir/argos3_autogen/mocs_compilation.cpp.o CMakeFiles/argos3.dir/simulator/query_plugins.cpp.o CMakeFiles/argos3.dir/simulator/main.cpp.o -o argos3   -L/gpfs/scratch1/shared/casparl/ARGoS/3.0.0-beta59/GCC-11.2.0/argos3-3.0.0-beta59/src/plugins/simulator/physics_engines/physx/physx_dist/lib/linux64  libargos3core_simulator.so /usr/lib64/libdl.so /usr/lib64/libpthread.so /home/casparl/.local/easybuild/Centos8/2021/software/FreeImage/3.18.0-GCCcore-11.2.0/lib/libfreeimage.so /home/casparl/.local/easybuild/Centos8/2021/software/FreeImage/3.18.0-GCCcore-11.2.0/lib/libfreeimageplus.so /home/casparl/.local/easybuild/Centos8/2021/software/Lua/5.4.3-GCCcore-11.2.0/lib/liblua.a -lm -ldl

Of course, this way, the RPATH wrappers are never invoked and it makes sense that the libraries linked here are not RPATH-ed. What I don't understand is how the RPATH wrappers are not picked up by CMAKE's configure in the first place...

boegel commented 2 years ago

@casparvl I can reproduce the issue easily, with "eb --rpath ARGoS-3.0.0-beta59-GCC-11.2.0.eb --force --installpath /tmp/$USER", where all dependencies are installed without RPATH.

Is the whole stack built with RPATH enabled in your case?

Because I suspect that CMake may be getting path to the compiler via a dependency...

casparvl commented 2 years ago

Yep, full stack is compiled with RPATH