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

library compilation

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

Like Tree2Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   July 29, 2011, 04:54
Default library compilation
  #1
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hi, i am quite new to openfoam.
i have looked in the user manual to compile a dynamic library, that is to issue the command wmake libso.

the error message i receive is:

Making dependency list for source file twoPhaseEulerFoam.C
could not open file createRASTurbulence.H for source file twoPhaseEulerFoam.C
could not open file wallFunctions.H for source file twoPhaseEulerFoam.C
could not open file wallDissipation.H for source file twoPhaseEulerFoam.C
could not open file wallViscosity.H for source file twoPhaseEulerFoam.C
SOURCE=twoPhaseEulerFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I../bubbleFoam -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/transportModels/incompressible/lnInclude -IturbulenceModel -IkineticTheoryModels/lnInclude -IinterfacialModels/lnInclude -IphaseModel/lnInclude -Iaveraging -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/twoPhaseEulerFoam.o
In file included from twoPhaseEulerFoam.C:54:
createFields.H:131: fatal error: createRASTurbulence.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/twoPhaseEulerFoam.o] Error 1


the Allwmake command gives me:
Allwclean: command not found

typing wmake does neither give me much...


could someone please help me ?

alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 05:48
Default
  #2
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Hi,


You are correct "wmake libso" is used to compile a dynamic library but wmake needs to know the location of all the header files. Also you need to be inside the library directory when you execute wmake libso.

Quote:
could not open file createRASTurbulence.H for source file twoPhaseEulerFoam.C
could not open file wallFunctions.H for source file twoPhaseEulerFoam.C
could not open file wallDissipation.H for source file twoPhaseEulerFoam.C
could not open file wallViscosity.H for source file twoPhaseEulerFoam.C
This error shows that wmake cannot find some of the files.
You can specify which directories wmake will search by putting their location in the Make/options file.

Also, isn't twoPhasaEulerFoam a solver? not a library? Solvers are compiled with the wmake command (or in the case of twoPhaseEulerFoam, you use the ./Allwmake script inside the solver directory which also compiles the included libraries).


Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 06:22
Default
  #3
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Yes, twoPhaseEulerFoam is a solver, not a library.

I tried Allwmake inside the solver directory but then i receive the answer: Allwmake: command not found

i have done some modifications in the solver..




alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 06:26
Default
  #4
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Oh OK, you need to use "./Allwmake" (ie not "Allwmake"). The dot forward slash uses the Allwmake in the current directory.

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 08:43
Default
  #5
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Sorry Philip, my bad. i should have understood.. thank you very much.

At least it tried to compile this time, but i get the same error again (at the end):

could not open file createRASTurbulence.H for source file twoPhaseEulerFoam.C
could not open file wallFunctions.H for source file twoPhaseEulerFoam.C
could not open file wallDissipation.H for source file twoPhaseEulerFoam.C
could not open file wallViscosity.H for source file twoPhaseEulerFoam.C

I have serious problems finding the paths to the files.
Could you please help me out ?

alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 09:04
Default
  #6
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Alex,

OK try to compile each part separately to see if we can isolate the problem, so if you look in the Allwmake script (using a text editor like emacs) you will see:
Code:
wmake libso phaseModel
wmake libso interfacialModels
wmake libso kineticTheoryModels
wmake
The first three lines compile the libraries and the fourth line compiles the solver and links the libraries to the solver.

So first try:
wmake libso phaseModel
and see if you get any errors,
then do the second line and so on... and then we will find which part is at fault.

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 09:25
Default
  #7
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hi

I think that all of them gave me some kind of error, but i am going to let out all that is about kinetic theory. so no need to worry about that.

alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 09:43
Default
  #8
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Alex,

If you try: wmake libso phaseModel
and then paste the output here, and I will see if anything looks strange.

By the way, did twoPhaseEulerFoam compile correctly before you made modifications?

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 09:51
Default
  #9
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hi

The error message i got was:

/usr/bin/ld: cannot open output file /opt/openfoam171/lib/linux64GccDPOpt/libphaseModel.so: Permission denied
collect2: ld returned 1 exit status
make: *** [/opt/openfoam171/lib/linux64GccDPOpt/libphaseModel.so] Error 1


Yes, twoPhaseEulerFoam compiled correctly before the mods.

alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 10:08
Default
  #10
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Alex,

OK it is a permissions problem, wmake is trying to put the compiled libraries in a directory for which you do not have permission.
So to fix it, we just have to tell wmake to put the libraries in your $FOAM_USER_LIBBIN instead of $FOAM_LIBBIN.

In phaseModels/Make/files, change
LIB = $(FOAM_LIBBIN)/libphaseModel
to
LIB = $(FOAM_USER_LIBBIN)/libphaseModel

Then do the same in interfacialModels/Make/files and kineticTheoryModels/Make/files.

