Hi, I need help with installation. I get the following error during the “make” stage. I have tried to link the libm library with -DCMAKE_C_FLAGS but can’t make it go past the following stage.
[ 35%] Built target chflow
Scanning dependencies of target simulateflow_app
[ 36%] Building CXX object programs/CMakeFiles/simulateflow_app.dir/simulateflow.cpp.o
[ 36%] Linking CXX executable simulateflow
/usr/bin/ld: CMakeFiles/simulateflow_app.dir/simulateflow.cpp.o: undefined reference to symbol ‘sqrt@@GLIBC_2.2.5’
/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [programs/simulateflow] Error 1
make[1]: *** [programs/CMakeFiles/simulateflow_app.dir/all] Error 2
make: *** [all] Error 2
I am detailing the process below just for ease of discussion.
a) I am using openmpi4.1.2 and Cmake 3.14
b) Installed FFTW3 with --enable-shared --disable-static --enable-mpi --enable-threads --enable-openmp --with-pic
c) Built HDF5 with --enable-shared --enable-cxx --with-zlib (passes make check test)
d) Installed netCDF as follows: (passes make check install test)
CC=/home/ritabrata.thakur/opt/openmpi4.1.2/bin/mpicc CFLAGS="-std=gnu99" CPPFLAGS="-I/home/ritabrata.thakur/opt/phdf5/include" LDFLAGS="-L/home/ritabrata.thakur/opt/phdf5/lib" ./configure --enable-shared --prefix=/home/ritabrata.thakur/opt/PnetCDF
e) And trying to install channel flow with:
/home/ritabrata.thakur/opt/cmake/3.14/bin/cmake /home/ritabrata.thakur/channelflow -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/home/ritabrata.thakur/opt/channelflow -DCMAKE_PREFIX_PATH="/usr/bin;/lib64;/home/ritabrata.thakur/opt/fftw3;/home/ritabrata.thakur/opt/hdf5_cxx;/home/ritabrata.thakur/opt/PnetCDF;/home/ritabrata.thakur/opt/phdf5;/home/ritabrata.thakur/opt/openmpi4.1.2" -DUSE_MPI=ON -DWITH_HDF5CXX=ON -DEIGEN3_INCLUDE_DIR=/home/ritabrata.thakur/eigen -DCMAKE_CXX_COMPILER=/home/ritabrata.thakur/opt/openmpi4.1.2/bin/mpicc -DMPI_CXX_COMPILER=/home/ritabrata.thakur/opt/openmpi4.1.2/bin/mpicc
I have also tried adding -DCMAKE_C_FLAGS="-lm -ldl" to the CMake options but I get the same error.
The following is the configuration summary
###############################################
########### Configuration summary ###########
###############################################
Compiler: GNU 4.8.5
Build type: release
Install prefix: /home/ritabrata.thakur/opt/channelflow
Building shared library: yes
Linking programs to: shared library
Libraries
MPI: enabled
netcdf (default file format): enabled
Parallel netcdf: disabled
HDF5 C++ (legacy file format): enabled
Channelflow components
nsolver: enabled
Python wrapper: disabled
GTest unit testing: enabled
– Configuring done
– Generating done
– Build files have been written to: /home/ritabrata.thakur/channelflow/build