Installing preCICE with Spack and HPE MPI

Hi,

I am trying to install Precice on our local HPC facility using Spack. The system is HPE so need to use HPE MPI (MPT-2.25)
Other details are as follows:
Please describe your system, and especially:

  • Precice Version 2.5
  • Linux: Red Hat Enterprise Linux 8.4
  • Building using Spack
  • Gcc 8.2.0, Boost 1.80, MPI: HPE MPT-2.25)

The build continues to Parmetis@4.0.3 where I get this error

1 error found in build log:
12 – The CXX compiler identification is unknown
13 – Detecting C compiler ABI info
14 – Detecting C compiler ABI info - done
15 – Check for working C compiler: /opt/hpe/hpc/mpt/mpt-2.25/bin/mpicc - skipped
16 – Detecting C compile features
17 – Detecting C compile features - done

18 CMake Error at CMakeLists.txt:2 (project):
19 The CMAKE_CXX_COMPILER:
20
21 /opt/hpe/hpc/mpt/mpt-2.25/bin/mpic++
22
23 is not a full path to an existing compiler tool.

I think the error is clear it is trying to use “mpic++” but MPT only provides “mpicxx”. So just wondering if it is possible to pass CMAKE_CXX_COMPILER to Spack to use mpicxx instead of mpic++ for Parmetis build or if there is any other Spack-specific method to control this?

I also read in Spack documentation that in install() function something like

env[‘CXX’] = spec[‘mpi’].mpicxx

can be used, but not sure exactly to set this?

Kind regards
Sina

You can tell Spack to discover compilers in your system. This could be a good starting point: Basic Usage — Spack 0.20.0.dev0 documentation (see “Compiler environment variables and additional RPATHs”)

See also spack compiler find.

1 Like

Hi,
Thanks for your reply. The problem is not the compiler, the compiler (Gcc 8.2.0) is already found and is added to the compilers.yaml. It is that MPT (which provides MPI libs and wrappers for HPE systems) does not provide mpic++ (only mpicxx). But to build the dependency Parmetis, Spack is looking for mpic++ which does not exist (I also can’t create an alias as I don’t have write permissions).
So my question is if there is a way of telling Spack to build the Parmetis dependency with mpicxx rather than mpic++?
Thanks
Sina

But wouldn’t setting the compiler to, e.g., /usr/bin/mpicxx (or whatever path) work?
I think that using these compiler wrappers is equivalent to setting compiler + MPI library.

no setting that in compilers.yaml will build everything else with mpicxx but when it comes to Parmetis it is still looking for mpic++ for some reason.
Even in …/parmetis/package.py the CMAKE_CXX_COMPILER shows as mpicxx:

def cmake_args(self):
    spec = self.spec

    options = []
    options.extend(
        [
            "-DGKLIB_PATH:PATH=%s/GKlib" % spec["metis"].prefix.include,
            "-DMETIS_PATH:PATH=%s" % spec["metis"].prefix,
            "-DCMAKE_C_COMPILER:STRING=%s" % spec["mpi"].mpicc,
            "-DCMAKE_CXX_COMPILER:STRING=%s" % spec["mpi"].mpicxx,
        ]
    )

not sure where mpic++ comes from :face_with_monocle: :tired_face:

I am not sure how to help… :face_with_diagonal_mouth: Maybe @fsimonis has some idea, but this looks like something for the Spack Slack or Spack Discussions.

In case anybody else is interested in this, I managed to build this eventually.
mpic++ were leaked into the environment from spack/var/spack/repos/builtin/packages/openmpi/package.py, I edited the file and changed mpic++ to mpicxx and it was built successfully.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.