Skip to content

Installation issue: quantum-espresso+mpi CMake error with external openmpi #3544

@lorisercole

Description

@lorisercole

Steps to reproduce the issue

I'm using an external openmpi (provided by EESSI). It works fine when I build other packages with Spack, but with quantum-espresso I get a CMake error: Could NOT find OpenMP_Fortran

$ spack spec -I quantum-espresso+mpi                                                                                                                                                                                                                                                                                                            
==> Warning: Spack is trying attach a Python dependency to 'meson@=1.1.1 build_system=python_pip platform=linux os=ubuntu24.04 target=x86_64'. This feature is deprecated, and will be removed in v1.2. Please make the dependency explicit in your configuration.                                                                                                                      
 -   quantum-espresso@7.5~clock~elpa+epw~fox~gipaw~ipo~libxc+mpi~nvtx+openmp+patch~qmcpack+scalapack build_system=cmake build_type=Release generator=make hdf5=none platform=linux os=ubuntu24.04 target=skylake %c,cxx,fortran=gcc@13.2.0                                                                                                                                              
[e]      ^cmake@3.27.6~doc+ncurses~ownlibs~qtgui build_system=generic build_type=Release platform=linux os=ubuntu24.04 target=haswell %c,cxx=gcc@13.2.0                                                                                                                                                                                                                                 
[e]          ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu24.04 target=x86_64                                                                                                                                                                                                                                                                             
[e]          ^curl@8.3.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl platform=linux os=ubuntu24.04 target=haswell %c,cxx=gcc@13.2.0                                                                                                                                                                                      
[e]          ^libarchive@3.7.2+iconv build_system=autotools compression:=bz2lib,lz4,lzma,lzo2,zlib,zstd crypto=openssl libs:=shared,static programs:=none xar=libxml2 platform=linux os=ubuntu24.04 target=haswell %c,cxx=gcc@13.2.0                                                                                                                                                    
[e]          ^ncurses@6.4.20230401+symlinks+termlib abi:=6 build_system=autotools platform=linux os=ubuntu24.04 target=x86_64                                                                                                                                                                                                                                                           
[e]          ^openssl@1.1.1w~docs+shared build_system=generic certs=mozilla platform=linux os=ubuntu24.04 target=x86_64                                                                                                                                                                                                                                                                 
[+]      ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake                                                                                                                                                                                                                                                                                        
[e]      ^fftw@3.3.10~mpi+openmp~pfft_patches+shared build_system=autotools precision:=double,float,long_double,quad platform=linux os=ubuntu24.04 target=haswell %c,fortran=gcc@13.2.0                                                                                                                                                                                                 
[e]      ^flexiblas@3.3.1 build_system=cmake build_type=Release generator=make platform=linux os=ubuntu24.04 target=haswell %c,cxx,fortran=gcc@13.2.0                                                                                                                                                                                                                                   
[e]          ^openblas@0.3.24~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads:=openmp platform=linux os=ubuntu24.04 target=haswell %c,cxx,fortran=gcc@13.2.0                                                                                                                                                
[e]      ^gcc@13.2.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu24.04 target=haswell                                                                                                                                                                
[+]      ^gcc-runtime@13.2.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake                                                                                                                                                                                                                                                                                          
[e]      ^git@2.41.0+man+nls+perl+subtree~tcltk build_system=autotools platform=linux os=ubuntu24.04 target=x86_64 
[e]      ^glibc@2.37 build_system=autotools platform=linux os=ubuntu24.04 target=x86_64 
[e]      ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]      ^m4@1.4.19+sigsegv build_system=autotools platform=linux os=ubuntu24.04 target=x86_64 
[e]      ^netlib-scalapack@2.2.0+pic+shared build_system=cmake build_type=Release generator=make platform=linux os=ubuntu24.04 target=haswell %c,fortran=gcc@13.2.0
[e]      ^openmpi@4.1.6+atomics~cuda~cxx~cxx_exceptions~debug+fortran~gpfs~internal-hwloc~internal-libevent~internal-pmix~ipv6~java~lustre~memchecker~openshmem~orterunprefix+pmi~rocm+romio+rsh~static~two_level_namespace+vt~wrapper-rpath build_system=autotools fabrics:=ofi,psm2,ucc,ucx romio-filesystem:=none schedulers:=none platform=linux os=ubuntu24.04 target=haswell %c,cxx,fortran=gcc@13.2.0
[e]          ^hwloc@2.9.2~cairo~cuda~gl~level_zero~libudev+libxml2~netloc~nvml~opencl+pci~rocm build_system=autotools libs:=shared,static platform=linux os=ubuntu24.04 target=haswell %c,cxx=gcc@13.2.0
[e]              ^libpciaccess@0.17 build_system=autotools platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]              ^libxml2@2.11.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]                  ^xz@5.4.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu24.04 target=x86_64 
[e]              ^numactl@2.0.16 build_system=autotools platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]          ^libevent@2.1.12+openssl build_system=autotools platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]          ^libfabric@1.19.0~asan~cuda~debug~kdreg~level_zero~rocm~uring build_system=autotools fabrics:=opx,psm2,psm3,shm,tcp,udp,verbs platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]          ^pmix@4.2.6~munge~python~restful build_system=autotools platform=linux os=ubuntu24.04 target=haswell %c=gcc@13.2.0
[e]          ^ucc@1.2.0~cuda~rocm build_system=autotools platform=linux os=ubuntu24.04 target=haswell %c,cxx=gcc@13.2.0
[e]          ^ucx@1.15.0~assertions~backtrace_detail+cma~cuda~dc~debug~dm+examples~gdrcopy~gtest~ib_hw_tm~java~knem~logging~mlx5_dv+openmp+optimizations~parameter_checking+pic~rc~rdmacm~rocm+thread_multiple~ucg~ud+verbs~vfs~xpmem build_system=autotools libs:=shared,static opt=3 simd:=auto platform=linux os=ubuntu24.04 target=haswell %c,cxx=gcc@13.2.0

