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

Compilation Issues, undefined reference to `Foam::DSMCBaseCloud::typeName'

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 5 Post By anthonygay1812

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2020, 21:21
Default Compilation Issues, undefined reference to `Foam::DSMCBaseCloud::typeName'
  #1
New Member
 
Anthony Gay
Join Date: Oct 2019
Posts: 17
Rep Power: 6
anthonygay1812 is on a distinguished road
Hello Everyone

I've been stuck on a particular compilation error for a few days now and from what I've seen on the internet it can be the result of a few different issues.

In particular I am trying to modify the DSMC initialization code within OF. This has lead to having a modified version of the DSMCCloud.C which defines all of the functions particular to the DSMC solver. Currently the library that contains my modified code compiles just fine my required InInclude directory is generated.

However when I try to compile the initialization Main I get the error at the bottom of this post. To simplify things here is a link to my GitHub just in case there are any questions about my directory structures and various files.

One thing I am currently suspicous of is the fact that I've kept all the same names for classes, files, functions etc while trying to make sure my file and options have the correct inputs to isolate my working directory from the standard openfoam DSMC code and prevent any cross contamination issues.

Feel free to bombard me with questions if you need more precise information, and thank you in advance! Any help is appreciated!

Link to git:https://github.com/Anthony-Gay/HPC_workspace

