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

Compiling Solver: Clang error linker commander failed

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2014, 15:32
Post Compiling Solver: Clang error linker commander failed
  #1
New Member
 
Join Date: Apr 2014
Posts: 8
Rep Power: 12
schwam is on a distinguished road
Hallo,

im quite new to the CFD stuff so pleas be a little patient =)

I installed OpenFoam 2.2.2 on a Mac OS 10.9 (mavericks) according to this blog entry:
LINK

the tutorials are working fine but i need to compile a solver (which i did not write on my own but im quite sure that it should work on of222) which does not work perfectly.

the option file in the make dir of the solver looks like this:
Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/dynamicFvMesh/lnInclude \


EXE_LIBS = \
    -lincompressibleTransportModels \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume \
    -lmeshTools \
    -lfvOptions \
    -lsampling
here are the fist few lines of the *.C file of the solver where all the include commands are:

Code:
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "dynamicFvMesh.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
#include <iomanip>  // ::std::resetiosflags, ::std::setprecision
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// * * * * * * * * * * * * BEGIN myHeaders * * * * * * * * * * * * * * * * * * * * //
#include "volPointInterpolation.H"	//needed for const_cast (change) of pointMotionU
#include "myFunctions.H"
#include "PrimitivePatchInterpolation.H"
// * * * * * * * * * * * * * *END myHeaders * * * * * * * * * * * * * * * * * * * * * * * //




int main(int argc, char *argv[])
{
  #include "setRootCase.H"
  #include "createTime.H"
  #include "createDynamicFvMesh.H"
  #include "initContinuityErrs.H"
  #include "createFields.H"
  #include "createFvOptions.H"
  #include "readTimeControls.H"
when in now try to compile to solver i get an error like this:

Code:
Undefined symbols for architecture x86_64:
  "Foam::dynamicFvMesh::New(Foam::IOobject const&)", referenced from:
      _main in pimpleSnowDriftFoam.o
  "typeinfo for Foam::dynamicFvMesh", referenced from:
      _main in pimpleSnowDriftFoam.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
somehow the dynamicFvMesh makes some trouble, but since i'm quite new to this stuff i have no idea how to fix this.

Pleas can somebody give me a hint?


salute schwam
schwam is offline   Reply With Quote

Old   May 9, 2014, 04:00
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

try adding these lines to EXE_LIBS in the options file:

Code:
    -ldynamicMesh \
    -ldynamicFvMesh \
as linker wasn't able to find "Foam::dynamicFvMesh::New(Foam::IOobject const&)".
alexeym is offline   Reply With Quote

Old   May 9, 2014, 06:22
Talking
  #3
New Member
 
Join Date: Apr 2014
Posts: 8
Rep Power: 12
schwam is on a distinguished road
THANK YOU VERY MUCH!!

This adding the libs solved the problen and the solver is running perfectly now.

Thanks!!!!

Greedings
schwam
schwam is offline   Reply With Quote

Old   May 9, 2014, 07:48
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
In fact error has nothing to do with OS X, you'll need these linker switches on Linux as well.
alexeym is offline   Reply With Quote

Old   May 9, 2014, 11:35
Question
  #5
New Member
 
Join Date: Apr 2014
Posts: 8
Rep Power: 12
schwam is on a distinguished road
since i'm quite new to this stuff i though maybe it will help when i tell you guys exactly what im talking about and which system im running.

but again thanks

since im allready writing:
i'va a stange error when using paraFoam:
Code:
$ paraFoam
OpenFOAM/OpenFOAM-2.2.2/bin/paraFoam: line 267: paraview: command not found
if i run paraForm with
Code:
$ paraFoam -touch
....
$ paraview --data="**somecasename**.foam"
everything works fine and i can use paraview just like normal but its kind of annoying to get errors =)

any ideas?


Greedings schwam
schwam is offline   Reply With Quote

Old   May 9, 2014, 15:17
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
It's rather strange cause line 267 of paraFoam is:

Code:
paraview --data="$caseFile" "$@" 2>&1 | fgrep -v 'Inconsistency detected by ld.so'
alexeym is offline   Reply With Quote

