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.