CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

OpenFOAM build from source instructions

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2006, 12:48
Default I can't seem to find straight
  #1
Member
 
Terry Jordan
Join Date: Mar 2009
Posts: 95
Rep Power: 17
tj22 is on a distinguished road
I can't seem to find straight forward instructions on how to build OpenFoam. I want to build it I dont want binaries. So is it possible for someone to point me to or give me some quick instructions on how to build? how about what to download, where to extract, what environment variables to set, what files to source, what command to run to launch the build, etc.

I have tried it on my own with no luck so far with getting through complete build.
tj22 is offline   Reply With Quote

Old   April 6, 2006, 15:20
Default I don't want to be rude, but h
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
I don't want to be rude, but have you looked at the README-file (Section "4. Building from Sources (Optional)" )?

Anything more specific than that is very hard to accomplish without more detailed information about your OS, the compiler you use and the problems you are facing.

If you provide that kind of information people here are surprisingly quick with help.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 6, 2006, 16:16
Default Here goes: OS: Suse 10.0 gc
  #3
Member
 
Terry Jordan
Join Date: Mar 2009
Posts: 95
Rep Power: 17
tj22 is on a distinguished road
Here goes:
OS: Suse 10.0
gcc: 4.0.2 (included in distro)
OpenFOAM-1.3(src) in /$HOME/OpenFOAM/OpenFOAM-1.3

I looked in the readme and it seems a little confusing. It doesnt say what WM_PROJECT_INST_DIR or WM_PROJECT_DIR should be, and it looks as if the .bashrc file is based on those env vars so if I just source .bashrc the paths are wrong.

So I guessed /$HOME/OpenFOAM/OpenFOAM-1.3 to be WM_PROJECT_DIR. and if I source the .bashrc still the env vars are not quite correct.

So I located this page
http://www.opencfd.co.uk/openfoam/doc/userse5.html
and set the environment variables as described and it seems to be building, sort of. I am frequently getting these warnings(where XXXX is the path of my home dir):

"/XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/General/java:5: /XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/General/java: Too many open files
/XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxGcc4/c:7: /XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxGcc4/c: Too many open files
/XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxGcc4/c++:7: /XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxGcc4/c++: Too many open files
/XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxGcc4/c++:7: /XXXX/OpenFOAM/OpenFOAM-1.3/wmake/rules/linuxGcc4/c++: Too many open files"

and if I let it play out I get alot of errors exactly like this for many files:
"SOURCE_DIR=.
SOURCE=icoDyMFoam.C ; g++ -m32 -Dlinux -D -Wall -W -Wno-unused-parameter -Wold-style-cast -DNoRepository -ftemplate-depth-30 -I/XXXX/OpenFOAM/OpenFOAM-1.3/src/dynamicFvMesh/lnInclude -I/XXXX/OpenFOAM/OpenFOAM-1.3/src/dynamicMesh/lnInclude -I/XXXX/OpenFOAM/OpenFOAM-1.3/src/meshTools/lnInclude -I/XXXX/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/XXXX/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread -c $SOURCE -o Make/linuxGcc4/icoDyMFoam.o
<command>:1:1: error: macro names must be identifiers
make: *** [Make/linuxGcc4/icoDyMFoam.o] Error 1
+ wmake nonNewtonianIcoFoam"

Any ideas?
tj22 is offline   Reply With Quote

Old   April 6, 2006, 16:46
Default OK. Now we're in business. Yo
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
OK. Now we're in business.
Your guess for $WM_PROJECT_DIR is right (otherwise you wouldn't have gotten that far). $WM_PROJECT_INST_DIR is the parent directory.
(BTW: both variables are set in the file OpenFOAM-1.2/.OpenFOAM-1.2/bashrc which in turn sources OpenFOAM-1.2/.bashrc - try sourcing that one)

The four error messages about the open files are a classic example of an unterminated recursion:
Line 5 of wmake/rules/General/java reads:

include $(GENERAL_RULES)/java$(WM_JAVAC_OPTION)

if WM_JAVAC_OPTION is not set the line reads

include $(GENERAL_RULES)/java

which makes the file include itself (instead of for instance javaOpt) and so on. After some time make gets tired of that game and throws the above message.
Solution: make sure WM_JAVAC_OPTION is set.

The other four lines fail for similar causes. The exact solution for these is left to the reader as an exercise (I ALWAYS wanted to write that sentence ;) )

The other error leaves me a bit mystified, but maybe it will go away when you fix the first one.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 6, 2006, 16:48
Default Are you sourcing the .bashrc f
  #5
brooksmoses
Guest
 
Posts: n/a
Are you sourcing the .bashrc file in $HOME/OpenFOAM/OpenFOAM-1.3? If so, that may be the problem.

You should be sourcing the bashrc (no leading dot) file in $HOME/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3. It sets up things like WM_PROJECT_DIR, and you can edit it if they're not being set up correctly.
It then sources the $HOME/OpenFOAM/OpenFOAM-1.3/.bashrc file for you, so you never need to access that directly.
  Reply With Quote

Old   April 6, 2006, 17:04
Default That is the problem I am sourc
  #6
Member
 
Terry Jordan
Join Date: Mar 2009
Posts: 95
Rep Power: 17
tj22 is on a distinguished road
That is the problem I am sourcing the .bashrc in /$home/OpenFOAM/OpenFOAM-1.3. I guess I missed this in the README. Anyhow I set them up by hand prior to your posts and it seems to be building fine. I did dig down and found both this:

WM_JAVAC_OPTION & WM_COMPILER_OPTION missing

and also the
WM_PRECISION_OPTION which I guessed was SP or DP from looking at scalar.H

so I next time I should source $HOME/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/bashrc and that should setup everything?

Thanks.
tj22 is offline   Reply With Quote

Old   April 6, 2006, 17:14
Default Yes, that should set up everyt
  #7
brooksmoses
Guest
 
Posts: n/a
Yes, that should set up everything!

Also, it's the file to edit if you want to change some of the settings (like the WM_PRECISION_OPTION, for instance).
  Reply With Quote

Old   April 6, 2006, 17:15
Default Yep. Just uncomment the alt
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Yep.

Just uncomment the alternative for for instance WM_COMPILE_OPTION of your choice and everything SHOULD be alright.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM 15 icc build mschoenberg OpenFOAM Installation 4 October 2, 2008 01:09
How can I build OpenFOAM in cygwin joywe OpenFOAM Installation 10 September 12, 2008 10:39
Build OpenFOAM on MacOSX Mauro Augelli (Augelli) OpenFOAM Installation 101 July 21, 2008 07:42
OpenFOAM 14 Parallel build mplongjr OpenFOAM Installation 3 May 15, 2007 04:32
Build OpenFOAM on Tru64 francois OpenFOAM Installation 18 April 4, 2006 06:45


All times are GMT -4. The time now is 06:17.