Now try wmake libso phaseModels and it should compile fine.

Also you have to tell your solver to use your libraries, so in the solver Make/options (ie twoPhaseEulerFoam/Make/options), add the following bold line:

Code:
EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \ 
    -lEulerianInterfacialModels \
    -lfiniteVolume \
    -lmeshTools \
    -lincompressibleTransportModels \
    -lphaseModel \
    -lkineticTheoryModel \
    -llduSolvers
Now hopefully ./Allwmake should run fine.

Philip
ayhan515 and mgg like this.

Last edited by bigphil; July 29, 2011 at 10:29.
bigphil is offline   Reply With Quote

Old   July 29, 2011, 10:28
Default
  #11
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hi

After i had added USER to the different models i tried wmake libso phaseModels and i got the following error:

wmake error: could not change to directory 'phaseModels'


alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 10:42
Default
  #12
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Alex,

you should be in the directory above the library when you execute wmake libso phaseModels (ie you should be in the twoPhaseEulerFoam directory where Allwmake is when you execute wmake libso phaseModels).

The error you received means wmake cannot find the phaseModels directory in the current directory.

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 10:50
Default
  #13
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hmm

strange because i issued the command in the following directory:

user@user-VirtualBox:~/OpenFOAM/user...haseEulerFoam$ wmake libso phaseModels


alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 10:51
Default
  #14
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
sorry for that

i issued the command inside the twoPhaseEulerFoam directory.

alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 10:52
Default
  #15
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Hmnnn yes strange, OK try:

cd phaseModels
wmake libso

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 10:55
Default
  #16
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hi

i got the following message after typing wmake libso inside phaseModels:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseModel/phaseModel.C
SOURCE=phaseModel/phaseModel.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/transportModels/incompressible/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/phaseModel.o
'/home/user/OpenFOAM/user-1.7.1/lib/linux64GccDPOpt/libphaseModel.so' is up to date.


alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 10:59
Default
  #17
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Great, that means it compiled fine.

Now compile the other two libraries and then the solver.

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 11:08
Default
  #18
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Oh and also I just realises why "wmake libso phaseModels" didn't work, it is because the library directory is called phaseModel not phaseModels.

So "wmake libso phaseModel" will work in the solver directory.

Philip
bigphil is offline   Reply With Quote

Old   July 29, 2011, 11:12
Default
  #19
Member
 
Alexander
Join Date: Jul 2011
Posts: 36
Rep Power: 5
foamer is on a distinguished road
Hi

the libraries compiled fine, but when i tried to compile the solver by issuing wmake inside the twoPhaseEulerFoam directory i got the following message:

Making dependency list for source file twoPhaseEulerFoam.C
could not open file createRASTurbulence.H for source file twoPhaseEulerFoam.C
could not open file wallFunctions.H for source file twoPhaseEulerFoam.C
could not open file wallDissipation.H for source file twoPhaseEulerFoam.C
could not open file wallViscosity.H for source file twoPhaseEulerFoam.C
SOURCE=twoPhaseEulerFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I../bubbleFoam -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/transportModels/incompressible/lnInclude -IturbulenceModel -IkineticTheoryModels/lnInclude -IinterfacialModels/lnInclude -IphaseModel/lnInclude -Iaveraging -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/twoPhaseEulerFoam.o
In file included from twoPhaseEulerFoam.C:54:
createFields.H:131: fatal error: createRASTurbulence.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/twoPhaseEulerFoam.o] Error 1


alex
foamer is offline   Reply With Quote

Old   July 29, 2011, 11:31
Default
  #20
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 536
Rep Power: 17
bigphil will become famous soon enough
Alex,

OK we're back to the original error that wmake cannot find some files. wmake looks in the directories specified in the solver Make/options file. What does your options file look like?
It should be:
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -IturbulenceModel \
    -IkineticTheoryModels/lnInclude \
    -IinterfacialModels/lnInclude \
    -IphaseModel/lnInclude \
    -Iaveraging

EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lEulerianInterfacialModels \
    -lfiniteVolume \
    -lmeshTools \
    -lincompressibleTransportModels \
    -lphaseModel \
    -lkineticTheoryModel \
    -llduSolvers
Philip
bigphil is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem loading UDF library in parallel cluster Veera Gutti FLUENT 7 July 3, 2011 09:15
Problems in personal library compilation shrina OpenFOAM 3 February 23, 2009 11:12
OpenFOAM141dev linking error on IBM AIX 52 matthias OpenFOAM Installation 24 April 28, 2008 15:49
Personal library compilation mss OpenFOAM Running, Solving & CFD 1 September 13, 2007 06:10
Help! I cann't make library Bowling FLUENT 5 May 12, 2004 04:56


All times are GMT -4. The time now is 13:33.