# Install preCICE with Spack on macOS

**URL:** <https://precice.discourse.group/t/install-precice-with-spack-on-macos/295>\
**Category:** Installing preCICE\
**Tags:** spack\
**Created:** [August 6, 2020, 9:59pm UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295 "2020-08-06T21:59:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![VickyWei](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/vickywei/32/295_2.png) [@VickyWei](https://precice.discourse.group/u/VickyWei)\
**Post date:** [August 6, 2020, 9:59pm UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/1 "2020-08-06T21:59:04Z")

</div>

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](https://precice.discourse.group/uploads/short-url/3TlSUIor0MBDMydJFnBvbrpTmVU.txt) (11.8 KB)

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [August 7, 2020, 6:28am UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/2 "2020-08-07T06:28:06Z")

</div>

Thank you for reporting this, @VickyWei! This is probably a general issue with our [FindPETSc.cmake](https://github.com/precice/precice/blob/develop/cmake/modules/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](https://github.com/precice/precice/issues) 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](https://spack.readthedocs.io/en/latest/). You can see all the options that the preCICE Spack package offers using `spack info precice`.

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [September 16, 2020, 10:53am UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/3 "2020-09-16T10:53:54Z")

</div>

@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](https://www.mcs.anl.gov/petsc/documentation/installation.html#pkgconfig). Until then, this comment may be useful for anyone wanting to experiment with the CMake files of preCICE.

---

<div class="post-metadata">

**Author:** ![ajaust](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ajaust/32/160_2.png) [@ajaust](https://precice.discourse.group/u/ajaust)\
**Post date:** [September 17, 2020, 2:08pm UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/4 "2020-09-17T14:08:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![oguzziya](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/oguzziya/32/155_2.png) [@oguzziya](https://precice.discourse.group/u/oguzziya)\
**Post date:** [November 4, 2020, 4:04pm UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/5 "2020-11-04T16:04:18Z")

</div>

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](https://github.com/precice/precice/pull/877) 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

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [January 20, 2021, 4:34pm UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/6 "2021-01-20T16:34:30Z")

</div>

All known bugs regarding Spack on macOS should have been fixed with preCICE v2.2.0. See Spack PR: [precice: Add version 2.2.0 by MakisH · Pull Request #21166 · spack/spack · GitHub](https://github.com/spack/spack/pull/21166)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [January 23, 2021, 4:34pm UTC](https://precice.discourse.group/t/install-precice-with-spack-on-macos/295/7 "2021-01-23T16:34:32Z")

</div>

Closed on January 23, 2021, 4:34pm UTC

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