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

OpenFOAM-1.6 install cookbook

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 28, 2009, 14:58
Default Script Bug "Bison"
  #221
New Member
 
Juan Marcelo Gimenez
Join Date: Dec 2009
Location: Santa Fe, Argentina
Posts: 12
Rep Power: 17
nisi is on a distinguished road
Hi Mad:
When I tried to compile OF with your Script (in Ubuntu 9.04 32 bits recently installed), I had one "critical error":

icoFoam
WARNING: Conflicting installations:
OpenFOAM settings : /home/aurel/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/icoFoam
current path :
CRITICAL ERROR


In "make.log", the source of the errors seemed to be lack of "Bison"'s lexier:

/bin/sh: bison: not found
mv: no se puede efectuar `stat' sobre «y.tab.c»: No existe el fichero ó directorio
mv: no se puede efectuar `stat' sobre «y.tab.h»: No existe el fichero ó directorio
gcc: Make/linuxGccDPDebug/parser_yy.c: No existe el fichero ó directorio


and after this, in almost all aplications had compilation errors, for example:

/usr/bin/ld: cannot find -lfiniteVolume
collect2: ld returned 1 exit status


Later, I installed Bison with

$ sudo apt-get install Bison

And, I recompile with ./Allwmake

Now, I don't have any critical errors.
I propose to include in the script the package "Bison" in the apt lines.
Sorry for my bad english.

Regards, Juan
nisi is offline   Reply With Quote

Old   December 29, 2009, 00:28
Default offline openfoam 1.6 installation
  #222
jsm
Senior Member
 
JSM
Join Date: Mar 2009
Location: India
Posts: 192
Rep Power: 20
jsm is on a distinguished road
Hi Mads Reck,

I am new to linux (ubuntu 9.1) and openfoam. I successfully installed unbuntu 9.1 in my system. I want to install openfoam 1.6. Actually I downloaded 32bit openfoam 1.6 binary files from other system.(OpenFOAM-1.6.General.gtgz, OpenFOAM-1.6.linuxGccDPOpt.gtgz, ThirdParty-1.6.General.gtgz, ThirdParty-1.6.linuxGcc.gtgz )

I could not access internet right now from my computer. So could give me script file to use these downloaded binary files or procedure to follow manually. It will be great help to me.
__________________
With regards,
JSM
jsm is offline   Reply With Quote

Old   January 4, 2010, 00:16
Default gcc err with lex.yy.c
  #223
New Member
 
Brian C
Join Date: Dec 2009
Posts: 9
Rep Power: 17
Caltech Brian is on a distinguished road
Hi,
I really don't think the compiler error with gcc is specifically a problem with gcc. The version I, and others, are using matches the version that several others (including MadsR) have recommended.

lex.yy.c is generated by flex via the command: 'flex wmkdep.l'. flex is apparently a lexical analyzer. It seems odd that it takes no other argument than wmkdep.l and yet it generates compilable code on one machine and uncompilable code on another.

Does anybody know what settings (logicals, variables, paths, permissions, ...) are required to get the flex to run properly? Since I am using the script generated by MadsR, I should have the same version of flex as everybody else.

Can somebody that has compiled OpenFOAM for Ubuntu 9.04 (32 bit, on Intel platform) please contact me and we can check some additional details to see where I went off track?

Brian
Caltech Brian is offline   Reply With Quote

Old   January 4, 2010, 00:45
Default flex vs. flex-old
  #224
New Member
 
Brian C
Join Date: Dec 2009
Posts: 9
Rep Power: 17
Caltech Brian is on a distinguished road
MadsR (et.al.),

After reviewing other threads, it seems that there are at least two versions of flex. I got flex-old just now (which removed flex) and tried a one-liner to create lex.yy.c and then compile with gcc. It complied!?!

Is it possible that your script grabs the wrong version of flex to create lex.yy.c ? Should it be getting flex-old and not flex?

