library compilation
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 |
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 |
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 |
Oh OK, you need to use "./Allwmake" (ie not "Allwmake"). The dot forward slash uses the Allwmake in the current directory.
Philip |
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 |
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 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 |
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 |
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 |
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 |
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 = \ Philip |
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 |
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 |
Hmm
strange because i issued the command in the following directory: user@user-VirtualBox:~/OpenFOAM/user...haseEulerFoam$ wmake libso phaseModels alex |
sorry for that
i issued the command inside the twoPhaseEulerFoam directory. alex |
Hmnnn yes strange, OK try:
cd phaseModels wmake libso Philip |
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 |
Great, that means it compiled fine.
Now compile the other two libraries and then the solver. Philip |
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 |
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 |
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 = \ |
Hi
It is a little different. My option file look like: EXE_INC = \ -I../bubbleFoam \ -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 Alex |
Alex,
Try "wclean" and then "wmake", this will make wmake look for all the files for the solver again, it may help. Philip |
it did not seem to work.
it did not compile this time either. My option file look like this: EXE_INC = \ -I../bubbleFoam \ -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 Alex |
Alex,
hmmnn could you paste the output of "wclean; wmake" here so I can see? If you want you can email me your solver and I can try compile it myself (philip DOT cardiff AT ucd DOT ie). Philip |
wclean does not give me anything.
wmake gives me: 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 Sorry i mislead you the other day. There is not any changes in the solver code itself. I can not compile the original one. |
Alex,
OK createRASTurbulence.H is not in the default twoPhaseEulerFoam, so presumably you are trying to use the createRASTurbulence.H from bubbleFoam..? If that is the case then add the following line to your solver Make/options -I$(FOAM_SOLVERS)/multiphase/bubbleFoam \ instead of -I../bubbleFoam \. Then try wclean; wmake and let me know the output. If it still can't find createRASTurbulence.H then copy this file from bubbleFoam to your directory ie if you are in your solver directory then use the following command: Code:
cp $FOAM_SOLVERS/multiphase/bubbleFoam/createRASTurbulence.H . Philip |
Hi
After i typed in "-I$(FOAM_SOLVERS)/multiphase/bubbleFoam \ instead of -I../bubbleFoam" i got the following after wclean and wmake: options:2: warning: backslash and newline separated by space Making dependency list 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/opt/openfoam171/applications/solvers/multiphase/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 /opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’: /opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8: warning: unused variable ‘momentumPredictor’ /opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’ /opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’ g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/applications/solvers/multiphase/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 -Xlinker --add-needed Make/linux64GccDPOpt/twoPhaseEulerFoam.o -L/opt/openfoam171/lib/linux64GccDPOpt \ -L/home/user/OpenFOAM/user-1.7.1/lib/linux64GccDPOpt -lEulerianInterfacialModels -lfiniteVolume -lmeshTools -lincompressibleTransportModels -lphaseModel -lkineticTheoryModel -lOpenFOAM -liberty -ldl -lm -o /home/user/OpenFOAM/user-1.7.1/applications/bin/linux64GccDPOpt/alex Alex |
Alex,
From the output shown, your solver has compiled. The last line "-o /home/user/OpenFOAM/user-1.7.1/applications/bin/linux64GccDPOpt/alex" shows that your solver executable called alex has been output to the directory /home/user/OpenFOAM/user-1.7.1/applications/bin/linux64GccDPOpt/ (which is $FOAM_USER_APPBIN). So you should be able to run your solver (called alex) now, just run "alex" in your case directory. There are a few compiler warnings shown, they are three "unused variables". This means you declared the variables shown but never used them. This is not an error but make sure that you are not meant to use these variables and remove them if you don't need them. Also the wmake warning "options:2: warning: backslash and newline separated by space" wants you to remove a space in the Make/options file. So your solver compiles, now you just have to get it to do what you want ;) Philip |
hmm
i get the following whne typing "alex": FOAM FATAL IO ERROR: cannot open file file: /home/user/OpenFOAM/user-1.7.1/applications/solvers/multiphase/twoPhaseEulerFoam/system/controlDict at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 61. Alex |
Alex,
You have to run your solver in your case directory (not the solver source code directory). The solver is looking for the controlDict file in the system directory of your case. You should check out the tutorials in the user guide (http://www.openfoam.com/docs/user/). Philip |
Thank you very much Philihp
Alex |
No Problem,
Hopefully your solver works out for you! Philip |
All times are GMT -4. The time now is 15:04. |