Failed compiling Dualsphysics
HI, I am trying to compile Dualsphysics. However, I got some link error, as shown below
/usr/local/bin/ld: ../lib/linux_gcc/libjvtklib_64.a(JVtkPolyData.o): in function `JVtk::JVtkPolyData::LoadFileVtk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
JVtkPolyData.cpp:(.text+0x2716): undefined reference to `std::__istream_extract(std::istream&, char*, long)'
/usr/local/bin/ld: JVtkPolyData.cpp:(.text+0x2932): undefined reference to `std::__istream_extract(std::istream&, char*, long)'
/usr/local/bin/ld: JVtkPolyData.cpp:(.text+0x2b7f): undefined reference to `std::__istream_extract(std::istream&, char*, long)'
/usr/local/bin/ld: JVtkPolyData.cpp:(.text+0x2ba0): undefined reference to `std::__istream_extract(std::istream&, char*, long)'
/usr/local/bin/ld: JVtkPolyData.cpp:(.text+0x2c04): undefined reference to `std::__istream_extract(std::istream&, char*, long)'
/usr/local/bin/ld: ../lib/linux_gcc/libjvtklib_64.a(JVtkArray.o):JVtkArray.cpp:(.text+0x6bed): more undefined references to `std::__istream_extract(std::istream&, char*, long)' follow
collect2: error: ld returned 1 exit status
It is weird that i can not find the file named JVtkPolyData.cpp
Besides, also failed when i compile the DSPH_V4.0_LiquidGas,
/usr/local/bin/ld: JSph.o: in function `JSph::~JSph()':
JSph.cpp:(.text+0x1e60): undefined reference to `JWaveGen::~JWaveGen()'
/usr/local/bin/ld: JSph.o: in function `JSph::SavePartData(unsigned int, unsigned int, unsigned int const*, tdouble3 const*, tfloat3 const*, float const*, unsigned int, tdouble3 const*, JSph::StInfoPartPlus const*)':
JSph.cpp:(.text+0x9b52): undefined reference to `JFormatFiles2::SaveCsv(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, tfloat3 const*, unsigned int, JFormatFiles2::StScalarData const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/local/bin/ld: JSph.cpp:(.text+0x9c69): undefined reference to `JFormatFiles2::SaveVtk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, tfloat3 const*, unsigned int, JFormatFiles2::StScalarData const*)'
/usr/local/bin/ld: JSph.o: in function `JSph::SavePartDataMP(unsigned int, unsigned int, unsigned int const*, tdouble3 const*, tfloat3 const*, float const*, unsigned short const*, unsigned int, tdouble3 const*, JSph::StInfoPartPlus const*)':
JSph.cpp:(.text+0xb10f): undefined reference to `JFormatFiles2::SaveCsv(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, tfloat3 const*, unsigned int, JFormatFiles2::StScalarData const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/local/bin/ld: JSph.cpp:(.text+0xb21e): undefined reference to `JFormatFiles2::SaveVtk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, tfloat3 const*, unsigned int, JFormatFiles2::StScalarData const*)'
/usr/local/bin/ld: JSph.o: in function `JSph::SaveDomainVtk(unsigned int, tdouble3 const*) const':
JSph.cpp:(.text+0xb605): undefined reference to `JFormatFiles2::SaveVtkBoxes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, tfloat3 const*, float)'
/usr/local/bin/ld: JSph.o: in function `JSph::SaveMapCellsVtk(float) const':
JSph.cpp:(.text+0xbdcd): undefined reference to `JFormatFiles2::SaveVtkCells(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tfloat3 const&, tuint3 const&, float)'
/usr/local/bin/ld: JSph.o: in function `JSph::LoadCaseConfig()':
JSph.cpp:(.text+0x15d14): undefined reference to `JWaveGen::JWaveGen(JLog2*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, JXml*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/bin/ld: JSph.cpp:(.text+0x15eb7): undefined reference to `JWaveGen::ConfigPaddle(unsigned short, unsigned short, unsigned int, unsigned int)'
/usr/local/bin/ld: JSphCpu.o: in function `JSphCpu::RunMotion(double)':
JSphCpu.cpp:(.text+0x9522e): undefined reference to `JWaveGen::GetMotion(unsigned int, double, double, tdouble3&, tmatrix4d&, unsigned int&, unsigned int&)'
/usr/local/bin/ld: JSphCpu.o: in function `JSphCpu::InitRun()':
JSphCpu.cpp:(.text+0x969d2): undefined reference to `JWaveGen::Init(double, tfloat3, bool, TpCellOrder, float, double, float, float, int, tdouble3, tdouble3, tdouble3)'
/usr/local/bin/ld: JSphCpu.cpp:(.text+0x96a30): undefined reference to `JWaveGen::VisuConfig(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/local/bin/ld: JSphGpu.o: in function `JSphGpu::InitRun()':
JSphGpu.cpp:(.text+0x5c70): undefined reference to `JWaveGen::Init(double, tfloat3, bool, TpCellOrder, float, double, float, float, int, tdouble3, tdouble3, tdouble3)'
/usr/local/bin/ld: JSphGpu.cpp:(.text+0x5cce): undefined reference to `JWaveGen::VisuConfig(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/local/bin/ld: JSphGpu.o: in function `JSphGpu::RunMotion(double)':
JSphGpu.cpp:(.text+0x885f): undefined reference to `JWaveGen::GetMotion(unsigned int, double, double, tdouble3&, tmatrix4d&, unsigned int&, unsigned int&)'
collect2: error: ld returned 1 exit status
How can i solve the problems, my environment is gcc-8.4.0, cuda-10.2
Comments
@imartinezestevez @jmdalonso
@joost
The gcc version you are using is different than the version used to compile the precompiled libraries. Try to include the following option in the Makefile: CCFLAGS+=-D_GLIBCXX_USE_CXX11_ABI=0
@imartinezestevez
I'm facing the same issue. The suggested solution did not work. Which gcc version was used for the precompiled libraries?
@imartinezestevez
Nevermind. I got it to compile with GCC 11