I am re-running your install script without the 'apt-get install' lines now that I have flex-old. I'll report on what I get.

Brian
Caltech Brian is offline   Reply With Quote

Old   January 4, 2010, 01:16
Default flex vs. flex-old [same result]
  #225
New Member
 
Brian C
Join Date: Dec 2009
Posts: 9
Rep Power: 17
Caltech Brian is on a distinguished road
Hi,

Same result: compiler error.

gcc -m32 -Wall -O3 -fPIC dirToString.c -o /home/brian/OpenFOAM/OpenFOAM-1.6.x
/wmake/bin/linuxGcc/dirToString
flex wmkdep.l
gcc -m32 -Wall -O3 -fPIC lex.yy.c -o /home/brian/OpenFOAM/OpenFOAM-1.6.x/wmak
e/bin/linuxGcc/wmkdep
lex.yy.c:1287: warning: ‘yyunput’ defined but not used
lex.yy.c:1329: warning: ‘input’ defined but not used
wmkdep.l: In function ‘yy_scan_bytes’:
wmkdep.l:462: internal compiler error: Illegal instruction


Back to square one...

Brian
Caltech Brian is offline   Reply With Quote

Old   January 4, 2010, 03:02
Default
  #226
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 17
Wolle is on a distinguished road
Hi all,

Quote:
Originally Posted by Caltech Brian View Post
flex is apparently a lexical analyzer
That's why I had locales settings in mind first, but as you state, your machine is set to English, I think we can check that off.

What I found:
Quote:
Three routines are available for scanning from in-memorybuffers rather than files: yy_scan_string(), yy_scan_bytes(), and yy_scan_buffer(). See the discussion of them below in the section Multiple Input Buffers.
So maybe this is, why somebody suggested memory damage as a probable cause. As I stated before, I carried out a complete Memtest86+ memory test run just a few hours prior to the problem occurrence with no errors showing up. Also, no other programs complain about memory issues.

Further:
Quote:
A number of options are available for lint purists who want to suppress the appearance of unneeded routines in the generated scanner. Each of the following, if unset (e.g., %option nounput ), results in the corresponding routine not appearing in the generated scanner:

input, unput
yy_push_state, yy_pop_state, yy_top_state
yy_scan_buffer, yy_scan_bytes, yy_scan_string
So maybe one could use an option to avoid the usage of yy_scan_bytes (where the error seems to occur) by modifying the makefile?

Cheers
Wolle

P.S.: Source of the quotations: http://dinosaur.compilertools.net/flex/manpage.html
Wolle is offline   Reply With Quote

Old   January 7, 2010, 04:24
Default
  #227
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 17
Wolle is on a distinguished road
Hi all!

I finally succeeded in compiling OpenFOAM-1.6.x!

This is, what I did:

1. Started with a clean environment, deleted all old stuff from former attempts.

2. Downloaded the ThirdParty stuff and performed a git clone for the OF sources as in the installation script. Unpacked the ThirdParty stuff.

3. Installed several packages:


Code:
build-essential cmake firebird2-dev firebird2.0-dev flex libcupsys2-dev libdbus-1-dev libfontconfig1-dev libfreetype6-dev libglib2.0-dev libglu1-mesa-dev libiodbc2-dev libjpeg62-dev libmng-dev libmpfr1 libmpfr1ldbl libmysqlclient15-dev libpng12-dev libpq-dev libsm-dev libsqlite0-dev libssl-dev libtiff4-dev libx11-dev libxcursor-dev libxfixes-dev libxrandr-dev libxrender-dev libxt-dev mesa-common-dev x11proto-xinerama-dev libxinerama-dev libaudio-dev
(found those in the forum, threads concerning OF-1.3, -1.4, -1.5 builds (sometimes -dev or .x versions))

Code:
binutils-dev
(in order to avoid a compilation error "cannot find -liberty" by installing the libiberty library, which is included in binutils-dev)

