CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Problem Installing OF 1.6 Ubuntu 9.10 (64 bit) - How to use GCC 4.4.1 (http://www.cfd-online.com/Forums/openfoam-installation/69761-problem-installing-1-6-ubuntu-9-10-64-bit-how-use-gcc-4-4-1-a.html)

Future Science November 3, 2009 17:37

Problem Installing OF 1.6 Ubuntu 9.10 (64 bit) - How to use GCC 4.4.1
 
I followed everything as suggested on the OpenFOAM website for the current release (1.6), but I have a problem with the installation.

With order:

I've downloaded:
- OpenFOAM-1.6.General.gtgz
- ThirdParty-1.6.General.gtgz

I am trying to install OpenFOAM 1.6 on Ubuntu 9.10 Karmic Koala, 64 bit version.

When I update the environment variables by sourcing the $HOME/.bashrc file by typing in the terminal:

Code:

* . $HOME/.bashrc
I receive this message:

Code:

Warning in /home/MyUserName/OpenFOAM/OpenFOAM-1.6/etc/settings.sh:
    Cannot find /home/MyUserName/OpenFOAM/ThirdParty-1.6/gcc-4.3.3/platforms/linux64 installation.
    Please install this compiler version or if you wish to use the system compiler,
    change the 'compilerInstall' setting to 'System' in this file

On Karmic the gcc version that I am using is gcc-4.4.1 (which I think is the latest one for the moment): how can I use this compiler to make OpenFOAM work?
What actions/commands should I use?

ICL November 4, 2009 11:55

You have to edit the file etc/settings.sh:
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | System
compilerInstall=System

Ali

Future Science November 4, 2009 18:14

Thank you, I followed your suggestion, I continued with the installation process and I also this the following points:

Code:

mkdir -p $FOAM_RUN/run

cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN

But nothing happened then. No errors, no actions at all.


Then I went a step back and I tried with:
Code:

foamInstallationTest

But I received 2 critical errors:


Code:

Checking basic setup...
-------------------------------------------------------------------------------
Shell:              bash
Host:              mike-laptop
OS:                Linux version 2.6.31-14-generic
-------------------------------------------------------------------------------


Checking main OpenFOAM env variables...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid      Crit
-------------------------------------------------------------------------------
$WM_PROJECT_INST_DIR /home/mike/OpenFOAM                      yes      yes
$WM_PROJECT_USER_DIR /home/mike/OpenFOAM/mike-1.6            yes      no
$WM_THIRD_PARTY_DIR  /home/mike/OpenFOAM/ThirdParty-1.6      yes      yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid Path Crit
-------------------------------------------------------------------------------
$WM_PROJECT_DIR      /home/mike/OpenFOAM/OpenFOAM-1.6        yes  yes  yes

$FOAM_APPBIN        ...1.6/applications/bin/linux64GccDPOpt  no        yes
$FOAM_SITE_APPBIN    ...penFOAM/site/1.6/bin/linux64GccDPOpt  no        no
$FOAM_USER_APPBIN    ...1.6/applications/bin/linux64GccDPOpt  no        no
$WM_DIR              /home/mike/OpenFOAM/OpenFOAM-1.6/wmake  yes  yes  yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid Path Crit
-------------------------------------------------------------------------------
$FOAM_LIBBIN        ...OAM/OpenFOAM-1.6/lib/linux64GccDPOpt  no        yes
$FOAM_SITE_LIBBIN    ...penFOAM/site/1.6/lib/linux64GccDPOpt  no        no
$FOAM_USER_LIBBIN    ...penFOAM/mike-1.6/lib/linux64GccDPOpt  no        no
$MPI_ARCH_PATH      ...nmpi-1.3.3/platforms/linux64GccDPOpt  no        yes
-------------------------------------------------------------------------------


Third party software
-------------------------------------------------------------------------------
Software Version  Location
-------------------------------------------------------------------------------
WARNING: gcc version does not match gcc supplied with this release of OpenFOAM
        Supplied version: 4.3.3
        User version    : 4.4.1
        Minimum required: 4.3.1

gcc      4.4.1   
WARNING:  Conflicting installations:
          OpenFOAM settings        : /bin/gcc
          current path            : /usr/bin/gcc
          CRITICAL ERROR

gzip    1.3.12    /bin/gzip                                               
tar      1.22      /bin/tar                                               
icoFoam         
WARNING:  Conflicting installations:
          OpenFOAM settings        : /home/mike/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/icoFoam
          current path            :
          CRITICAL ERROR

-------------------------------------------------------------------------------


Summary
-------------------------------------------------------------------------------
Base configuration ok.

The foam installation contains 2 critical error(s).

Review the output for warning messages and consult
the installation guide for trouble shooting.

done.


So the base configuration is OK, but if I try with

  • blockMesh
  • icoFoam
  • paraFoam
Nothing happens, then I receive those 2 critical errors running the InstallationTest.

What should I do next?

Thanks in advance!

ICL November 6, 2009 09:38

As you tried to insyall once, you have to first go to OpenFOAM-1.6.x directory and execute wallClean file which can be found on wmake directory, then you have to change what I mentioned and execute ./Allwmake in OpenFOAM-1.6.x directory.

Future Science November 6, 2009 14:51

Quote:

Originally Posted by ICL (Post 235357)
As you tried to insyall once, you have to first go to OpenFOAM-1.6.x directory and execute wallClean file which can be found on wmake directory, then you have to change what I mentioned and execute ./Allwmake in OpenFOAM-1.6.x directory.

I followed what you told me but I still get the same 2 warnings!

PS Should I edit again the etc/settings.sh file? I mean, I've already edited the way you told me, so I didn't touch it again.

flying November 16, 2009 04:12

Did you succeed in doing it? I am also trying to set up openfoam in gcc 4.4.1.

Would you like to give me some tips?

Quote:

Originally Posted by Future Science (Post 235386)
I followed what you told me but I still get the same 2 warnings!

PS Should I edit again the etc/settings.sh file? I mean, I've already edited the way you told me, so I didn't touch it again.


wyldckat November 17, 2009 10:51

gcc-4.4 and above...
 
Greetings to all,

To get gcc-4.4.? working with OpenFOAM, will depend on which version of OpenFOAM you want:
  • 1.6 doesn't build properly, unless you do some tweaking, as shown here;
  • 1.6.x now (since 13/11/2009) builds properly with gcc-4.4.? and above.
After editing settings.sh, as explained in the #2 post, everything should be running well.

In case you want to use a non-system gcc, then after setting up a gcc folder in ThirdParty, you'll need the following steps:
  • Replicate the wmake rules:
    Code:

    cd $WM_PROJECT_DIR/wmake/rules
    cp -r linuxGcc43 linuxGcc44
    cp -r linux64Gcc43 linux64Gcc44

  • Edit $WM_PROJECT_DIR/etc/settings.sh and copy-paste the settings for Gcc43... and maybe remove the references to gmp and mpfr for the new entry;
  • Edit $WM_PROJECT_DIR/etc/bashrc andupdate the reference to Gcc43 to your new setting.
And start a new terminal, and do Allwmake at $WM_PROJECT_DIR anda few of hours later, you have a brand new OpenFOAM :)