Old   May 10, 2014, 08:29
Default
  #7
New Member
 
Join Date: Apr 2014
Posts: 8
Rep Power: 12
schwam is on a distinguished road
that is exactly the same i have in that line:

Code:
267: paraview --data="$caseFile" "$@" 2>&1 | fgrep -v 'Inconsistency detected by ld.so'
that line also gave me the idea to try

Code:
paraFoam -touch
paraview --data="...foam"
maybe something is wrong with the keyword "$casefile" in the OpenFoam/bin/paraFoam file?
schwam is offline   Reply With Quote

Old   May 10, 2014, 12:37
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, I've reproduced the error (initially I had symlink to /Applications/paraview.app/Contents/MacOS/paraview in $HOME/bin, so there was no problem).

If you don't mind editing certain files:

1. cd $WM_PROJECT_DIR/etc/config
2. open paraview.sh in editor
3. Change the lines between 137 and 152 to

Code:
if [ $WM_ARCH_BASE=="darwin" ]
then
    : ${PARAVIEW_APP_DIR:="/Applications/paraview.app"}; export PARAVIEW_APP_DIR
    if [ -d $PARAVIEW_APP_DIR -a ! -r $ParaView_DIR ]
    then
	paraview () {
	    $PARAVIEW_APP_DIR/Contents/MacOS/paraview "$@"
	}
	export -f paraview
	echo "Using paraview in directory $PARAVIEW_APP_DIR"
	unset ParaView_VERSION ParaView_MAJOR ParaView_DIR
	# needs to be an alias because if it is in the path the Python Shell does not work
	# alias paraview=$PARAVIEW_APP_DIR/Contents/MacOS/paraview
	export PATH=$PARAVIEW_APP_DIR/Contents/bin:$PATH
    fi
fi
Basically I've changed alias definition to function.

It seems to be working now.
alexeym is offline   Reply With Quote

Old   May 10, 2014, 15:42
Talking
  #9
New Member
 
Join Date: Apr 2014
Posts: 8
Rep Power: 12
schwam is on a distinguished road
thanks again!

now everything works perfektliy.



BIG THANKS



Greedings schwam
schwam is offline   Reply With Quote

Old   May 10, 2014, 19:11
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, I'm not quite sure if it really works perfectly. IIRC there could be problems with parallel execution. Just to make a decision to support the patch or not, did you prefer this link instead of this one cause you didn't want to mess with package managers or just cause it was on OpenFOAM wiki?
alexeym is offline   Reply With Quote

Old   May 12, 2014, 02:38
Default
  #11
New Member
 
Join Date: Apr 2014
Posts: 8
Rep Power: 12
schwam is on a distinguished road
i preferred this LINK just because i find it fist on google =)
and it looks quite cleat what to do (although one have tho use brew and a patch - but still pretty straight foreword).

First i installed of 2.3.0 but somehow they change something in ddtCorr (LINK_extendet_ddtCorr in of230. since i dont wanted to change the whole code of the solver i got from a colleague, i chose to lunch of222 which also worked perfekt according to the mentioned (mine and your second) link.

greedings
schwam is offline   Reply With Quote

Old   May 25, 2014, 05:31
Default
  #12
Member
 
Francisco T
Join Date: Nov 2011
Location: Melbourne, Australia
Posts: 64
Blog Entries: 1
Rep Power: 15
frantov is on a distinguished road
HI Alex
thanks for the link, I edited paraview.sh as suggested, and now I get this:

>>paraFoam
created temporary 'cavity.foam'
/OpenFOAM/OpenFOAM-2.3.0/bin/paraFoam: 2946PARAVIEW_APP_DIR/Contents/MacOS/paraview: No such file or directory

I can open paraview manually with doble click in applications. Any clue? thanks a lot
F
frantov 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
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31
user defined function cfduser CFX 0 April 29, 2006 11:58
about USER FORTRAN compiling issue CXL CFX 1 October 9, 2003 22:00
compressible two phase flow in CFX4.4 youngan CFX 0 July 2, 2003 00:32
Setting a B.C using UserFortran in 4.3 tokai CFX 10 July 17, 2001 17:25


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