Code:
byacc bison texinfo
(advice given here: http://www.cfd-online.com/Forums/ope...tml#post241444 )

I have to admit, that I don't know, which packages are essential in order to compile OF-1.6.x, but at least it works this way! Most of the packages (though not all) have been installed on my system by default by the way...

4. Set up ~/OpenFOAM/OpenFOAM-1.6.x/etc/settings.sh with compilerInstall=System

5. Source OF-bashrc: $ source ~/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc

6. export WM_NCOMPPROCS=1 (this is the number of used processor cores for compilation - as I have only a single core processor... might be obsolete)

7. Compile the ThirdParty stuff!!! This very step seems to be the solution of the "internal compiler error issue" to me!!! Do it by an ./Allwmake in the ThridParty directory. Sometimes, the compilation might have to be executed several times, as some libraries seem not to be build at the first attempt.

8. Source OF-bashrc again in order to update paths that might have been changed! (See step 5)

9. Compile OF by an ./Allwmake in the OF directory. Might also have to be executed several times (see step 7).

(found all these steps here: http://openfoamwiki.net/index.php/In...git_repository (1.1.1, 1.1.2 and 1.1.3))

On my system, the compilation failed first, because a cmake process of PV3Foam(whatever) complained that "command not found: /bin/c++", but wants to use C++ compiler as a result of VTK compiled with c++. I found the c++ compiler in /usr/bin/c++ and simply created a symlink /bin/c++ which points to that /usr/bin/c++. I know, this is something like a brute force method and might not the proper way to go about things or might seem to be not very sporting.... but I simply didn't know better and the result was a compilation run without complaints or errors. If somebody with more Linux experience than me can give me some advice how to do it "correctly", I would appreciate any enlightening comment.

Cheers
Wolle
Wolle is offline   Reply With Quote

Old   January 7, 2010, 05:02
Default
  #228
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
Phew, a lot of stuff is going on in this thread, that's great!

I am not sure how to adapt the script to take care of the issues which has been brought up here, though. It still works for quite a few systems, but not for others. It seems that there could be an issue with flex and language settings (?). And maybe bison needs to be included.

Wolle, you seem to install a bunch of packages which I have no idea of :-) are all those really needed for OpenFOAM? I mean there is stuff in there ranging from mysql clients to audio.

/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   January 7, 2010, 05:58
Default
  #229
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 17
Wolle is on a distinguished road
Quote:
Originally Posted by MadsR View Post
Wolle, you seem to install a bunch of packages which I have no idea of :-) are all those really needed for OpenFOAM? I mean there is stuff in there ranging from mysql clients to audio.
Hi Mads,

neither have I an idea of those packages. Most of them (also mysql and audio stuff!) have already been included in my standard Xubuntu 9.04-32 installation. I know this is not a gentleman-like method at all, but it works.

As stated, I got these information from different threads dealing with the compilation of former versions. Looking up those old threads and learning about compilation errors seemed the only way to find a solution to me. Sadly it seems as if I did this to no avail for me, as I personally have to focus on CAD instead of CFD at the moment.... sadly....

Cheers
Wolle
Wolle is offline   Reply With Quote

Old   January 7, 2010, 11:41
Default Good old package hell...
  #230
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Mads and Wolle (and to all others as well ),