Oh, and my advice, add to your bashrc script, this:
Code:

#
# Set the number of cores to build on
#
WM_NCOMPPROCS=1

if [ -r /proc/cpuinfo ]
then
    WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
    [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
fi
export WM_NCOMPPROCS

echo "Building on " $WM_NCOMPPROCS " cores"

It's from the makeGcc script at the ThirdParty folder; it'll set automatically the build options to use the maximum number of cores in your machine.


If you want a makeGcc script for the new gcc, get the makeGcc44 from these patches. I copied makeGcc to makeGcc44 and changed it to work with gcc-4.4.2.

Best regards,
Bruno

al freed November 22, 2009 17:58

I too am having troubles getting OpenFOAM to install on my Kubuntu
09:10 box. I am new to OpenFOAM.

I noticed when reading (somewhere, it seems like a long time ago now)
that vs 1.6 had problems with this linux version, so I went to the following
site and followed their instructions to install 1.6.x

http://openfoamwiki.net/index.php/Howto_install_OpenFOAM-1.6.x_(git_repository_version)

I unpacked without any trouble. At the end of Sec. 1.2 I was told to:

. ~/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc

When I executed this line from a bash shell, no output was
written to the screen, so I'm assuming it worked. Shouldn't
this make an entry in my $HOME/.bashrc file? I see no entry
added. (Forgive me, it has been 20 years since I had to edit
a .bashrc file.)

I move onto Section 1.3 and run

export WM_NCOMPPROCS=2

from my command line, and again nothing. Shouldn't this
change my .bashrc file, too? Nothing.

Moving on, assuming it had worked, I

cd ~/OpenFOAM/
ln -s ThirdParty-1.6 ThirdParty-1.6.x
cd ThirdParty-1.6.x

This all went smoothly, the link points to where it should,
but when I ran the next line

./Allwmake

bash replied with:

bash: ./Allwmake: No such file or directory

I was in the appropriate directory "ThirdParty-1.6.x" when I ran this command.

Any ideas?

Thanks

bookie56 January 11, 2010 06:14

Hi guys and girls:)

