# Error building adapted CalculiX, still getting "fatal error: precice/SolverInterfaceC.h: No such file or directory"

**URL:** <https://precice.discourse.group/t/error-building-adapted-calculix-still-getting-fatal-error-precice-solverinterfacec-h-no-such-file-or-directory/1538>\
**Category:** Installing preCICE\
**Tags:** adapters, calculix\
**Created:** [August 31, 2023, 8:19am UTC](https://precice.discourse.group/t/error-building-adapted-calculix-still-getting-fatal-error-precice-solverinterfacec-h-no-such-file-or-directory/1538 "2023-08-31T08:19:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielMeza](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/danielmeza/32/1854_2.png) [@DanielMeza](https://precice.discourse.group/u/DanielMeza)\
**Post date:** [August 31, 2023, 8:19am UTC](https://precice.discourse.group/t/error-building-adapted-calculix-still-getting-fatal-error-precice-solverinterfacec-h-no-such-file-or-directory/1538/1 "2023-08-31T08:19:34Z")

</div>

Hello,  
I installed precice@2.2.0 compiled with gcc@11.4.0 using spack. I am using Ubuntu 22.04.3 LTS (Jammy Jellyfish). When building the CalculiX adapter, I keep getting the error “fatal error: precice/SolverInterfaceC.h: No such file or directory” despite linking the make command to the directory with the file libprecice.pc and cleaning the make.

I read the hint in troubleshooting for linking precice, suggesting that the structure of the directories could be the reason. However, mine should be right, as the header files are located in /include/precice/

Dummy solvers are running fine. So that makes me think that my preCICE installation should be right.

Installation tree

```plaintext
(base) daniel@jefi:~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe$ tree
.
├── bin
│ └── binprecice
├── include
│ └── precice
│ ├── SolverInterfaceC.h
│ ├── SolverInterfaceFASTEST.hpp
│ ├── SolverInterfaceFortran.hpp
│ └── SolverInterface.hpp
├── lib
│ ├── cmake
│ │ └── precice
│ │ ├── preciceConfig.cmake
│ │ ├── preciceConfigVersion.cmake
│ │ ├── preciceTargets.cmake
│ │ └── preciceTargets-release.cmake
│ ├── libprecice.so -> libprecice.so.2
│ ├── libprecice.so.2 -> libprecice.so.2.2.0
│ ├── libprecice.so.2.2.0
│ └── pkgconfig
│ └── libprecice.pc
└── share
    ├── doc
    │ └── libprecice2
    │ ├── changelog.gz
    │ └── copyright
    ├── lintian
    │ └── overrides
    │ └── libprecice2
    ├── man
    │ └── man1
    │ └── binprecice.1.gz
    └── precice
        └── examples
            └── solverdummies
                ├── c
                │ ├── CMakeLists.txt
                │ ├── README.md
                │ └── solverdummy.c
                ├── cpp
                │ ├── CMakeLists.txt
                │ ├── README.md
                │ ├── solverdummy.cpp
                │ └── test.cmake
                ├── fortran
                │ ├── CMakeLists.txt
                │ ├── README.md
                │ └── solverdummy.f90
                ├── precice-config.xml
                ├── README.md
                └── solverdummies.doxys

```

Spack packages:

```plaintext
(base) daniel@jefi:~$ spack find
-- linux-ubuntu22.04-skylake / gcc@11.4.0 -----------------------
autoconf@2.69 libevent@2.1.12 pkgconf@1.9.5
automake@1.16.5 libffi@3.4.4 pmix@4.2.4
berkeley-db@18.1.40 libiconv@1.17 precice@2.2.0
bison@3.8.2 libmd@1.0.4 py-cython@0.29.36
boost@1.74.0 libpciaccess@0.17 py-flit-core@3.9.0
bzip2@1.0.8 libsigsegv@2.14 py-mpi4py@3.1.4
ca-certificates-mozilla@2023-05-30 libtool@2.4.7 py-numpy@1.25.2
cmake@3.26.3 libxcrypt@4.4.35 py-packaging@23.1
curl@8.1.2 libxml2@2.10.3 py-pip@23.1.2
diffutils@3.9 m4@1.4.19 py-pyprecice@2.2.0.2
eigen@3.4.0 metis@5.1.0 py-setuptools@63.4.3
expat@2.5.0 ncurses@6.4 py-wheel@0.37.1
findutils@4.9.0 nghttp2@1.52.0 python@3.10.12
gdbm@1.23 numactl@2.0.14 readline@8.2
gettext@0.21.1 openblas@0.3.23 sqlite@3.42.0
gmake@4.4.1 openmpi@4.1.5 superlu-dist@8.1.2
hdf5@1.14.2 openssh@9.3p1 tar@1.34
hwloc@2.9.1 openssl@3.1.2 util-linux-uuid@2.38.1
hypre@2.28.0 parmetis@4.0.3 util-macros@1.19.3
krb5@1.20.1 perl@5.38.0 xz@5.4.1
libbsd@0.11.7 petsc@3.19.4 zlib-ng@2.1.3
libedit@3.1-20210216 pigz@2.7 zstd@1.5.5
==> 66 installed packages

```

Structure with of precice installation showing where headers and libprecice.pc are located

```plaintext
(base) daniel@jefi:~/CalculiX/calculix-adapter-2.20.0$ cd /home/daniel/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/include
(base) daniel@jefi:~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/include$ ls
precice
(base) daniel@jefi:~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/include$ cd precice/
(base) daniel@jefi:~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/include/precice$ ls
SolverInterfaceC.h SolverInterfaceFortran.hpp
SolverInterfaceFASTEST.hpp SolverInterface.hpp
(base) daniel@jefi:~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/include/precice$ cd ../../lib/pkgconfig/
(base) daniel@jefi:~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/lib/pkgconfig$ ls
libprecice.pc

```

Error message when building (omitted make clean to shorten the output message)

```plaintext
(base) daniel@jefi:~/CalculiX/calculix-adapter-2.20.0$ source ~/spack/share/spack/setup-env.sh
(base) daniel@jefi:~/CalculiX/calculix-adapter-2.20.0$ pkg-config --cflags libprecice
Package libprecice was not found in the pkg-config search path.
Perhaps you should add the directory containing `libprecice.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libprecice' found
(base) daniel@jefi:~/CalculiX/calculix-adapter-2.20.0$ PKG_CONFIG_PATH=~/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/lib/pkgconfig make
g++ -std=c++11 -I/usr/include/ -c adapter/2D3DCoupling.cpp -o bin/2D3DCoupling.o -lspooles -L/home/daniel/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/precice-2.2.0-bqdlfa7ltxmxovy5ojilsj2spgsbnzbe/lib -lprecice -lstdc++ -lyaml-cpp -larpack -llapack -lblas -lpthread -lm -lc
adapter/2D3DCoupling.cpp:16:10: fatal error: precice/SolverInterfaceC.h: No such file or directory
   16 | #include <precice/SolverInterfaceC.h>
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:92: bin/2D3DCoupling.o] Error 1

```

I know something must have gone wrong, but at this point, I am not sure about what I could try.

Best,  
Daniel

---

<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 3, 2023, 12:55pm UTC](https://precice.discourse.group/t/error-building-adapted-calculix-still-getting-fatal-error-precice-solverinterfacec-h-no-such-file-or-directory/1538/2 "2023-09-03T12:55:55Z")

</div>

Which state of the CalculiX adapter are you trying to build?

We have a new page in the documentation on finding the preCICE installation: [Building from source - Finding | preCICE - The Coupling Library](https://precice.org/installation-source-finding.html)

Try manually setting the `CPATH`, as a workaround.

---

<div class="post-metadata">

**Author:** ![DanielMeza](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/danielmeza/32/1854_2.png) [@DanielMeza](https://precice.discourse.group/u/DanielMeza)\
**Post date:** [September 4, 2023, 12:57pm UTC](https://precice.discourse.group/t/error-building-adapted-calculix-still-getting-fatal-error-precice-solverinterfacec-h-no-such-file-or-directory/1538/3 "2023-09-04T12:57:26Z")

</div>

Hello,

Thank you for the reply. It works now! By following the instructions to set `PRECICE_PREFIX` from the documentation, I do not get any errors anymore.

I am using the adapter of CalculiX for preCICE 2.2.0. Basically, the one from the link in the documentation ([https://github.com/precice/calculix-adapter/archive/refs/heads/master.tar.gz](https://github.com/precice/calculix-adapter/archive/refs/heads/master.tar.gz)).

Best,  
Daniel

---

<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:** [September 7, 2023, 12:58pm UTC](https://precice.discourse.group/t/error-building-adapted-calculix-still-getting-fatal-error-precice-solverinterfacec-h-no-such-file-or-directory/1538/4 "2023-09-07T12:58:04Z")

</div>

Closed on September 7, 2023, 12:58pm UTC

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