Error:
Code:
Making dependency list for source file dsmcInitialiseV1.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam7/src/finiteVolume/lnInclude -I/opt/openfoam7/src/lagrangian/basic/lnInclude -I/home/anthonygay1812/OpenFOAM/Working/DSMC_mod/lnInclude -I/opt/openfoam7/src/meshTools/lnInclude  -IlnInclude -I. -I/opt/openfoam7/src/OpenFOAM/lnInclude -I/opt/openfoam7/src/OSspecific/POSIX/lnInclude   -fPIC -c dsmcInitialiseV1.C -o Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam7/src/finiteVolume/lnInclude -I/opt/openfoam7/src/lagrangian/basic/lnInclude -I/home/anthonygay1812/OpenFOAM/Working/DSMC_mod/lnInclude -I/opt/openfoam7/src/meshTools/lnInclude  -IlnInclude -I. -I/opt/openfoam7/src/OpenFOAM/lnInclude -I/opt/openfoam7/src/OSspecific/POSIX/lnInclude   -fPIC -fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o -L/opt/openfoam7/platforms/linux64GccDPInt32Opt/lib \
    -lmeshTools -lfiniteVolume -llagrangian -L/home/anthonygay1812/OpenFOAM/root-7/platforms/linux64GccDPInt32Opt/lib  -lOpenFOAM -ldl  \
     -lm -o /home/anthonygay1812/OpenFOAM/root-7/platforms/linux64GccDPInt32Opt/bin/dsmcInitialiseV1
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::DSMCBaseCloud::type() const':
dsmcInitialiseV1.C:(.text._ZNK4Foam13DSMCBaseCloud4typeEv[_ZNK4Foam13DSMCBaseCloud4typeEv]+0x3): undefined reference to `Foam::DSMCBaseCloud::typeName'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::IOPosition<Foam::Cloud<Foam::DSMCParcel<Foam::particle> > >::type() const':
dsmcInitialiseV1.C:(.text._ZNK4Foam10IOPositionINS_5CloudINS_10DSMCParcelINS_8particleEEEEEE4typeEv[_ZNK4Foam10IOPositionINS_5CloudINS_10DSMCParcelINS_8particleEEEEEE4typeEv]+0x3): undefined reference to `Foam::Cloud<Foam::DSMCParcel<Foam::particle> >::typeName'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::Cloud<Foam::DSMCParcel<Foam::particle> >::type() const':
dsmcInitialiseV1.C:(.text._ZNK4Foam5CloudINS_10DSMCParcelINS_8particleEEEE4typeEv[_ZNK4Foam5CloudINS_10DSMCParcelINS_8particleEEEE4typeEv]+0x3): undefined reference to `Foam::Cloud<Foam::DSMCParcel<Foam::particle> >::typeName'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::DSMCParcel<Foam::particle>::type() const':
dsmcInitialiseV1.C:(.text._ZNK4Foam10DSMCParcelINS_8particleEE4typeEv[_ZNK4Foam10DSMCParcelINS_8particleEE4typeEv]+0x3): undefined reference to `Foam::DSMCParcel<Foam::particle>::typeName'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::DSMCCloud<Foam::DSMCParcel<Foam::particle> >::~DSMCCloud()':
dsmcInitialiseV1.C:(.text._ZN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEED2Ev[_ZN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEED5Ev]+0x1bf): undefined reference to `Foam::DSMCBaseCloud::~DSMCBaseCloud()'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::Cloud<Foam::DSMCParcel<Foam::particle> >::initCloud(bool)':
dsmcInitialiseV1.C:(.text._ZN4Foam5CloudINS_10DSMCParcelINS_8particleEEEE9initCloudEb[_ZN4Foam5CloudINS_10DSMCParcelINS_8particleEEEE9initCloudEb]+0x68): undefined reference to `Foam::Cloud<Foam::DSMCParcel<Foam::particle> >::typeName'
dsmcInitialiseV1.C:(.text._ZN4Foam5CloudINS_10DSMCParcelINS_8particleEEEE9initCloudEb[_ZN4Foam5CloudINS_10DSMCParcelINS_8particleEEEE9initCloudEb]+0xab): undefined reference to `Foam::Cloud<Foam::DSMCParcel<Foam::particle> >::debug'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o: In function `Foam::DSMCCloud<Foam::DSMCParcel<Foam::particle> >::DSMCCloud(Foam::word const&, Foam::fvMesh const&, Foam::IOdictionary const&)':
dsmcInitialiseV1.C:(.text._ZN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEEC2ERKNS_4wordERKNS_6fvMeshERKNS_12IOdictionaryE[_ZN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEEC5ERKNS_4wordERKNS_6fvMeshERKNS_12IOdictionaryE]+0xbe): undefined reference to `Foam::DSMCBaseCloud::DSMCBaseCloud()'
dsmcInitialiseV1.C:(.text._ZN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEEC2ERKNS_4wordERKNS_6fvMeshERKNS_12IOdictionaryE[_ZN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEEC5ERKNS_4wordERKNS_6fvMeshERKNS_12IOdictionaryE]+0x1b0a): undefined reference to `Foam::DSMCBaseCloud::~DSMCBaseCloud()'
Make/linux64GccDPInt32Opt/dsmcInitialiseV1.o:(.data.rel.ro._ZTIN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEEE[_ZTIN4Foam9DSMCCloudINS_10DSMCParcelINS_8particleEEEEE]+0x28): undefined reference to `typeinfo for Foam::DSMCBaseCloud'
collect2: error: ld returned 1 exit status
/opt/openfoam7/wmake/makefiles/general:140: recipe for target '/home/anthonygay1812/OpenFOAM/root-7/platforms/linux64GccDPInt32Opt/bin/dsmcInitialiseV1' failed
make: *** [/home/anthonygay1812/OpenFOAM/root-7/platforms/linux64GccDPInt32Opt/bin/dsmcInitialiseV1] Error 1
anthonygay1812 is offline   Reply With Quote

Old   February 13, 2020, 19:46
Default Resolved
  #2
New Member
 
Anthony Gay
Join Date: Oct 2019
Posts: 17
Rep Power: 6
anthonygay1812 is on a distinguished road
I resolved my issue. One of the things I didnt pick up on when reading the openfoam documentation is that wmake will automatically look in the src directory for all the libraries you want to connect to your program, however if you want to use a custom library stored in the FOAM_USER_LIBBIN you need to first point wmake to that directory and then call out the individual .so files which I was not doing.

In the options file for my initialization executable

Code:
EXE_LIBS = \
    -lmeshTools \
    -lfiniteVolume \
    -llagrangian \
    -L$(FOAM_USER_LIBBIN) \
    -lDSMC_mod
anthonygay1812 is offline   Reply With Quote

Reply

Tags
compilation error, dsmcinitialize

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
OpenFOAM 1.6 ext - Compilation errors - Fedora 17(32bit) toolpost OpenFOAM Installation 15 September 21, 2012 09:38
Compiling new Solver with wmake lin123 OpenFOAM 3 April 13, 2010 14:18
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
Statically Compiling OpenFOAM Issues herzfeldd OpenFOAM Installation 21 January 6, 2009 09:38


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