I am new in town and need some help......worked with Linux for some time now but not a maths wiz.....

I usually give general support and build computers...etc.

I have a customer who I have built a computer for now but I am not getting any where with openfoam...

I have installed it on Ubunutu Karmic 64 bit and followed the advice I can find but just can't understand the advice from your link...wyldckat


Quote:



To get gcc-4.4.? working with OpenFOAM, will depend on which version of OpenFOAM you want:
  • 1.6 doesn't build properly, unless you do some tweaking, as shown here;
  • 1.6.x now (since 13/11/2009) builds properly with gcc-4.4.? and above.


Sorry, just don't understand what I need to do at the "here" link you provided...can you elaborate for an idiot ..PLEASE!

bookie56

vnpenguin April 11, 2010 10:11

Quote:

Originally Posted by wyldckat (Post 236643)
Greetings to all,

To get gcc-4.4.? working with OpenFOAM, will depend on which version of OpenFOAM you want:
  • 1.6 doesn't build properly, unless you do some tweaking, as shown here;
  • 1.6.x now (since 13/11/2009) builds properly with gcc-4.4.? and above.

That's not true. I can't build OpenFOAM 1.6.x (pull from git repo) with gcc-4.4.3 of Fedora 12.

wyldckat April 11, 2010 15:27

Greetings VNPenguin,

Quote:

Originally Posted by vnpenguin (Post 254175)
That's not true. I can't build OpenFOAM 1.6.x (pull from git repo) with gcc-4.4.3 of Fedora 12.

Are you calling me a liar? Then you better call me a thief too, because I'm going to steal your perception of reality! :D
I'm just kidding ;)

I saw your post the other day "Error compiling 1.6.x on Fedora 12", but since Fedora 12 wasn 't on my list of "conquered Linux distros" and since chandramurthy provided you with a working solution, I let the question pass.
But now that you've stated my statement wasn't true, I had to find the truth and prove my statement :)

So, I downloaded Fedora 12 686 LiveCD and installed it in a virtual machine with 1.5GB of RAM and 20GB of virtual disk. Also, I installed the required packages for OpenFOAM to build properly (I didn't waste time trying to build Paraview), so the following command should do the trick, when signed in as root:
Code:

yum install gcc gcc-c++ binutils-devel flex git-core wget cmake qt4-devel python-devel readline-devel bison
Then I downloaded the ThirdParty-1.6.General.gtgz package and unpacked it in $HOME/OpenFOAM, made a symbolic link to ThirdParty-1.6.x and did a git clone of OpenFOAM-1.6.x.

Then followed the instruction given in this thread's post #2:
Quote:

Originally Posted by ICL (Post 235106)
You have to edit the file etc/settings.sh:
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | System
compilerInstall=System

I also edited OpenFOAM-1.6.x/etc/bashrc and changed to 32 bit, since I used a Fedora 686. Oh, and I also did that WM_NCOMPPROCS trick I posted in post #7.

After sourcing the bashrc file, I ran ./Allwmake at OpenFOAM-1.6.x and saw after a while that there was a strange issue going around. Searched in google for "*** missing separator OpenFOAM" and landed on this page: wmake error: file 'Make/linux64Gcc44DPOpt/objectFiles' could not be created
After reading through the thread, and jumped to the other threads therein shown, thus leading me to editing the file OpenFOAM-1.6.x/wmake/rules/linuxGcc/general as stated in "OpenFOAM-1.5-dev SVN15xx with gcc-4.4.2":
Quote:

Originally Posted by philippose (Post 241685)
Code:

CPP        = /lib/cpp $(GFLAGS) -P  <-- Changed line
LD        = ld -melf_i386

PROJECT_LIBS = -l$(WM_PROJECT) -ldl

include $(GENERAL_RULES)/standard

include $(RULES)/X
include $(RULES)/c
include $(RULES)/c++


Well, technically I just added the "-P" argument to the CPP line, since the rest is OK as it is.

Now, since I had let Allwmake run for a while, I had to make a cleanup of the stuff that had already been tried to built but failed, due to the same issue stated on the latest thread I mentioned. So, to make a good cleanup, I ran the following commands, at the folder OpenFOAM-1.6.x:
Code:

wcleanAll
rm -rf `find $WM_THIRD_PARTY_DIR/* -name linuxGccDPOpt* | grep -v openmpi`

The first line takes out the stuff that had been built in the OpenFOAM-1.6.x folder; the second line takes out the stuff that had been built in the ThirdParty-1.6.x folder, except OpenMPI that had built well without issues, so we can keep it.

And so, running ./Allwmake now builds the whole OpenFOAM package, including the Third Party libraries that were missing :) As I said before, I left out Paraview, but it should build OK too :)

