|
[Sponsors] |
April 1, 2010, 14:49 |
wmake compiling new solver
|
#1 |
New Member
Join Date: Apr 2010
Posts: 3
Rep Power: 16 |
Hello everyone,
I've been experimenting with openFoam for a little while now and everything was going great. I am running the software on Mac OS X 10.5 and am trying to create a new solver from an existing one as per the tutorial by Lucchini (creating icoScalarTransportFoam from icoFoam...). physics.ucsd.edu/students/courses/spring2009/.../Tutorial2.pdf I have copied the icoFoam solver to my directory, renamed it and modified the .C,.H, Make/files, files as described but when I go to compile using wmake this is what appears: /*******************************************/ /bin/sh: cpp-4.2: command not found make: *** [darwinPpcDPOpt/options] Error 127 /bin/sh: cpp-4.2: command not found make: *** [darwinPpcDPOpt/files] Error 127 wmake error file 'Make/darwinPpcDPOpt/objectFiles' was not created successfully /*******************************************/ I don't understand the error message. Any help would be more than welcome. If i copy the files and options files into the darwinPpcDPOpt directory, it conpiles a little further and this is the output then: Making dependency list for source file icoScalarTransportFoam.C could not open file PrimitivePatch.C for source file icoScalarTransportFoam.C could not open file labelPair.H for source file icoScalarTransportFoam.C could not open file boundBox.H for source file icoScalarTransportFoam.C could not open file pointZoneMesh.H for source file icoScalarTransportFoam.C could not open file faceZoneMesh.H for source file icoScalarTransportFoam.C could not open file cellZoneMesh.H for source file icoScalarTransportFoam.C could not open file lduMesh.H for source file icoScalarTransportFoam.C could not open file fvBoundaryMesh.H for source file icoScalarTransportFoam.C could not open file surfaceInterpolation.H for source file icoScalarTransportFoam.C could not open file DimensionedField.H for source file icoScalarTransportFoam.C could not open file volFieldsFwd.H for source file icoScalarTransportFoam.C could not open file surfaceFieldsFwd.H for source file icoScalarTransportFoam.C could not open file pointFieldsFwd.H for source file icoScalarTransportFoam.C could not open file slicedVolFieldsFwd.H for source file icoScalarTransportFoam.C could not open file slicedSurfaceFieldsFwd.H for source file icoScalarTransportFoam.C could not open file fvPatchFvMeshTemplates.C for source file icoScalarTransportFoam.C could not open file fvc.H for source file icoScalarTransportFoam.C could not open file fvMatrices.H for source file icoScalarTransportFoam.C could not open file fvm.H for source file icoScalarTransportFoam.C could not open file linear.H for source file icoScalarTransportFoam.C could not open file calculatedFvPatchFields.H for source file icoScalarTransportFoam.C could not open file fixedValueFvPatchFields.H for source file icoScalarTransportFoam.C could not open file adjustPhi.H for source file icoScalarTransportFoam.C could not open file findRefCell.H for source file icoScalarTransportFoam.C could not open file mathematicalConstants.H for source file icoScalarTransportFoam.C could not open file argList.H for source file icoScalarTransportFoam.C could not open file timeSelector.H for source file icoScalarTransportFoam.C could not open file setRootCase.H for source file icoScalarTransportFoam.C could not open file createTime.H for source file icoScalarTransportFoam.C could not open file createMesh.H for source file icoScalarTransportFoam.C could not open file createFields.H for source file icoScalarTransportFoam.C could not open file initContinuityErrs.H for source file icoScalarTransportFoam.C could not open file readPISOControls.H for source file icoScalarTransportFoam.C could not open file CourantNo.H for source file icoScalarTransportFoam.C could not open file TEqn.H for source file icoScalarTransportFoam.C could not open file continuityErrs.H for source file icoScalarTransportFoam.C SOURCE=icoScalarTransportFoam.C ; g++-4.2 -DdarwinPpc -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/Users/seccarene/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/seccarene/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/Users/seccarene/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -Ddarwin -arch ppc -c $SOURCE -o Make/darwinPpcDPOpt/icoScalarTransportFoam.o /bin/sh: g++-4.2: command not found make: *** [Make/darwinPpcDPOpt/icoScalarTransportFoam.o] Error 127 I would be very grateful for any help anyone could provide! Thanks Last edited by mksca; April 1, 2010 at 17:10. |
|
April 1, 2010, 18:11 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 |
Greetings mksca,
OK, although I don't have access to a Mac, I'll assume that the inner workings in a terminal are similar to a Linux box. So, run this: Code:
which gcc gcc -v Assuming you do have gcc installed, the which command should have given you something like: Code:
/usr/bin/gcc Now, OpenFOAM's wmake is looking for the 4.2 version, by referring directly to gcc-4.2 and g++-4.2. So, when you have gcc up and running, look at the following files for references to gcc-4.2 and g++-4.2 and change them to gcc and g++: Code:
OpenFOAM-1.5/etc/bashrc OpenFOAM-1.5/wmake/rules/darwinPpc/* Best regards, Bruno |
|
April 3, 2010, 09:31 |
|
#3 |
New Member
Join Date: Apr 2010
Posts: 3
Rep Power: 16 |
Hi wyldckat,
Thank you for your reply. I thought the problem was along those lines so I downloaded gcc-4.2 and tried it again. "gcc -v" gave me version 4.0.1 as my default. Editing the files you mentioned was also something i considered. The problem I'm facing now is that OpenFoam is saved onto a sparse disc image and the contents are therefore read only. Tried editing the access rights and so on, tried login in as root user and the files as still not writable... Should the contents of my OpenFOAM disc image be copied in my project directory where it would become writable and then change all the paths in the relevant files to match... seems unlikely to be the best solution? I do realize you may not be familiar with the Mac stuff and I therefore appeal to anyone who would be able to help me. Another question however, should i be able to run tutorial cases if supposedly my version of gcc (4.0) is not adequate? Does wmake require gcc-4.2 or higher whereas the cases don't? Thanks for your time, Marc |
|
April 5, 2010, 17:40 |
|
#4 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 |
Hello again Marc
Quote:
By the way, just found one that might suit you:Source: Wikipedia As for the rest, might I suggest "keeping it simple" and going with the latest OpenFOAM version as well as the latest threads for Mac OS X? Like this one? I say this, because in the OpenFOAM-1.5 folder you have, there should be a README file and inside it, it should state which is the minimum version of gcc required to build it. So, if you have to install a new version of gcc, might as well go with the latest high-tech: OpenFOAM 1.6 and gcc-4.3.3 Then again, you might need to stick to the disk image you've got. Uhm, didn't that image come with additional instructions? Best regards, Bruno |
||
April 6, 2010, 12:23 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
If your diskimage is read-only use the DiskManager to convert it to a write-able format (there is also a command-line tool for that) As a last resort try cheating: alias cpp-4.2=cpp-4.0 and so on Bernhard |
||
April 6, 2010, 18:27 |
|
#6 |
New Member
Join Date: Apr 2010
Posts: 3
Rep Power: 16 |
Greetings all,
First of all thank you very much for your help Bernhard/Wyldckat! I have Xcode 3.0 already installed on my machine and gcc versions 3.3, 4.0, 4.2.(Is that ridiculous, should i remove the older versions??) After bernhard's advice, I managed to convert my diskimage to a read/write one and have edited the wmake files as suggested by wyldckat previously. I copied gcc 4.2 into /usr/local/bin via the terminal as it wasn't in that directory previously. That allowed me to compile a little further with wmake and here's what i get: g++-4.2 -DdarwinPpc -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/Users/seccarene/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/seccarene/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/Users/seccarene/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -Ddarwin -arch ppc -lpthread -L/Users/seccarene/OpenFOAM/OpenFOAM-1.5/lib/darwinPpcDPOpt -lOpenFOAM -L/Users/seccarene/OpenFOAM/OpenFOAM-1.5/lib/darwinPpcDPOpt/openmpi-1.2.3 -lPstream -L/Users/seccarene/OpenFOAM/OpenFOAM-1.5/lib/darwinPpcDPOpt \ -lfiniteVolume -lOpenFOAM -lpthread -lm -o OpenFOAM.out ld: library not found for -lstdc++ make: *** [OpenFOAM.out] Error 1 It is now looking for -lstdc++, have you any idea what I should do? Where do you have gcc saved on your mac bernhard? Would you recommend usr/local/bin as a good location or should i redefine the paths to the compiler? Still don't know how the problem doesn't occur when running the tutorials? Thank you ! Marc |
|
April 7, 2010, 11:51 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
You copied g++-4.2 from where? Just copying is not a good idea because now it will probably look for standard-libraries in the /usr/local-hierarchy. The compiler relies on a lot of other things (libraries, tools) so a simple copy won't help My g++-4.2 is in /usr/bin. If yours was there why did you copy it in the first place? Bernhard |
||
August 1, 2014, 15:16 |
|
#8 |
Member
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 12 |
Good Day Bruno
Bother you with some issue similar to Mksca. I'm trying to create my own library of bio diesel to make simulations using Openfoam 2.3.0 with the solver sprayFoam. So when Im running the compiling of the library this is the error that was displayed: -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/C18H32O2.o jar cfm /home/adolfo/OpenFOAM/adolfo-2.3.0/platforms/linux64GccDPOpt/lib/libmy_liqprop .jar -lthermophysicalFunctions -C Make/classes . make: jar: Command not found make: *** [/home/adolfo/OpenFOAM/adolfo-2.3.0/platforms/linux64GccDPOpt/lib/libmy_liqprop] Error 127 So the lib folder is empty and I can't compile without errors and also the new solver where I add that library doesn't use any of the fuel's in that folder I guess that maybe this is the reason. Any clue would be appreciated. Kind regards Kind regars |
|
August 4, 2014, 12:41 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 |
Greetings ENKIME,
It's asking about a "jar" executable? What was the exact command you used to try and build the library? I ask this because "jar" is only needed for building Java applications. And can you provide more information? It's really a strange error you're getting. Best regards, Bruno
__________________
|
|
August 4, 2014, 16:43 |
|
#10 |
Member
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 12 |
Hi Bruno
I already can compile the solver but I can't make it work, when I'm running the solver, already compiled and with out errors, doesn't use the new library and send me the error message that liquid is not in the src library when I already create a new library with that liquid, compiled and added to the new compiled solver. Really that's the deal. Thanks a lot for that quick answer. Kind regards |
|
August 5, 2014, 13:38 |
|
#11 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 |
Quote:
It would make it a lot easier to diagnose the problem if you shared more details, namely:
|
||
August 5, 2014, 16:03 |
|
#12 |
Member
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 12 |
Sorry Bruno let me be more clear.
1. I copy and compile a new library of liquid properties: From the src/thermophysicalmodels/properties/liquidProperties.. I copy only the properties of tri-decane to my user utilities using the bash commands for openFoam: Steps: a) Code:
mkdir -p $WM_PROJECT_USER_DIR/applications cp -r $FOAM_SRC/thermophysicalmodels/properties/liquidProperties/C13H28 $WM_PROJECT_USER_DIR/applications/myliquidproperties b)I rename the new C13H28 folder and all the files in there, also using the command Code:
sed –i s/”C13H28”/”C18H32O2”/g C18H32O2.C sed –i s/”C13H28”/”C18H32O2”/g C18H32O2.H sed –i s/”C13H28”/”C18H32O2”/g C18H32O2I.H b)Also copy all the liquidProperties solver the .C, .H and the I.H. c) Using, in the main folder myliquidproperties, the next command: Code:
mkdir Make touch Make/files Code:
liquidProperties/liquidProperties.C C18H32O2/C18H32O2.C LIB = $(FOAM_USER_LIBBIN)/libmyliquidProperties Code:
touch Make/options Code:
EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude LIB_LIBS = \ -lthermophysicalFunctions and then a lib folder was created with libmyliquidProperties.so 2. For adding to my new solver: a) Using the same procedure I create a new solver called my_sprayFoam with the respectively pEqn.H, rhoEqn.H, UEqn.H, YEqn.H and EEqn.H. b)In the make folder I modify the options file with the next line: Code:
-I$(WM_PROJECT_USER_DIR)/applications/myliquidProperties/liquidProperties/lnInclude \ c) Using wmake I compile the new solver with the new library in dependency 3. In this is the last step that is need to be done. In the controldic file at the end of the file is need to be added something like this: Code:
libs ( "libmyliquidProperties.so" ); I guess this is as far as I can go and there is no more solutions for the compilation problems. Kind Regards Last edited by wyldckat; August 17, 2014 at 12:58. Reason: Added [CODE][/CODE] |
|
August 17, 2014, 13:34 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 |
Hi ENKIME,
Nice! This makes it a lot easier to diagnose what might have gone wrong. I hope you don't mind, I've did a small edition to your post and added the "[CODE]" markers to make it easier to figure out which parts are code. An explanation on how this can be done is in one of the links in my signature below. OK, there are a few details that stand out to me right away:
Mmm... no, that's not it. After reviewing the steps you've given and the description I've given in this post, it looks like the problem is that even though you did properly modify this line in "Make/options": Code:
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ Code:
-I$(WM_PROJECT_USER_DIR)/applications/myliquidProperties/liquidProperties/lnInclude \ The missing step is very likely what I described in detail #4 and keep in mind to remove the line "-lliquidProperties". Best regards, Bruno
__________________
|
|
August 18, 2014, 22:26 |
|
#14 |
Member
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 12 |
Dear Bruno
Thanks a lot for your answer this post really help me to solve that issue that was driving me crazy. I can run easily take a look. The original liquid was tridecane and the new one is linoleic acid, the next step is to modify the constants for the liquid properties to complete a biodiesel-diesel blend. Again my friend thanks a lot Kind Regards |
|
June 22, 2018, 06:29 |
|
#15 | |
New Member
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 8 |
Quote:
I am also trying for compiling a new liquid library (same as C7H16 with minor change in sigma coeff. named as heptane) as per tutorial " penFOAM Tutorial Implementation of Gasoline Properties in OpenFOAM Library ". the required .so files are created in the $FOAM_USER_LIBBIN" folder but while running the aachenbomb case with sprayFoam Solver, it gives error --> FOAM FATAL ERROR: liquids requested, but object is not allocated From function const Foam::liquidMixtureProperties& Foam::SLGThermo::liquids() const in file SLGThermo/SLGThermo.C at line 125. If compilation is not proper? how to remove this error? Please, any help is appreciated. regards Shailja |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems Installing OF 1.6 32 bit | bucksfan | OpenFOAM Installation | 19 | August 4, 2009 01:36 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 02:32 |
OpenFOAM15 installables are incomplete problem with paraFoam | tryingof | OpenFOAM Bugs | 17 | December 7, 2008 04:41 |
Problem of compilation OF 14Allwmake command not found | erik_d | OpenFOAM Bugs | 13 | September 13, 2008 21:45 |
[OpenFOAM] ParaFoam error message | joey | ParaView | 1 | October 2, 2006 13:28 |