Error when Building dolfinx with Spack

Hello, I encounter an error when installing Doflinx using Spack on a cluster with RockyLinux. It builds all other packages and fails when installing Dolfinx. I used the commands in the Readme.
I’m using GCC 11.4.0.

3 errors found in build log:
     3     -- The C compiler identification is unknown
     4     -- The CXX compiler identification is GNU 11.4.1
     5     -- Detecting C compiler ABI info
     6     -- Detecting C compiler ABI info - failed
     7     -- Check for working C compiler: /project/hmd/neighbor/applications/dolfinx-scripts/spack/opt/spack/linux-icelake/compiler-wrapper-1.0-npldlhubbarurtsz
           fwegikrqmqjgimdi/libexec/spack/cc
     8     -- Check for working C compiler: /project/hmd/neighbor/applications/dolfinx-scripts/spack/opt/spack/linux-icelake/compiler-wrapper-1.0-npldlhubbarurtsz
           fwegikrqmqjgimdi/libexec/spack/cc - broken
  >> 9     CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
     10      The C compiler
     11    
     12        "/project/hmd/applications/dolfinx-scripts/spack/opt/spack/linux-icelake/compiler-wrapper-1.0-npldlhubbarurtszfwegikrqmqjgimdi/libexec/spa
           ck/cc"
     13    
     14      is not able to compile a simple test program.
     15    

     ...

     19    
     20        Run Build Command(s):/usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_0c91b/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_0c91b.dir/build
           .make CMakeFiles/cmTC_0c91b.dir/build
     21        gmake[1]: Entering directory '/project/hmd/spack-tmp/spack-stage/spack-stage-fenics-dolfinx-0.9.0-keyvkvrwr5yj7djxxinj37t2ih4rut2w/spack-build-keyv
           kvr/CMakeFiles/CMakeScratch/TryCompile-WKzXKU'
     22        Building C object CMakeFiles/cmTC_0c91b.dir/testCCompiler.c.o
     23        /project/hmd/applications/dolfinx-scripts/spack/opt/spack/linux-icelake/compiler-wrapper-1.0-npldlhubbarurtszfwegikrqmqjgimdi/libexec/spac
           k/cc    -o CMakeFiles/cmTC_0c91b.dir/testCCompiler.c.o -c /project/hmd/spack-tmp/spack-stage/spack-stage-fenics-dolfinx-0.9.0-keyvkvrwr5yj7djxxinj37t2i
           h4rut2w/spack-build-keyvkvr/CMakeFiles/CMakeScratch/TryCompile-WKzXKU/testCCompiler.c
     24        /project/hmd/applications/dolfinx-scripts/spack/opt/spack/linux-icelake/compiler-wrapper-1.0-npldlhubbarurtszfwegikrqmqjgimdi/libexec/spac
           k/cc: line 405: SPACK_CC_RPATH_ARG: ERROR: RPATH ARG WAS NOT SET, MAYBE THE PACKAGE DOES NOT DEPEND ON CC?
  >> 25    gmake[1]: *** [CMakeFiles/cmTC_0c91b.dir/build.make:78: CMakeFiles/cmTC_0c91b.dir/testCCompiler.c.o] Error 1
     26        gmake[1]: Leaving directory '/project/hmd/spack-tmp/spack-stage/spack-stage-fenics-dolfinx-0.9.0-keyvkvrwr5yj7djxxinj37t2ih4rut2w/spack-build-keyvk
           vr/CMakeFiles/CMakeScratch/TryCompile-WKzXKU'
  >> 27        gmake: *** [Makefile:127: cmTC_0c91b/fast] Error 2
     28    
     29    
     30    
     31    
     32    
     33      CMake will not be able to correctly generate this project.

I had the same problem,

It is solved by a PR:

Installing v0.9.0 via Spack on HPC - #2 by steffenger

1 Like