Install preCICE with Spack on macOS

I’m using macOS Catalina 10.15.5 and trying to install preCICE v2.1.0 with spack. In the 2nd step

spack install precice

there is an error while installing precice:

1 error found in build log:
     108    -- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes - Failed
     109    -- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries
     110    -- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries - Failed
     111    -- Performing Test MULTIPASS_TEST_4_petsc_works_all
     112    -- Performing Test MULTIPASS_TEST_4_petsc_works_all - Failed
     113    -- PETSc could not be used, maybe the install is broken.
  >> 114    CMake Error at /Users/siqiwei/Documents/spack/opt/spack/darwin-catalina-x86_64/apple-clang-11.0.3/cmake-3.18.1-u4guucbahyuq5pswf55b2ebqslsjub7m/
            share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
     115      PETSc could not be found.  Be sure to set PETSC_DIR and PETSC_ARCH.
     116      (missing: PETSC_EXECUTABLE_RUNS) (found suitable version "3.13.1", minimum
     117      required is "3.12")
     118    Call Stack (most recent call first):
     119      /Users/siqiwei/Documents/spack/opt/spack/darwin-catalina-x86_64/apple-clang-11.0.3/cmake-3.18.1-u4guucbahyuq5pswf55b2ebqslsjub7m/share/cmake-3
            .18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
     120      cmake/modules/FindPETSc.cmake:345 (find_package_handle_standard_args)

Thank you!!
spack-build-out.txt (11.8 KB)

Thank you for reporting this, @VickyWei! This is probably a general issue with our FindPETSc.cmake on macOS. We currently don’t have enough experience with preCICE on macOS, so it would be great if you could open an issue about this for us to look at it.

In the meantime, do you need PETSc? Since v2.1, one only needs it to for parallel RBF mapping in parallel for very large cases. For smaller cases, we now also have an alternative (simpler but slower) implementation.

You can build preCICE without PETSc like this:

spack install precice -petsc

In general, +option enables an option, while -option disables it. If you want to learn more about this, you can look into the Spack documentation. You can see all the options that the preCICE Spack package offers using spack info precice.

1 Like

@VickyWei did you manage to solve this problem (and if yes, how)?

In next releases of preCICE we will change how we lookup PETSc, to use the generated pkg-config file. Until then, this comment may be useful for anyone wanting to experiment with the CMake files of preCICE.

It would be interesting to see what error appears in the files CMakeOutput.log and CMakeError.log that are mentioned at the end of the file you have attached:

-- Configuring incomplete, errors occurred!
See also "/private/var/folders/g5/5k4zzssj7c19nf7kskcfwp680000gn/T/siqiwei/spack-stage/spack-stage-precice-2.1.0-v6veepazxv4cjbqglrkycepbn2s3bwut/spack-build/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/g5/5k4zzssj7c19nf7kskcfwp680000gn/T/siqiwei/spack-stage/spack-stage-precice-2.1.0-v6veepazxv4cjbqglrkycepbn2s3bwut/spack-build/CMakeFiles/CMakeError.log".

I have been compiling preCICE with Spack a lot in the past weeks (not on a Mac though) and I have seen this type of error way too often. It also appears for other software packages that use PETSc as a dependency and CMake as a build system. Unfortunately, this error can have a variety of different causes. Once it helped to use MPICH instead of OpenMPI, but the CMake output files would help a lot to find the cause in your case.

Nevertheless, the solution proposed by Makis should be the easiest way to fix your problem.

2 Likes

Hello, spack install precice is going to install preCICE v2.1.1 in which the compilation issues of macOS has not been resolved. Even though you shortcut the PETSc installation, probably you are going to face compilation issues.

With recent updates these problems are resolved. These updates will be available in the next release but you can already use it from develop branch which you can install with spack install precice@develop. I have tried it on my macOS Catalina 10.15.7 and it works. I hope it helps

2 Likes