LLNL / axom

CS infrastructure components for HPC applications
BSD 3-Clause "New" or "Revised" License
157 stars 27 forks source link

Axom Spack fails to build with MPI=OFF and Conduit=Static #865

Open mdavis36 opened 2 years ago

mdavis36 commented 2 years ago

We are getting failures in our spack builds of Axom when Conduit is static and when MPI is disabled. Below is the configuration we are trying to build:

spack install axom@0.5.0~shared~mpi+hdf5~lua~examples~python~fortran~umpire~raja 
                ^conduit@0.8.2~shared~mpi+hdf5~test
                ^hdf5@1.8.19~mpi+hl 
                ^zlib@1.2.11~shared+pic

The error seems to happen when linking mesh_tester. ld is reporting an undefined reference to in the hdf5 library so I'm not certain what's happening here.

     408    [100%] Linking CXX executable ../bin/mesh_tester
     409    cd /usr/WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/builds/spack-stage-axom-0.5.0-lss5orxj6o5d2ezmslmdtpjc7pdkpjnk/spack-build-lss5orx/tools && /usr/tce/packages/cmake/cmake-3.20.2/bin/cmake -E cmake_link_script CMakeFiles/mesh_tester.dir/link.txt --verbose=1
     410    /usr/WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/spack/lib/spack/env/clang/clang++      -Wall -Wextra  -O2 -g -DNDEBUG   -Wl,-rpath,/usr/tce/packages/clang/clang-9.0.0/lib -Wl,--export-dynamic -rdynamic -fopenmp=libomp CMakeFiles/mesh_tester.dir/mesh_tester.cpp.o -o ../bin/mesh_tester   -L/usr/tce/packages/gcc/gcc-8.1.0/lib64/gcc/x86_64-pc-li
            nux-gnu/8.1.0  -L/usr/tce/packages/gcc/gcc-8.1.0/lib64  -Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ../lib/libaxom.a /usr/WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-
            ivybridge/clang-9.0.0/conduit-0.8.2-eha4kz5azq3upu67ixhtmshvjmxcltzs/lib/libconduit_relay.a -lpthread -ldl -lrt -lm -ldl -lrt -lm /usr/WS2/wciuser/Spheral/spheral-spack-tpls/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_p/linux-rhel7-ivybridge/clang-9.0.0/zlib-1.2.11-nprxffrjrf34e5v5da6nkcrjxoy7qvn3/lib/libz.a /usr
            /WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-ivybridge/clang-9.0.0/conduit-0.8.2-eha4kz5azq3upu67ixhtmshvjmxcltzs/lib/libconduit_blueprint.a /usr/WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeho
            lder__/linux-rhel7-ivybridge/clang-9.0.0/conduit-0.8.2-eha4kz5azq3upu67ixhtmshvjmxcltzs/lib/libconduit.a /usr/WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-ivybridge/clang-9.0.0/hdf5-1.8.19-p7rxcy5dhd2cxdcn7gprthc7g5xebult/lib/libhdf5.a -lgfortran -lquadmath
  >> 411    /bin/ld: /usr/WS2/davis291/SPHERAL/spheral/spheral-spack-tpls-toss/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-ivybridge/clang-9.0.0/hdf5-1.8.19-p7rxcy5dhd2cxdcn7gprthc7g5xebult/lib/libhdf5.a(H5Zdeflate.c.o): undefined reference to symbol 'inflate'
  >> 412    //usr/lib64/libz.so.1: error adding symbols: DSO missing from command line
  >> 413    clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
  >> 414    make[2]: *** [bin/mesh_tester] Error 1

If Conduit is built +shared we can build Axom, however our customer codes preference is to use the static version of these libraries if at all possible.

spack install axom@0.5.0~shared~mpi+hdf5~lua~examples~python~fortran~umpire~raja 
                ^conduit@0.8.2+shared~mpi+hdf5~test
                ^hdf5@1.8.19~mpi+hl 
                ^zlib@1.2.11~shared+pic
cyrush commented 2 years ago