Therefore, I can only assume that these steps should also apply to Fedora 12 x86_64! Thus proving that I spoke the truth :cool: You spoke the truth too, but if you had posted the full build log, we might have noticed it earlier ;)

TIPS:
  • To make a full build log, do Allwmake as so:
    Code:

    time ./Allwmake >make.log 2>&1
    The time command shows how long it took to run Allwmake at the end :)
  • If you also want to keep timing logged at the end, you'll have to run like this:
    Code:

    bash -c "time ./Allwmake >make.log 2>&1" 2>&1 | tee -a make.log
    If you want to monitor the progress of the build, open a new terminal, go to the OpenFOAM-1.6.x folder and run:
    Code:

    tail -F make.log
  • If you want to monitor and keep a log on the same terminal, run:
    Code:

    bash -c "time ./Allwmake 2>&1 | tee make.log" 2>&1 | tee -a make.log
I hope I didn't forget anything :(

Best regards,
Bruno

vnpenguin April 11, 2010 15:39

Quote:

Originally Posted by wyldckat (Post 254189)
Greetings VNPenguin,


Are you calling me a liar? Then you better call me a thief too, because I'm going to steal your perception of reality! :D
I'm just kidding ;)

Hi Bruno,
Sorry for my bad english. I mean "I can not build OpenFOAM 1.6.x with Fedora compiler" only. I don't want to say about "liar" at all. Sorry!

Thank you for your explains. I'll try it soon on my Fedora box.

Cheers,

wyldckat April 11, 2010 16:00

Quote:

Originally Posted by vnpenguin (Post 254191)
Hi Bruno,
Sorry for my bad english. I mean "I can not build OpenFOAM 1.6.x with Fedora compiler" only. I don't want to say about "liar" at all. Sorry!

Thank you for your explains. I'll try it soon on my Fedora box.

Cheers,

Don't worry, I know you didn't mean to call me a liar :) I just pretended to take it the wrong way :D If by any chance it doesn't work in your box, don't forget to tell us!

By the way, I'm happy to report that the building process just finished with no errors and it took (with dual VM cores):
Code:

real    129m32.075s
user    24m44.434s
sys    29m2.272s

I used a 686 VM, because a x86_64 VM has taken me in the past 2-3 times longer that 686 :(

Best regards,
Bruno

vnpenguin April 12, 2010 12:26

Hi Bruno,
By following your thread, I can build 1.6.x with Fedora gcc compiler now. It's super :)

Thank you,

wyldckat April 12, 2010 12:45

Greetings VNPenguin,

I'm glad to know that it worked :)

And with this, Fedora is now on my virtual "conquered that Linux" list :D

Best regards,
Bruno

bunni June 4, 2010 12:21

1.6-x still not working
 
Hi Bruno,

You pointed me here from another thread. I was having problems making interFoam work in parallel (for one case. It had worked fine - up to 24 procs for previous cases). You suggested I download the dev version, and pointed me to this thread. So. I'm on Fed 12, 64-bit. I've tried on two different machines. :)

I've followed your instructions, changing the compiler to system, and adding the -P, and here are the errors I'm getting (I get quite a lot of these):

make[1]: *** [surfaceRedistributePar] Error 1
linux64GccDPOpt/options:6: *** missing separator. Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created
make[1]: *** [surfaceRefineRedGreen] Error 1
linux64GccDPOpt/options:6: *** missing separator. Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created
make[1]: *** [surfaceSmooth] Error 1
linux64GccDPOpt/options:6: *** missing separator. Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created
make[1]: *** [surfaceSplitByPatch] Error 1
linux64GccDPOpt/options:6: *** missing separator. Stop.


Looking at some of the options files, I see things like:

# 1 "options"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "options"
EXE_INC =

-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/dynamicMesh/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude
(.....)

which seems like it would be the origin of the missing separator error, and that the -P option (in CPP) isn't being used.

So, any idea on how to fix this?

Thanks very much.

wyldckat June 4, 2010 12:36

Hi Bunni,

Quote:

