[OpenFOAM-6 adapter] Error during build: undefined symbols of dependencies (repeat issue #1091)

Hello forum,

I am retrying to install the adapter for OpenFOAM-6 but receiving undefined symbol message.

This issue was solved in an earlier issue [OpenFOAM-6 adapter] Error during build: undefined symbols of dependencies but after attempting to run partitioned simuations, as discussed in [OpenFOAM] Unable to run SLURM partitioned simulation, I am facing issues with the adapter installation again.

I will first give a short context about how I am planning to use preCICE and then give specific details about the adapter installation.

Context : I want to perform a dynamic two-way coupling of velocity and presure at the boundaries of a domain where the internal domain is simulated by an OpenFOAM solver and the external doman is calculated by a python or C++ script.

So my first question is: Do I need the OpenFOAM adapter to setup a problem like this or or is it a job better suited for preCICE API ?


Issue with installation of OpenFOAM-6 adapter: I am getting a list of undefined symbols at the end of ldd.log:

|undefined symbol: _ZN7precice15SolverInterface24setMeshTriangleWithEdgesEiiii|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|---|---|
|undefined symbol: _ZN7precice15SolverInterfaceC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ii|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface19isReadDataAvailableEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface20writeBlockScalarDataEiiPKiPKd|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice9constants22actionWriteInitialDataB5cxx11Ev|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice9constants30actionWriteIterationCheckpointB5cxx11Ev|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface19readBlockScalarDataEiiPKiPd|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface19markActionFulfilledERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface9getMeshIDERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface17isCouplingOngoingEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface14initializeDataEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface19readBlockVectorDataEiiPKiPd|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface15setMeshVerticesEiiPKdPi|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterfaceD1Ev|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface16isActionRequiredERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface20writeBlockVectorDataEiiPKiPKd|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice9constants29actionReadIterationCheckpointB5cxx11Ev|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface10initializeEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface13getDimensionsEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface29getMeshVertexIDsFromPositionsEiiPKdPi|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface7advanceEd|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface20isTimeWindowCompleteEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZN7precice15SolverInterface8finalizeEv|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|
|undefined symbol: _ZNK7precice15SolverInterface9getDataIDERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi|(/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)|

Here are the log files:
Allwmake.log (996 Bytes)
wmake.log (74.9 KB)
ldd.log (12.7 KB)

Here is the system info:
System info:

  • OS: CentOS Linux release 7.9.2009 (Core)
  • Adapter version: 1.1.0
  • OpenFOAM version: OpenFOAM-6
  • preCICE version: 2.4.0*
  • GCC version: 7.3.0
  • CMake version: 3.23.2

*Note that I am still using v2.4.0 of preCICE even though v2.5.0 is available. This is to replicate the configuration discussed in [OpenFOAM-6 adapter] Error during build: undefined symbols of dependencies. Howeve, I have also performed the installation with v2.5.0 as a test but I see the same errors in the log files.

Additonal info:

Path to libprecice.so:

$ pkg-config --silence-errors --libs libprecice
-L/gpfs/home/nkumar001/tools/spack/opt/spack/linux-centos7-skylake_avx512/gcc-7.3.0/precice-2.4.0-xblhbw5vpegbvd5ikcz3tooh6ucoxujr/lib64 -lprecice

Symbol table:

$ nm -D /gpfs/home/nkumar001/tools/spack/opt/spack/linux-centos7-skylake_avx512/gcc-7.3.0/precice-2.4.0-xblhbw5vpegbvd5ikcz3tooh6ucoxujr/lib64/libprecice.so | grep precice15SolverInterface
00000000002e5440 T _ZN7precice15SolverInterface10initializeEv
00000000002e55e0 T _ZN7precice15SolverInterface11setMeshEdgeEiii
00000000002e5610 T _ZN7precice15SolverInterface11setMeshQuadEiiiii
00000000002e5630 T _ZN7precice15SolverInterface13mapReadDataToEi
00000000002e5590 T _ZN7precice15SolverInterface13setMeshVertexEiPKd
00000000002e5450 T _ZN7precice15SolverInterface14initializeDataEv
00000000002e55f0 T _ZN7precice15SolverInterface15setMeshTriangleEiiii
00000000002e55b0 T _ZN7precice15SolverInterface15setMeshVerticesEiiPKdPi
00000000002e56b0 T _ZN7precice15SolverInterface15writeScalarDataEiid
00000000002e5670 T _ZN7precice15SolverInterface15writeVectorDataEiiPKd
00000000002e5640 T _ZN7precice15SolverInterface16mapWriteDataFromEi
00000000002e54e0 T _ZN7precice15SolverInterface19markActionFulfilledERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
00000000002e5620 T _ZN7precice15SolverInterface20setMeshQuadWithEdgesEiiiii
00000000002e5690 T _ZN7precice15SolverInterface20writeBlockScalarDataEiiPKiPKd
00000000002e5650 T _ZN7precice15SolverInterface20writeBlockVectorDataEiiPKiPKd
00000000002e56c0 T _ZN7precice15SolverInterface23writeScalarGradientDataEiiPKd
00000000002e5680 T _ZN7precice15SolverInterface23writeVectorGradientDataEiiPKdb
00000000002e5600 T _ZN7precice15SolverInterface24setMeshTriangleWithEdgesEiiii
00000000002e56a0 T _ZN7precice15SolverInterface28writeBlockScalarGradientDataEiiPKiPKd
00000000002e5660 T _ZN7precice15SolverInterface28writeBlockVectorGradientDataEiiPKiPKdb
00000000002e5460 T _ZN7precice15SolverInterface7advanceEd
00000000002e5470 T _ZN7precice15SolverInterface8finalizeEv
00000000002e5280 T _ZN7precice15SolverInterfaceC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ii
00000000002e5340 T _ZN7precice15SolverInterfaceC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_iiPv
00000000002e5280 T _ZN7precice15SolverInterfaceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ii
00000000002e5340 T _ZN7precice15SolverInterfaceC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_iiPv
00000000002e5410 T _ZN7precice15SolverInterfaceD1Ev
00000000002e5410 T _ZN7precice15SolverInterfaceD2Ev
00000000002e5510 T _ZNK7precice15SolverInterface10getMeshIDsEv
00000000002e5480 T _ZNK7precice15SolverInterface13getDimensionsEv
00000000002e5740 T _ZNK7precice15SolverInterface14readScalarDataEiidRd
00000000002e5730 T _ZNK7precice15SolverInterface14readScalarDataEiiRd
00000000002e5700 T _ZNK7precice15SolverInterface14readVectorDataEiidPd
00000000002e56f0 T _ZNK7precice15SolverInterface14readVectorDataEiiPd
00000000002e55c0 T _ZNK7precice15SolverInterface15getMeshVerticesEiiPKiPd
00000000002e54d0 T _ZNK7precice15SolverInterface16isActionRequiredERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
00000000002e55a0 T _ZNK7precice15SolverInterface17getMeshVertexSizeEi
00000000002e5490 T _ZNK7precice15SolverInterface17isCouplingOngoingEv
00000000002e54a0 T _ZNK7precice15SolverInterface19isReadDataAvailableEv
00000000002e54b0 T _ZNK7precice15SolverInterface19isWriteDataRequiredEd
00000000002e5720 T _ZNK7precice15SolverInterface19readBlockScalarDataEiiPKidPd
00000000002e5710 T _ZNK7precice15SolverInterface19readBlockScalarDataEiiPKiPd
00000000002e56e0 T _ZNK7precice15SolverInterface19readBlockVectorDataEiiPKidPd
00000000002e56d0 T _ZNK7precice15SolverInterface19readBlockVectorDataEiiPKiPd
00000000002e5750 T _ZNK7precice15SolverInterface19setMeshAccessRegionEiPKd
00000000002e54c0 T _ZNK7precice15SolverInterface20isTimeWindowCompleteEv
00000000002e5760 T _ZNK7precice15SolverInterface21getMeshVerticesAndIDsEiiPiPd
00000000002e5580 T _ZNK7precice15SolverInterface22hasToEvaluateFineModelEv
00000000002e5540 T _ZNK7precice15SolverInterface22isGradientDataRequiredEi
00000000002e5530 T _ZNK7precice15SolverInterface26isMeshConnectivityRequiredEi
00000000002e5570 T _ZNK7precice15SolverInterface27hasToEvaluateSurrogateModelEv
00000000002e55d0 T _ZNK7precice15SolverInterface29getMeshVertexIDsFromPositionsEiiPKdPi
00000000002e5550 T _ZNK7precice15SolverInterface7hasDataERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi
00000000002e54f0 T _ZNK7precice15SolverInterface7hasMeshERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
00000000002e5560 T _ZNK7precice15SolverInterface9getDataIDERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi
00000000002e5500 T _ZNK7precice15SolverInterface9getMeshIDERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
0000000000373250 W _ZNSt10unique_ptrIN7precice15SolverInterfaceESt14default_deleteIS1_EED1Ev
0000000000373250 W _ZNSt10unique_ptrIN7precice15SolverInterfaceESt14default_deleteIS1_EED2Ev

Compiler info for preCICE:

$ objdump -s --section .comment /gpfs/home/nkumar001/tools/spack/opt/spack/linux-centos7-skylake_avx512/gcc-7.3.0/precice-2.4.0-xblhbw5vpegbvd5ikcz3tooh6ucoxujr/lib64/libprecice.so

/gpfs/home/nkumar001/tools/spack/opt/spack/linux-centos7-skylake_avx512/gcc-7.3.0/precice-2.4.0-xblhbw5vpegbvd5ikcz3tooh6ucoxujr/lib64/libprecice.so:     file format elf64-x86-64

Contents of section .comment:
 0000 4743433a 2028474e 55292037 2e332e30  GCC: (GNU) 7.3.0
 0010 00                                   .

Compiler info for OpenFOAM:

$ objdump -s --section .comment $FOAM_LIBBIN/libfiniteVolume.so

/gpfs/home/nkumar001/tools/spack/opt/spack/linux-centos7-skylake_avx512/gcc-7.3.0/openfoam-org-6-igz65evgkidr4ld55pf27hmiht6ajkcs/platforms/linux64GccDPInt32-spack/lib/libfiniteVolume.so:     file format elf64-x86-64

Contents of section .comment:
 0000 4743433a 2028474e 55292037 2e332e30  GCC: (GNU) 7.3.0
 0010 00                                   .

As it can be seen, even though both preCICE and OpenFOAM are built using the same compiler (which was the solution to the issue [OpenFOAM-6 adapter] Error during build: undefined symbols of dependencies), the installation of the adapter is failing.


For reference, here is the full list of commands that I’ve followed to create the spack environment and install the relevant tools:

#- Get spack:
cd tools/
git clone -b develop https://github.com/spack/spack.git
cd spack/
source /gpfs/home/nkumar001/tools/spack/share/spack/setup-env.sh

#- Setup environment:
spack env create foamPrecice
spack env activate foamPrecice

module load gcc/7.3.0
spack compiler find

mkdir -p ~/.spack
spack config --scope user edit packages
#- Insert following lines:
#  packages:
#    slurm:
#      externals:
#      - spec: "slurm@18-08-5-2 arch=linux-centos7-skylake_avx512" 
#        prefix: /usr
#      buildable: False

spack install openmpi@4.1.4 %gcc@7.3.0 +legacylaunchers schedulers=slurm >> log.openmpi 2>&1

#- NOTE: For some reason, the path to OpenMPI libraries is not automatically detected and the subsequent OpenFOAM instllation fails. Insert the path manually:
vi /gpfs/home/nkumar001/tools/spack/share/spack/setup-env.sh
#- Insert following line:
#  export LD_LIBRARY_PATH=/gpfs/home/nkumar001/tools/spack/opt/spack/linux-centos7-skylake_avx512/gcc-7.3.0/openmpi-4.1.4-wbw754t4dfjpxteqdyztvirtv66lqqpa/lib:$LD_LIBRARY_PATH
source /gpfs/home/nkumar001/tools/spack/share/spack/setup-env.sh

#- Install OpenFOAM and preCICE:
spack install -j 32 openfoam-org@6 %gcc@7.3.0 ^cmake@3.23.2 >> log.openfoam 2>&1
spack install -j 32 precice@2.4.0 %gcc@7.3.0 ^boost@1.74.0 >> log.precice 2>&1

#- Install adapter:
git clone --single-branch --branch OpenFOAM6 https://github.com/precice/openfoam-adapter.git
cd openfoam-adapter/
./Allwmake >> log.Allwmake 2>&1

Please let me know if more information is needed. Thanks.

If you are following exactly the same steps, one thing that may have changed in the meantime is that we rebased the OpenFOAM6 branch to the latest release (I now see why this may not be a good idea). Assuming that the last time you built the v1.0.0 of the adapter (released in May 3, 2021), what happens if you download and build this file, instead? https://github.com/precice/openfoam-adapter/releases/download/v1.0.0/openfoam-adapter_v1.0.0_OpenFOAM6_experimental.tar.gz

(from the adapter releases: Releases · precice/openfoam-adapter · GitHub)

That would be the easy thing to cross out first. After that, we need to look deeper.

If you already built v1.1.0 (released in February 8, 2022), then there are no changes in the OpenFOAM6 branch.

Thanks for your reply.

I verified from [OpenFOAM-6 adapter] Error during build: undefined symbols of dependencies that the adapter version I used previously was indeed v1.1.0.

I also tried to use v1.0.0 but get similar error. I am unable to upload the log file for some reason but I see the exactly the same list of undefined symbols at the end of ldd.log:

undefined symbol: _ZN7precice15SolverInterface24setMeshTriangleWithEdgesEiiii   (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterfaceC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ii    (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface19isReadDataAvailableEv  (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface20writeBlockScalarDataEiiPKiPKd   (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice9constants22actionWriteInitialDataB5cxx11Ev        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice9constants30actionWriteIterationCheckpointB5cxx11Ev        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface19readBlockScalarDataEiiPKiPd    (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface19markActionFulfilledERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE      (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface9getMeshIDERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface17isCouplingOngoingEv    (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface14initializeDataEv        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface19readBlockVectorDataEiiPKiPd    (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface15setMeshVerticesEiiPKdPi (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterfaceD1Ev      (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface16isActionRequiredERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface20writeBlockVectorDataEiiPKiPKd   (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice9constants29actionReadIterationCheckpointB5cxx11Ev (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface10initializeEv    (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface13getDimensionsEv        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface29getMeshVertexIDsFromPositionsEiiPKdPi  (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface7advanceEd        (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface20isTimeWindowCompleteEv (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN7precice15SolverInterface8finalizeEv       (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZNK7precice15SolverInterface9getDataIDERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi       (/gpfs/home/nkumar001/OpenFOAM/nkumar001-6/platforms/linux64GccDPInt32-spack/lib/libpreciceAdapterFunctionObject.so)

Hello! Is there any update with regard to this issue? I retried from scratch but still getting the same set of undefined symbols.

I understand that you also opened this issue on Spack: Installation issue: precice · Issue #33790 · spack/spack · GitHub, posting here for completeness.

As @fsimonis writes there, spack load precice should work.

It currently looks like the system is not finding preCICE at runtime. Are you maybe overwriting your LD_LIBRARY_PATH somewhere?

I am also getting out of ideas, but this really looks like a system/environment-specific issue… :face_with_diagonal_mouth:

As far as I can confirm, LD_LIBRARY_PATH is not getting updated between the preCICE and the OpenFOAM adapter installation steps. I am also able to run dummy simulations which confirm that the system can discover preCICE.

PS: Just to be clear, the GitHub issue has to do with a different error that I was facing during the installation of preCICE itself and not the OpenFOAM adapter. I opened the issue there as I thought that it would be more relevant.

The OpenFOAM adapter uses pkg-config to detect preCICE. So there may be a problem with that.
It could be that pkg-config finds another installation or so.

Can you check the results of

pkg-config --modversion libprecice
pkg-config --cflags libprecice
pkg-config --libs libprecice

If paths are missing, try to export these:

export PKG_CONFIG_SYSTEM_INCLUDE_PATH=Yes
export PKG_CONFIG_SYSTEM_LIBRARY_PATH=Yes

If this isn’t the problem, then please check that preCICE is build as a shared library.

You can also instruct spack to run the tests of preCICE after the build: (you may need to uninstall precice first)

spack install --test=root precice

Home that help!

I finally managed to install the adapter! All I needed to do was this:

unset LD_LIBRARY_PATH

before activating the spack environment and installing the adapter (or before the spack installation itself if you’re starting from scratch).

Apparently I had paths pointing to older OpenFOAM-2.4.0 libraries in LD_LIBRARY_PATH that were conflicting with those of OpenFOAM-6 in the spack environment. I am working with tmux to perform the installations in the background and somehow the LD_LIBRARY_PATH was not getting initialized automatically upon launching a new session.

I am also able to run the partitioned-pipe tutorial to test the adapter.

Thanks @Makis and @fsimonis for your help!

2 Likes

Amazing! :partying_face:

Generally, setting such environment variables can be a source of many such spurious issues, and I would suggest avoiding it as much as possible. OpenFOAM also uses those a lot, but there are better solutions nowadays (e.g., pkg-config).

In such a situation, I would normally try to cleanup any duplicate versions and try to understand what paths the system considers via the different package managers (Conda is also frequently correlated with such installation issues, as people forget they have it active).

1 Like

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