CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   wmake problems during custom utility compilation (https://www.cfd-online.com/Forums/openfoam-programming-development/121318-wmake-problems-during-custom-utility-compilation.html)

palazi88 July 25, 2013 16:59

wmake problems during custom utility compilation
 
Hello everyone
I'm new OF user, just yesterday I succesfully installed 12.3Suse and 2.2.1 OpenFoam on my computer. I followed by this instructions:
http://www.openfoam.org/download/suse.php
And everything looked great, tutorial cases worked, but... when I tried to create my own utility called "wallHeatFluxIncompressibleNu", I got some strange errors. Because I was afraid, that the problem is caused because of code errors, I just copied good, working utility "wallHeatFlux" from OF2.2.1 and then I renamed it to "wallHeatFluxTest" and tried compiled... but I again got the same errors... so I suppose that I don't have some library or sth similar. Maybe someone can help me?
Below you can find list of errors:

Quote:

g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM-2.2.1/src/turbulenceModels -I/opt/OpenFOAM-2.2.1/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/OpenFOAM-2.2.1/src/thermophysicalModels/specie/lnInclude -I/opt/OpenFOAM-2.2.1/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/OpenFOAM-2.2.1/src/thermophysicalModels/basic/lnInclude -I/opt/OpenFOAM-2.2.1/src/thermophysicalModels/solidThermo/lnInclude -I/opt/OpenFOAM-2.2.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM-2.2.1/src/OpenFOAM/lnInclude -I/opt/OpenFOAM-2.2.1/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/wallHeatFluxTest.o -L/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib \
-lcompressibleTurbulenceModel -lcompressibleRASModels -lcompressibleLESModels -lLESdeltas -lreactionThermophysicalModels -lfiniteVolume -lgenericPatchFields -lspecie -lfluidThermophysicalModels -lsolidThermo -lOpenFOAM -ldl -lm -o /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/bin/wallHeatFluxTest
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libmeshTools.so, needed by /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so, not found (try using -rpath or -rpath-link)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libsolidSpecie.so, needed by /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so, not found (try using -rpath or -rpath-link)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libradiationModels.so, needed by /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so, not found (try using -rpath or -rpath-link)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libLESfilters.so, needed by /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so, not found (try using -rpath or -rpath-link)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libtriSurface.so, needed by /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so, not found (try using -rpath or -rpath-link)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libPstream.so, needed by /opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so, not found (try using -rpath or -rpath-link)
Make/linux64GccDPOpt/wallHeatFluxTest.o: In function `main':
wallHeatFluxTest.C.text.startup+0x1007): undefined reference to `Foam::reduce(double&, Foam::sumOp<double> const&, int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `FoamointToPointPlanarInterpolation::findTime(Foam ::List<Foam::instant> const&, int, double, int&, int&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::reduce(double&, Foam::minOp<double> const&, int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::coordinateSystem::~coordinateSystem()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::UIPstream::read(Foam::UPstream::commsTypes, int, char*, long, int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledBase::typeName'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `typeinfo for Foam::regionCoupledPolyPatch'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so: undefined reference to `Foam::LESfilter::New(Foam::fvMesh const&, Foam::dictionary const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cellDistFuncs::cellDistFuncs(FoamlyMesh const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so: undefined reference to `Foam::Reaction<Foam::exponentialSolidTransport<Fo am::species::thermo<Foam::hExponentialThermo<Foam: :rhoConst<Foam::specie> >, Foam::sensibleEnthalpy> > >::dictionaryConstructorTablePtr_'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::cellDistFuncs::correctBoundaryFaceCells(Foa m::HashSet<int, Foam::Hash<int> > const&, Foam::Field<double>&, Foam::Map<int>&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::UIPstream::UIPstream(Foam::UPstream::commsT ypes, int, Foam:ynamicList<char, 0u, 2u, 1u>&, int&, int, bool, Foam::IOstream::streamFormat, Foam::IOstream::versionNumber)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::UPstream::finishedRequest(int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `vtable for Foam::cyclicAMILduInterfaceField'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::mappedPatchBase::calcMapping() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `typeinfo for Foam::mappedPatchBase'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `typeinfo for Foam::cyclicAMILduInterfaceField'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::faceSet::~faceSet()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::mappedPatchBase::calcAMI() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::faceSet::faceSet(FoamlyMesh const&, Foam::word const&, int, Foam::IOobject::writeOption)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cyclicAMILduInterfaceField::~cyclicAMILduIn terfaceField()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::UPstream::waitRequests(int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::mappedPatchBase::samplePoints() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::abort()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `FoamintToPointPlanarInterpolation::timeNames(Foam ::List<Foam::instant> const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::faceSet::faceSet(FoamlyMesh const&, Foam::word const&, Foam::HashSet<int, Foam::Hash<int> > const&, Foam::IOobject::writeOption)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::resetRequests(int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledWallPolyPatch::typeName'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam:atchWave:atchWave(Foam:olyMesh const&, Foam::HashSet<int, Foam::Hash<int> > const&, bool)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cellDistFuncs::getPointNeighbours(Foam::Pri mitivePatch<Foam::face, Foam::SubList, Foam::Field<Foam::Vector<double> > const&, Foam::Vector<double> > const&, int, Foam::List<int>&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `typeinfo for Foam::cyclicAMILduInterface'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::cyclicAMIPolyPatch::AMI() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foamerator<<(Foam::Ostream&, Foam::wallPoint const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::init(int&, char**&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledPolyPatch::typeName'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledBase:wner() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledLduInterface::~regionCoupledLd uInterface()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::mappedPatchBase::sampleMesh() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::UIPstream::UIPstream(int, Foam::PstreamBuffers&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::cyclicAMIPolyPatch::typeName'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `typeinfo for Foam::regionCoupledBase'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::NamedEnum<Foam::mappedPatchBase::sampleMode , 5>::names'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::mappedPatchBase::~mappedPatchBase()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::UPstream::nRequests()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::mappedPatchBase::mappedPatchBase(Foam:olyPa tch const&, Foam::dictionary const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::mappedPatchBase::mappedPatchBase(Foam:olyPa tch const&, Foam::mappedPatchBase const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledBase::neighbPatchID() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::mappedPatchBase::samplePolyPatch() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cellDistFuncs::maxPatchSize(Foam::HashSet<i nt, Foam::Hash<int> > const&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::cellDistFuncs::correctBoundaryPointCells(Fo am::HashSet<int, Foam::Hash<int> > const&, Foam::Field<double>&, Foam::Map<int>&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::mappedPatchBase::typeName'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `typeinfo for Foam::cyclicAMIPolyPatch'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::cellDistFuncs::sumPatchSize(Foam::HashSet<i nt, Foam::Hash<int> > const&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `typeinfo for Foam::regionCoupledLduInterface'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so: undefined reference to `Foam::Reaction<Foam::constIsoSolidTransport<Foam: :species::thermo<Foam::hConstThermo<Foam::rhoConst <Foam::specie> >, Foam::sensibleEnthalpy> > >::dictionaryConstructorTablePtr_'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::sumReduce(double&, int&, int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cyclicAMILduInterface::~cyclicAMILduInterfa ce()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::addValidParOptions(Foam::HashTabl e<Foam::string, Foam::word, Foam::string::hash>&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::regionCoupledBase::AMI() const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::exit(int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cellDistFuncs::smallestDist(Foam::Vector<do uble> const&, Foam:olyPatch const&, int, Foam::List<int> const&, int&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::mappedPatchBase::mappedPatchBase(Foam:olyPa tch const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so: undefined reference to `Foam::reduce(Foam::Vector2D<double>&, Foam::sumOp<Foam::Vector2D<double> > const&, int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::UPstream::waitRequest(int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam:atchWave::~patchWave()'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam:perator>>(Foam::Istream&, Foam::wallPoint&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `typeinfo for Foam::regionCoupledWallPolyPatch'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::mappedPatchBase::write(Foam::Ostream&) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so: undefined reference to `Foam::UOPstream::write(Foam::UPstream::commsTypes , int, char const*, long, int)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::cellDistFuncs::cellDistFuncs(Foam::polyMesh const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::coordinateSystem::coordinateSystem(Foam::di ctionary const&, Foam:bjectRegistry const&)'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam::cyclicAMILduInterfaceField::transformCouple Field(Foam::Field<double>&, unsigned char) const'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so: undefined reference to `Foam::FaceCellWaveName::debug'
/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libfiniteVolume.so: undefined reference to `Foam:ointToPointPlanarInterpolation:ointToPointPl anarInterpolation(Foam::Field<Foam::Vector<double> > const&, Foam::Field<Foam::Vector<double> > const&, double)'
collect2: error: ld returned 1 exit status
make: *** [/opt/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/bin/wallHeatFluxTest] Błąd 1

palazi88 July 26, 2013 07:25

Hi all! It's me again.
If the thread is not in a good place and you reccomend me to put it in another sub-forum (i.e. 'OF installation') just write to me. I just think that 'wallHeatFlux' utility is used in postprocessing and that's why I put this thread here. But if I am wrong, please correct me, because I really need fast solution for this problem :( without it I can't start work for my master thesis. Hope anyone can help

alexeym July 26, 2013 08:28

wmake output you've provided is not enough to determine the problem you have. From one point of view you have a problem with environment variables (i.e. forgot to source bashrc), but in this case you should have compilation problems earlier.

So for further help, please, provide at least files and options files from Make directory. Ideally you can post utility source code as well.

palazi88 July 26, 2013 15:55

2 Attachment(s)
Thanks for answer.
Quote:

From one point of view you have a problem with environment variables (i.e. forgot to source bashrc), but in this case you should have compilation problems earlier.
I don't have to compile OF earlier, because I downloaded compiled version (and as I know, OF version with ".rpm" extension is compiled one? By the way, I think that icoFoam tutorial shouldn't work without compiled version).
So what do you mean by writing: "i.e. forgot to source bashrc"? Do you mean adding this code line at the end of bashrc? I did it as it was recommended here:
http://www.openfoam.org/download/suse.php
When it comes about utility, as I said it's just standard "wallHeatFlux" utility. I didn't change anything in code. The only change which I did is the name of utility (now "wallHeatFluxTest".
Maybe the problem is, that I put this new utility in another folder (not in folder where I can find all standard utilities)? I created special folder "extend" where I want to create new solvers/utilities. Is it problem for OpenFoam?


[EDITED]
Ok, so now I read this presentation:
http://cfd.iut.ac.ir/files/Tutorial,...20Diego%20.pdf
and on page 13 there is written:
Quote:

"Environment variables point to local work space applications and libraries:
$FOAM_PROJECT_USER_DIR
,
$FOAM_USER_APPBIN
and
$FOAM_USER_LIBBIN"
So my next question is: what is $FOAM_PROJECT_USER_DIR ? WHen I write "echo FOAM_PROJECT_USER_DIR", I got no answer from shell.

And next question, I found this page:
http://www.csc.fi/english/research/s...penfoam/modsol
And author said, that before compiling your own solver, utility etc, first initialize OpenFOAM environment (more infos on this page):
http://www.csc.fi/english/research/s.../openfoam/init
but in my case command "module add openfoam" doesn't work. Terminal doesn't recognise command "module". What this command should gives me as a result?

alexeym July 26, 2013 18:10

This can basically mean that actually your shell does not execute bashrc at all. I don't know the state of desktop environment in OpenSUSE (is it KDE or GNOME?) but you need to tell it to execute login shell it is somewhere in settings (I can not make screenshots/describe a path to the settings right now but you can search for "konsole login shell" or "gnome terminal login shell").

Alternatively you can just do "source /path/to/openfoam/bashrc" after launching your shell and then compile utility.

files and options seems to be OK so the problem should be indeed in environment variables, i.e. OpenFAOM's bashrc is not executed after your launch shell.

And finally about module command, this is usually configured by system administrators (for example if you'd like to use openmpi you do module load openmpi, on my cluster you execute module load openfoam and all environment variables are set up). This is the way of RedHat based distributions, don't know whether it is right for OpenSUSE.

palazi88 July 31, 2013 02:54

I can do it only if I'm logged as a "su". As a normal user I can't do that... Anyway, even if I will log as a su, now compilation works, but only for this window in terminal and this time. After exiting from "su" (became normal user), and again log as a su, I have to compile once again utility. It looks like linux is really old guy, who doesn't remember what he compiled last minute...
Anyway many thanks for your help

chubb87 May 25, 2016 13:07

Hi all,
I had the same symptoms (solver runs without problems, but library does not compile with the mentioned error message).

I don't know whether your problem had another origin, but for me it was simply that I had used "wmake" instead of "wmake libso" to compile an object.

ebringley September 15, 2017 12:39

gcc version error
 
Hi All,

My google searches led me here, so I'm placing this piece of information here.

For anyone who stumbled here from getting undefined references from compiled libraries to openfoam functions, check that you are using the correct version of your compiler that matches the compiler during installation. Recompile your user libraries with wmake libso before compiling your executable. This could likely happen if you have multiple versions of openfoam installed. It's a silly/stupid mistake, but one that could be infuriating to figure out.

To hopefully better help web searches, I was chasing these linking errors:
Code:

libconversion.so:  undefined reference to  `Foam::OSstream::writeQuoted(std::__cxx11::basic_string<char,  std::char_traits<char>, std::allocator<char> >  const&, bool)'
...
libOpenFOAM.so: undefined reference to `Foam::dlSym(void*, std::string const&)'
libOpenFOAM.so: undefined reference to `Foam::regExp::regExp(std::string const&, bool)'
libOpenFOAM.so: undefined reference to `Foam::regExp::operator=(std::string const&)'
...
libUserLibrary.so: undefined reference to `Foam::UOPstream::writeQuoted(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'


kirzoaktrt March 16, 2018 09:34

linking errors
 
Hi,

Could you please elaborate on the solution?
I am having the

undefined reference to `Foam::UOPstream::writeQuoted(std::string const&, bool)'

error. I have OF4, 5 and -dev installed on Ubuntu 16.04.

bigphil April 11, 2018 11:53

Quote:

Originally Posted by kirzoaktrt (Post 685444)
Hi,

Could you please elaborate on the solution?
I am having the

undefined reference to `Foam::UOPstream::writeQuoted(std::string const&, bool)'

error. I have OF4, 5 and -dev installed on Ubuntu 16.04.

Hi kirzoaktrt,

I also recently had this problem.

I was trying to compile a custom utility with a system install of OF50 on Ubuntu 16.04.

The problem was that I had changed my default gcc/g++ compiler to gcc-4.9 (I was using this with my foam-extend-4.0 install) and this caused the error.

To fix, I had to change the default gcc/g++ compiler back to gcc-5 (I guess this was the one used by the OF-5.0 install).

After that, the custom utility compilation went fine.

By the way, I obviously need to switch back to gcc/g++ 4.9 when I am using my foam-extend-4.0 installation; the command "update-alternatives" is convenient for switching program versions on Ubuntu, e.g. see here: https://askubuntu.com/questions/2649...-and-g-version.

Philip

kirzoaktrt April 11, 2018 15:11

Thanks for the reply.

It seems that some incompatibility issues between the precompiled OF and Ubuntu 16.04 caused my problems.

I compiled from source and it started working fine.

Jack001 August 13, 2018 21:52

Hi all,


How can I check which compiler was used to install my sources (I am using foam-extend-4.0) and which compiler I am using when running wmake?


When I execute wmake for my new solver.C I get

Code:

Making dependency list for source file solver.C
SOURCE=solver.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-200

So I am assuming it is g++? But How can I check which compiler was used to build my foam? I am using Ubuntu 16.04 and followed the instructions found here



https://openfoamwiki.net/index.php/I...end-4.0/Ubuntu


All times are GMT -4. The time now is 16:58.