Error message

Error message
=> Installing quantum-espresso-7.5-yvnba4mskdcenzxa6rg3bphrrtjx4x6f [29/29]
==> Using cached archive: /home/lercole/src/spack/var/spack/cache/_source-cache/archive/7e/7e1f7a9a21b63192f5135218bee20a5321b66582e4756536681b76e9c59b3cc8.tar.gz
==> No patches needed for quantum-espresso
==> quantum-espresso: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
    '/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/CMake/3.27.6-GCCcore-13.2.0/bin/cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/home/lercole/eessi/demo/opt/linux-skylake/quantum-espresso-7.5-yvnba4mskdcenzxa6rg3bphrrtjx4x6f' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/home/lercole/eessi/demo/opt/linux-skylake/quantum-espresso-7.5-yvnba4mskdcenzxa6rg3bphrrtjx4x6f/lib;/home/lercole/eessi/demo/opt/linux-skylake/quantum-espresso-7.5-yvnba4mskdcenzxa6rg3bphrrtjx4x6f/lib64' '-DCMAKE_PREFIX_PATH:STRING=/home/lercole/eessi/demo/opt/linux-skylake/compiler-wrapper-1.0-i54t7tjn3prjyb363kdjgrkiawikdvyu;/home/lercole/eessi/demo/opt/linux-skylake/gcc-runtime-13.2.0-xq2ynciabmcqshyme3kyqgli6iyfwkci;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/CMake/3.27.6-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/FFTW/3.3.10-GCC-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/GCCcore/13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/make/4.4.1-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/ScaLAPACK/2.2.0-gompi-2023b-fb;/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/FlexiBLAS/3.3.1-GCC-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/OpenMPI/4.1.6-GCC-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/OpenBLAS/0.3.24-GCC-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/libfabric/1.19.0-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/pmix/4.2.6-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/ucc/1.2.0-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/hwloc/2.9.2-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/libevent/2.1.12-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/ucx/1.15.0-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/libpciaccess/0.17-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/libxml2/2.11.5-GCCcore-13.2.0;/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/numactl/2.0.16-GCCcore-13.2.0' '-DCMAKE_BUILD_TYPE:STRING=Release' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_POLICY_DEFAULT_CMP0090:STRING=NEW' '-DCMAKE_FIND_USE_PACKAGE_REGISTRY:BOOL=OFF' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DQE_ENABLE_MPI:BOOL=ON' '-DQE_ENABLE_OPENMP:BOOL=ON' '-DQE_ENABLE_SCALAPACK:BOOL=ON' '-DQE_ENABLE_ELPA:BOOL=OFF' '-DQE_ENABLE_LIBXC:BOOL=OFF' '' '-DQE_ENABLE_PROFILE_NVTX:BOOL=OFF' '-DQE_CLOCK_SECONDS:BOOL=OFF' '' '-DCMAKE_C_COMPILER:STRING=/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/OpenMPI/4.1.6-GCC-13.2.0/bin/mpicc' '-DCMAKE_Fortran_COMPILER:STRING=/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/OpenMPI/4.1.6-GCC-13.2.0/bin/mpif90' '/tmp/lercole/spack-stage/spack-stage-quantum-espresso-7.5-yvnba4mskdcenzxa6rg3bphrrtjx4x6f/spack-src'

1 error found in build log:
     31    This warning is for project developers.  Use -Wno-dev to suppress it.
     32    
     33    -- Enable sanitizer QE_ENABLE_SANITIZER=none
     34    -- C preprocessor used by qe_preprocess_source in qeHelpers.cmake: /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/GCCcore/13.2.0/bin/cpp
     35    -- Performing Test Fortran_ISYSTEM_SUPPORTED
     36    -- Performing Test Fortran_ISYSTEM_SUPPORTED - Success
  >> 37    CMake Error at /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/CMake/3.27.6-GCCcore-13.2.0/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
     38      Could NOT find OpenMP_Fortran (missing: OpenMP_Fortran_FLAGS
     39      OpenMP_Fortran_LIB_NAMES)
     40    Call Stack (most recent call first):
     41      /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/CMake/3.27.6-GCCcore-13.2.0/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
     42      /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/haswell/software/CMake/3.27.6-GCCcore-13.2.0/share/cmake-3.27/Modules/FindOpenMP.cmake:577 (find_package_handle_standard_args)
     43      CMakeLists.txt:304 (find_package)

See build log for details:
  /tmp/lercole/spack-stage/spack-stage-quantum-espresso-7.5-yvnba4mskdcenzxa6rg3bphrrtjx4x6f/spack-build-out.txt

Information on your system

$ spack debug report
* **Spack:** 1.2.0.dev0 (https://github.com/spack/spack/commit/492d48341736e420597eb7564e89e4267b16edc0)
* **Builtin repo:** https://github.com/spack/spack-packages/commit/ceae411aa6294f84ac7b2f356148724bd406f120
* **Python:** 3.13.7
* **Platform:** linux-ubuntu24.04-skylake

Additional information

spack-build-out.txt
spack-build-env.txt

The problem originates from these CMake flags:

# QE prefers taking MPI compiler wrappers as CMake compilers.
if "+mpi" in spec:
cmake_args.append(self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc))
cmake_args.append(self.define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc))

They do not work well with Spack & MPI wrappers.
Further notes here.

@ye-luo

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions