CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

one question about compiling error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2019, 04:55
Default one question about compiling error
  #1
New Member
 
Ningyi Li
Join Date: Jun 2018
Location: Germany
Posts: 6
Rep Power: 8
lny200912 is on a distinguished road
Hi, eveyone

I want to use the original solver in openfoam.
So I copy the reactingFoam from the installed directory in my cluster /opt/bwhpc/common/cae/openfoam/v1706/OpenFOAM-v1706/applications/solvers/combustion/reactingFoam to my local folder.


Then I change the reactingFoam.C to my_reactingFoam.C in my folder.

I only change the content in the Make/files:

my_reactingFoam.C
EXE = $(FOAM_USER_APPBIN)/my_reactingFoam


Finally, i run the wclean and wmake commands,

but I got the same error after compiled:
errors:

cae/openfoam/v1706/OpenFOAM-v1706/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/my_reactingFoam.o -L/opt/bwhpc/common/cae/openfoam/v1706/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib \
-lfiniteVolume -lfvOptions -lmeshTools -lsampling -lturbulenceModels -lcompressibleTurbulenceModels -lreactionThermophysicalModels -lspecie -lcompressibleTransportModels -lfluidThermophysicalModels -lchemistryModel -lODE -lcombustionModels -lOpenFOAM -ldl \
-lm -o /home/kit/itt/qy5011/OpenFOAM/qy5011-v1706/platforms/linux64GccDPInt32Opt/bin/my_reactingFoam
Make/linux64GccDPInt32Opt/my_reactingFoam.o: In function `Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::storeOldTimes() const':
my_reactingFoam.C.text._ZNK4Foam14GeometricField IdNS_12fvPatchFieldENS_7volMeshEE13storeOldTimesEv[_ZNK4Foam14GeometricFieldIdNS_12fvPatchFieldENS_7v olMeshEE13storeOldTimesEv]+0x5e): undefined reference to `Foam::string::endsWith(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Make/linux64GccDPInt32Opt/my_reactingFoam.o: In function `Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::storeOldTimes() const':
my_reactingFoam.C.text._ZNK4Foam14GeometricField IdNS_13fvsPatchFieldENS_11surfaceMeshEE13storeOldT imesEv[_ZNK4Foam14GeometricFieldIdNS_13fvsPatchFieldENS_1 1surfaceMeshEE13storeOldTimesEv]+0x5e): undefined reference to `Foam::string::endsWith(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Make/linux64GccDPInt32Opt/my_reactingFoam.o: In function `Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::storeOldTimes() const':
my_reactingFoam.C.text._ZNK4Foam14GeometricField INS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEE13st oreOldTimesEv[_ZNK4Foam14GeometricFieldINS_6VectorIdEENS_12fvPat chFieldENS_7volMeshEE13storeOldTimesEv]+0x5e): undefined reference to `Foam::string::endsWith(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Make/linux64GccDPInt32Opt/my_reactingFoam.o: In function `Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>::storeOldTimes() const':
my_reactingFoam.C.text._ZNK4Foam14GeometricField INS_6VectorIdEENS_13fvsPatchFieldENS_11surfaceMesh EE13storeOldTimesEv[_ZNK4Foam14GeometricFieldINS_6VectorIdEENS_13fvsPa tchFieldENS_11surfaceMeshEE13storeOldTimesEv]+0x5e): undefined reference to `Foam::string::endsWith(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
Make/linux64GccDPInt32Opt/my_reactingFoam.o.data.rel.ro._ZTVN4Foam8OPstrea mE[_ZTVN4Foam8OPstreamE]+0x80): undefined reference to `Foam::UOPstream::writeQuoted(std::__cxx11::basic_ string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
collect2: error: ld returned 1 exit status
I found the Foam::string::endsWith defined in the
in the openfoam v1812
src/OpenFOAM/primitives/strings/string/string.C
So I include -lOpenFOAM in my Make/options, but it still does not work.
gcc -v
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/pfs/data1/software_uc1/bwhpc/common/compiler/gnu/7.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/opt/bwhpc/common/compiler/gnu/7.1.0 --enable-languages=c,c++,lto,fortran,go --disable-multilib --with-tune=generic --with-system-zlib --enable-shared --with-ppl --enable-gnu-unique-object --enable-linker-build-id --with-gmp-lib=/home/hs/hs_hs/hs_doros/bwhpc-rpmbuild/BUILD/gcc-7.1.0/opt/bwhpc/common/compiler/gnu/7.1.0/lib64 --with-gmp-include=/home/hs/hs_hs/hs_doros/bwhpc-rpmbuild/BUILD/gcc-7.1.0/opt/bwhpc/common/compiler/gnu/7.1.0/include --with-mpfr=/home/hs/hs_hs/hs_doros/bwhpc-rpmbuild/BUILD/gcc-7.1.0/opt/bwhpc/common/compiler/gnu/7.1.0 --with-mpc-lib=/home/hs/hs_hs/hs_doros/bwhpc-rpmbuild/BUILD/gcc-7.1.0/opt/bwhpc/common/compiler/gnu/7.1.0/lib64 --with-isl=/home/hs/hs_hs/hs_doros/bwhpc-rpmbuild/BUILD/gcc-7.1.0/opt/bwhpc/common/compiler/gnu/7.1.0
Thread model: posix
gcc version 7.1.0 (GCC)

Could someone can help me to solve this problem? Thank you in advance.

Best regards,
Ningyi
lny200912 is offline   Reply With Quote

Old   March 28, 2019, 06:52
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

you have a crazy text formatting. I am wondering what you are doing because you are mixing two different OpenFOAM versions (1706 and 1812). Furthermore, did you compile your foam source code or was it an installation from a package (the path /opt/... seems that it was an installation).
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 28, 2019, 08:28
Default
  #3
New Member
 
Ningyi Li
Join Date: Jun 2018
Location: Germany
Posts: 6
Rep Power: 8
lny200912 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

you have a crazy text formatting. I am wondering what you are doing because you are mixing two different OpenFOAM versions (1706 and 1812). Furthermore, did you compile your foam source code or was it an installation from a package (the path /opt/... seems that it was an installation).

Hi, Tobi


Thank you for your reply. And this problem was solved now. You are right. I atually mixed two different OpenFOAM version, which caused this problem, beacuase after I installed the v1812, the problem was solved automatically.

Moreover, I installed the mpi/openmpi/3.1-gnu-4.8 for v1706, I guess this mpi version may be not suitable for OpenFOAM v1706, suitable for v1812.


Thank you again.
Best,
Ningyi
lny200912 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 07:43
long error when using make-install SU2_AD. tomp1993 SU2 Installation 3 March 17, 2018 06:25
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 11:39
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 05:07


All times are GMT -4. The time now is 02:05.