@mdavis36 conduit 0.8.3 has a fix related to linking with zlib and hdf5. Can you try with conduit 0.8.3?

rhornung67 commented 2 years ago

@mdavis36 also, axom 0.5.0 is pretty old. you should probably update to 0.6.1

mdavis36 commented 2 years ago

@cyrush @rhornung67 We are using 0.8.2 and 0.5.0 as that is what the our customer codes are using. conduit 0.8.3 + axom 0.5.0 produced the same error as above. With conduit 0.8.3 + axom 0.6.1 I got :

18 errors found in build log:
     406    make[2]: Leaving directory `/usr/WS2/davis291/SPHERAL/spheral-spack-tpls/builds/spack-stage-axom-0.6.1-tadbh4yfa25a5a3uv
            lxbuix75oydmnwl/spack-build-tadbh4y'
     407    /usr/tce/packages/cmake/cmake-3.20.2/bin/cmake -E cmake_copy_f90_mod lib/fortran/axom_quest.mod axom/quest/CMakeFiles/qu
            est.dir/axom_quest.mod.stamp GNU
     408    [ 95%] Built target primal
     409    /usr/tce/packages/cmake/cmake-3.20.2/bin/cmake -E touch axom/quest/CMakeFiles/quest.dir/interface/c_fortran/wrapfquest.F
            .o.provides.build
     410    /usr/tce/packages/cmake/cmake-3.20.2/bin/cmake -E cmake_copy_f90_mod lib/fortran/axom_sidre.mod axom/sidre/CMakeFiles/si
            dre.dir/axom_sidre.mod.stamp GNU
     411    /usr/tce/packages/cmake/cmake-3.20.2/bin/cmake -E touch axom/sidre/CMakeFiles/sidre.dir/interface/c_fortran/wrapfsidre.F
            .o.provides.build
  >> 412    /usr/WS2/davis291/SPHERAL/spheral-spack-tpls/builds/spack-stage-axom-0.6.1-tadbh4yfa25a5a3uvlxbuix75oydmnwl/spack-src/sr
            c/axom/quest/interface/signed_distance.cpp:37:23: error: ‘OMP_EXEC’ in namespace ‘axom’ does not name a type
     413     using ExecOMP = axom::OMP_EXEC;
     414                           ^~~~~~~~
     415    /usr/WS2/davis291/SPHERAL/spheral-spack-tpls/builds/spack-stage-axom-0.6.1-tadbh4yfa25a5a3uvlxbuix75oydmnwl/spack-src/sr
            c/axom/quest/interface/signed_distance.cpp:37:17: note: suggested alternative: ‘SEQ_EXEC’
     416     using ExecOMP = axom::OMP_EXEC;
     417                     ^~~~
     418                     SEQ_EXEC
  >> 419    /usr/WS2/davis291/SPHERAL/spheral-spack-tpls/builds/spack-stage-axom-0.6.1-tadbh4yfa25a5a3uvlxbuix75oydmnwl/spack-src/sr
            c/axom/quest/interface/signed_distance.cpp:38:47: error: ‘ExecOMP’ was not declared in this scope
     420     using SignedDistance3DOMP = SignedDistance<3, ExecOMP>;
     421                                                   ^~~~~~~
     422    /usr/WS2/davis291/SPHERAL/spheral-spack-tpls/builds/spack-stage-axom-0.6.1-tadbh4yfa25a5a3uvlxbuix75oydmnwl/spack-src/sr
            c/axom/quest/interface/signed_distance.cpp:38:47: note: suggested alternative: ‘ExecSeq’
     423     using SignedDistance3DOMP = SignedDistance<3, ExecOMP>;
     424                                                   ^~~~~~~
     425                                                   ExecSeq

This new error seems to come from axom ~raja, building axom +raja fixes this. We plan on bringing raja into our dependencies soon, so we can work around this in the meantime, but it still looks like this is a broken spack configuration to be aware about.

kennyweiss commented 2 years ago

@mdavis36 -- for completeness -- which version of spack are you using?