Originally Posted by bunni (Post 261716)
which seems like it would be the origin of the missing separator error, and that the -P option (in CPP) isn't being used.

Which file did you change for adding the -P argument? This one:
Code:

OpenFOAM-1.6.x/wmake/rules/linuxGcc/general
Or this one:
Code:

OpenFOAM-1.6.x/wmake/rules/linux64Gcc/general
If you change the first one... well, you should have changed the second one! ;)

If you did change the second one... then I'm stumped :( If it was the second one you changed, then we'lll have to try and isolate the problem step by step :(

Best regards,
Bruno

bunni June 4, 2010 16:09

it did compile, it did not solve the problem. I'll post in the other thread to be more on topic.

jgpeder June 17, 2010 06:53

Hi,
I'm also having problems installing OpenFOAM-1.6.x. I'm using Ubuntu Lucid Lynx 64 bit.
I've tried to change the files etc/settings.sh and OpenFOAM-1.6.x/wmake/rules/linux64Gcc/general as described above, but it still doesn't install properly.

Running the foamInstallationTest I get the following:

Code:

Checking basic setup...
-------------------------------------------------------------------------------
Shell:              bash
Host:              jesper
OS:                Linux version 2.6.32-22-generic
-------------------------------------------------------------------------------


Checking main OpenFOAM env variables...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid      Crit
-------------------------------------------------------------------------------
$WM_PROJECT_INST_DIR /home/jesper/OpenFOAM                    yes      yes
$WM_PROJECT_USER_DIR /home/jesper/OpenFOAM/jesper-1.6.x      no        no
$WM_THIRD_PARTY_DIR  /home/jesper/OpenFOAM/ThirdParty-1.6.x  yes      yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid Path Crit
-------------------------------------------------------------------------------
$WM_PROJECT_DIR      /home/jesper/OpenFOAM/OpenFOAM-1.6.x    yes  yes  yes

$FOAM_APPBIN        ...6.x/applications/bin/linux64GccDPOpt  no        yes
$FOAM_SITE_APPBIN    ...nFOAM/site/1.6.x/bin/linux64GccDPOpt  no        no
$FOAM_USER_APPBIN    ...6.x/applications/bin/linux64GccDPOpt  no        no
$WM_DIR              ...jesper/OpenFOAM/OpenFOAM-1.6.x/wmake  yes  yes  yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory                Valid Path Crit
-------------------------------------------------------------------------------
$FOAM_LIBBIN        ...M/OpenFOAM-1.6.x/lib/linux64GccDPOpt  yes  yes  yes
$FOAM_SITE_LIBBIN    ...nFOAM/site/1.6.x/lib/linux64GccDPOpt  no        no
$FOAM_USER_LIBBIN    ...OAM/jesper-1.6.x/lib/linux64GccDPOpt  no        no
$MPI_ARCH_PATH      ...nmpi-1.3.3/platforms/linux64GccDPOpt  no        yes
-------------------------------------------------------------------------------


Third party software
-------------------------------------------------------------------------------
Software Version  Location
-------------------------------------------------------------------------------
WARNING: gcc version does not match gcc supplied with this release of OpenFOAM
        Supplied version: 4.3.3
        User version    : 4.4.3
        Minimum required: 4.3.1

gcc      4.4.3   
WARNING:  Conflicting installations:
          OpenFOAM settings        : /home/jesper/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux64/bin/gcc
          current path            : /usr/bin/gcc
          CRITICAL ERROR

gzip    1.3.12    /bin/gzip                                               
tar      1.22      /bin/tar                                               
icoFoam         
WARNING:  Conflicting installations:
          OpenFOAM settings        : /home/jesper/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/icoFoam
          current path            :
          CRITICAL ERROR

-------------------------------------------------------------------------------


Summary
-------------------------------------------------------------------------------
Base configuration ok.

The foam installation contains 2 critical error(s).

Review the output for warning messages and consult
the installation guide for trouble shooting.

done.

Can you help me?

Thanks
-Jesper

wyldckat June 19, 2010 05:33

Greetings Jesper,

Uhm... the -P argument change in the rule files is for Fedora and similar distributions. And if you had followed the instructions in post #11 you might have managed to build OpenFOAM in Ubuntu while using instructions for Fedora ;)

As for installing OpenFOAM 1.6.x in Ubuntu 10.04, might I suggest the install script I've been helping out with: http://code.google.com/p/openfoam-ubuntu/
The support thread for it is this one: http://www.cfd-online.com/Forums/ope...-ubuntu-5.html

Best regards,
Bruno


All times are GMT -4. The time now is 04:45.