As far as my experience goes, let me breakdown the package list by relevance:
  • Essential (to include paraview):
    Code:
    build-essential cmake flex bison
  • Those required for using the system's gcc:
    Code:
    binutils-dev
  • Those also required for compiling gcc:
    Code:
    byacc texinfo m4
    Actually, I'm not sure if "byacc" isn't needed as an essential...
  • When using 64bit Linux, you might also want this for building 32bit binaries:
    Code:
    gcc-multilib
    And it is valid for both gcc modes, system or ThirdParty OpenFOAM's. On this post, I also mention how to compile ThirdParty gcc without needing the multilib, including a modified makeGcc script.
  • Those that also might be necessary for Paraview and system's gcc, but I'm not sure:
    Code:
    libglib2.0-dev libglu1-mesa-dev libiodbc2-dev libjpeg62-dev libmng-dev libmpfr1 libmpfr1ldbl libmysqlclient15-dev libpng12-dev libpq-dev libsqlite0-dev libtiff4-dev mesa-common-dev
    The ones that start with "libx*" might be essential in some cases for Paraview, but it is more likely necessary for the old and discontinued FoamX. The "*mesa*" ones are great for multi-machine Paraview'ing, because the mesa driver allows the use of graphic-less card machines
    Sql can also be used by Paraview... png and jpeg could be system version instead of vtk version for Paraview...

Mads, I remember reading you did a clean install in Ubuntu 9.10 64bit, and that your script worked... but you still had to do some tweaks I mentioned in an earlier post... So, your cookbook isn't totally self-sufficient by your own experience

My advice - keep the cookbook in 2 separate scripts: one for administrative/sudo installation; another for making a clean OpenFOAM build. The administrative one could then just be one for each Linux distro, including those Linux library tweaks. Then the other one would only need to be changed in the next OpenFOAM master version.

And I could almost bet that if you did
Code:
apt-get update
once before installing the packages, then only one line for installing would be required

edit: Wolle, i've re-read or previous post:
Quote:
On my system, the compilation failed first, because a cmake process of PV3Foam(whatever) complained that "command not found: /bin/c++", but wants to use C++ compiler as a result of VTK compiled with c++. I found the c++ compiler in /usr/bin/c++ and simply created a symlink /bin/c++ which points to that /usr/bin/c++. I know, this is something like a brute force method and might not the proper way to go about things or might seem to be not very sporting.... but I simply didn't know better and the result was a compilation run without complaints or errors. If somebody with more Linux experience than me can give me some advice how to do it "correctly", I would appreciate any enlightening comment.
Actually creating a symbolic link to the c++ executable is more common than you might think And for those who don't understand how the devilish simbolic linking works, here's how for the c++ application:
Code:
ln -s /usr/bin/c++ /bin/c++
The mnemonic for "ln -s": works like "cp", but the first one doesn't have to be an existing file or folder, or can just be relative to the targeted link!

Best regards,
Bruno

Last edited by wyldckat; January 7, 2010 at 11:49. Reason: missing explaining something....
wyldckat is offline   Reply With Quote

Old   January 8, 2010, 08:53
Default
  #231
Member
 
83_Ale_83's Avatar
 
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17
83_Ale_83 is on a distinguished road
Hi to everybody,
I have just installed openFoam on Ubuntu 9.10 32bit and I have made a little chenge to MadsR script:

Original:
Quote:
cd ~/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux/lib64
This command gives an error "lib64 no such file or directory"

I have changed it in:
Quote:
cd ~/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux/lib
This may be helpfull.
__________________

83_Ale_83 is offline   Reply With Quote

Old   January 9, 2010, 10:36
Default
  #232
Member
 
Join Date: Mar 2009
Posts: 36
Rep Power: 17
Amiga500 is on a distinguished road
Thank you for making the script available MadsR... it worked flawlessly on Ubuntu 9.10 x64.

Amiga500 is offline   Reply With Quote

Old   January 9, 2010, 13:02
Default
  #233
Member
 
83_Ale_83's Avatar
 
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17
83_Ale_83 is on a distinguished road
MadsR, your script works great also on Linux Mint 8 32bit with the correction in my previous post
__________________

83_Ale_83 is offline   Reply With Quote

Old   January 11, 2010, 04:50
Default
  #234
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
@bruno, nice review of libs. It seems that some (including me) are able to run the script without the load of libs you are suggesting. On the other hand some needs install of those libs. I guess I could add them to the script, as the surely do no harm :-)

@brendan+Alessandro, great it worked. Alessandro, you are absolutely right, the "lib64" should be "lib", I've corrected it right away.

