CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   How to compile? (

A.A. September 18, 2012 08:57

How to compile?

I am absolute beginner in OF and I need to know how to compile if I want to make changes to the oscillatinRotatingMotion:C and .H files.

Could somebody explain the steps to do like for dummies?


wyldckat September 18, 2012 15:13

Greetings Alex,

To learn how to create a modified solver:

The idea is nearly identical when it comes to creating a custom library. The detail is that with libraries, you only have to copy-paste-change what you really want.

I've helped other people with similar situations, where the most recent is this one: post #5

Best regards,

elvis September 19, 2012 02:54

Dear Alexander,

if you do not already know them =>New Developer Sessions change year 2007..2012 to see different material

A.A. September 19, 2012 04:54

1 Attachment(s)

I followed the steps in the links you posted.
But if I write this in the terminal $FOAM_USER_APPBIN it says no such file or directory.
As I couldn't find the location above I placed my folder called newApp in $WM_PROJECT_USER_DIR. I hope thats also ok.

I have attached the newApp folder. There I created the Make/files and Make/options
and the code for myoscillatingRotatingMotion. In the code I changed all class names to myoscillatingRotaingMotion.

Then I wrote wmake and also tried wmake libso.

But I get the following error message:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file myoscillatingRotatingMotion.C
could not open file solidBodyMotionFunction.H for source file myoscillatingRotatingMotion.C
SOURCE=myoscillatingRotatingMotion.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/triSurface/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -I/opt/openfoam211/src/dynamicMesh/lnInclude -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/myoscillatingRotatingMotion.o
In file included from myoscillatingRotatingMotion.C:26:0:
myoscillatingRotatingMotion.H:38:37: fatal error: solidBodyMotionFunction.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/myoscillatingRotatingMotion.o] Error 1

What am I doing wrong?

Thanks allot,

A.A. September 19, 2012 08:27


I managed to compile my newApp library which comprises myoscillatingRotatingMotion.

The problem is I call multiMotion in my dynamicMeshdict file which should offer to use myoscillatingRotatingMotion. But when I run the case it comes an error which says valid solidBodyMotionFunctions for the multiMotion are ...and list the valid functions . This List doesen't comprise my oscillatingRotatingMotion.

What do I have to do that the multiMotion also offers to call myoscillatingrotatingMotion?


A.A. September 19, 2012 08:47


I made a mistake I forgot to put libs ("...") in the controlDict file.
After correcting this I get the following error in log.pimpleDyMFoam:

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load ""

Could the problem be that the location of my library is wrong? As I said I couldn't find $FOAM_USER_APPBIN on my PC and I put It in $WM_PROJECT_USER_DIR.


A.A. September 19, 2012 10:21


Got it in the end ! My function works.

It's all in the links from Bruno.

Many thanks,

All times are GMT -4. The time now is 19:40.