|
[Sponsors] |
July 29, 2011, 05:54 |
library compilation
|
#1 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 06:48 |
|
#2 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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:
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 |
||
July 29, 2011, 07:22 |
|
#3 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 07:26 |
|
#4 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Oh OK, you need to use "./Allwmake" (ie not "Allwmake"). The dot forward slash uses the Allwmake in the current directory.
Philip |
|
July 29, 2011, 09:43 |
|
#5 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 10:04 |
|
#6 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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 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 |
|
July 29, 2011, 10:25 |
|
#7 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 10:43 |
|
#8 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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 |
|
July 29, 2011, 10:51 |
|
#9 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 11:08 |
|
#10 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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 Philip Last edited by bigphil; July 29, 2011 at 11:29. |
|
July 29, 2011, 11:28 |
|
#11 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 11:42 |
|
#12 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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 |
|
July 29, 2011, 11:50 |
|
#13 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
Hmm
strange because i issued the command in the following directory: user@user-VirtualBox:~/OpenFOAM/user...haseEulerFoam$ wmake libso phaseModels alex |
|
July 29, 2011, 11:51 |
|
#14 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
sorry for that
i issued the command inside the twoPhaseEulerFoam directory. alex |
|
July 29, 2011, 11:52 |
|
#15 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Hmnnn yes strange, OK try:
cd phaseModels wmake libso Philip |
|
July 29, 2011, 11:55 |
|
#16 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 11:59 |
|
#17 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Great, that means it compiled fine.
Now compile the other two libraries and then the solver. Philip |
|
July 29, 2011, 12:08 |
|
#18 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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 |
|
July 29, 2011, 12:12 |
|
#19 |
Member
Alexander
Join Date: Jul 2011
Posts: 38
Rep Power: 15 |
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 |
|
July 29, 2011, 12:31 |
|
#20 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem loading UDF library in parallel cluster | Veera Gutti | FLUENT | 8 | July 26, 2016 08:24 |
Problems in personal library compilation | shrina | OpenFOAM | 3 | February 23, 2009 12:12 |
OpenFOAM141dev linking error on IBM AIX 52 | matthias | OpenFOAM Installation | 24 | April 28, 2008 16:49 |
Personal library compilation | mss | OpenFOAM Running, Solving & CFD | 1 | September 13, 2007 07:10 |
Help! I cann't make library | Bowling | FLUENT | 5 | May 12, 2004 05:56 |