@Wolle, CAD instead of CFD?? I am sorry to hear that :-) I hope it will change sooner than later, keep up the good spirit :-)

/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   January 11, 2010, 08:20
Default
  #235
New Member
 
Join Date: Jan 2010
Posts: 28
Rep Power: 16
bookie56 is on a distinguished road
Hi MadsR

I have just been given a link to your thread by wyldckat but I can't use your links?

Can you tell me why your links are not working? I really need some help with Open FOAM on Ubuntu Karmic.

bookie56


bookie56 is offline   Reply With Quote

Old   January 11, 2010, 08:25
Default
  #236
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hello Mads and bookie56,

Try this: http://hvirvel.com/OF/
Mads server must've just upgraded to PHP

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 11, 2010, 08:26
Default
  #237
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 17
Wolle is on a distinguished road
Hi all,

Quote:
Originally Posted by MadsR View Post
@bruno, nice review of libs. It seems that some (including me) are able to run the script without the load of libs you are suggesting. On the other hand some needs install of those libs. I guess I could add them to the script, as the surely do no harm :-)
I suppose, most (~90%) of them are already installed on most systems. And I agree: installing them will most likely do no harm.

@brendan+Alessandro, great it worked. Alessandro, you are absolutely right, the "lib64" should be "lib", I've corrected it right away.

Quote:
Originally Posted by MadsR View Post
@Wolle, CAD instead of CFD?? I am sorry to hear that :-) I hope it will change sooner than later, keep up the good spirit :-)
Well yes. Design/development is simply my main task. At some point this leads to CFD as well... I'll certainly stick to CFD as well, as I suppose we wont get all the answers we need for our project without a simulation...

Cheers
Wolle
Wolle is offline   Reply With Quote

Old   January 11, 2010, 09:13
Default
  #238
New Member
 
Join Date: Jan 2010
Posts: 28
Rep Power: 16
bookie56 is on a distinguished road
Hi guys

Got to say I am impressed with the service around here.....

Thanks wyldckat for the heads up.

Up to my eyes in trying to sort out building computers and offering finans options for my customers, so that more buy home built computers....

I will be in touch...

Thanks again!!

bookie56
bookie56 is offline   Reply With Quote

Old   January 11, 2010, 11:13
Default
  #239
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
Thanks Bookie for pointing that out and Bruno for helping. Yes, I've just changed it to PHP and forgot to update the link in my signature.

/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   January 12, 2010, 09:28
Default
  #240
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 17
CedricVH is on a distinguished road
Hello Mads,

The reason why your script gives "gcc version" errors sometimes is because your script has been tested on a fresh Ubuntu 9.10 installation. However, when the installation has already been updated, it does not work due to a newer version of libstdc++.so in the /usr/bin folder.

In your script, the following softlink is created:
Code:
ln -s /usr/lib/libstdc++.so.6.0.10 libstdc++.so.6
However, libstdc++.so.6.0.10 does not exist when Ubuntu has been updated, but is replaced by libstdc++.so.6.0.13 so the command has to be:
Code:
ln -s /usr/lib/libstdc++.so.6.0.13 libstdc++.so.6
We should think about a generic solution.

Last edited by CedricVH; January 12, 2010 at 13:12.
CedricVH is offline   Reply With Quote

Reply


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
install OpenFoam 1.6 by building source: how? niudie OpenFOAM Installation 13 April 26, 2011 01:48
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43
install openfoam 1.6 on opensuse 11.0 andresbh OpenFOAM Installation 8 September 30, 2009 01:48
Install openFOAM 1.6 on debian 32bit - blockMesh: command not found fossy OpenFOAM Installation 1 August 28, 2009 05:06
Install of OpenFOAM 1.6 Error 1 Error 2 & run tutorial potac OpenFOAM Installation 3 August 27, 2009 10:04


All times are GMT -4. The time now is 03:57.