CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Installation Procedure of OF220 on Ubuntu 10.04LTS (http://www.cfd-online.com/Forums/openfoam-installation/114311-installation-procedure-of220-ubuntu-10-04lts.html)

ngj March 8, 2013 15:52

Installation Procedure of OF220 on Ubuntu 10.04LTS
 
Dear all,

I have just been able to successfully compile OF220 on Ubuntu 10.04 LTS. My steps are given below. It should be noted that I previously have compiled other versions of OF on this machine, so I might have missed the need of certain dependencies.

Furthermore, I have not compiled neither QT nor Paraview.

0. Download the source code from
Code:

http://www.openfoam.org/download/source.php
and unpack the two tarred files in ~/OpenFOAM by

Code:

tar -xzf OpenFOAM-2.2.0.tgz
tar -xzf ThirdParty-2.2.0.tgz

1. Go to the file

Code:

~/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
and change the line 62 to the following

Code:

foamCompiler=ThirdParty
Then go to the file

Code:

~/OpenFOAM/OpenFOAM-2.2.0/etc/config/settings.sh
and change the line 244 to

Code:

gcc_version=gcc-4.6.2
2. Go to the ThirdParty-2.2.0 directory and obtain the needed third party source using:

Code:

svn co svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch gcc-4.6.2
and download additional source code by putting the following lines directly into the browser-field (also see ThirdParty-2.2.0/README.org):

Code:

ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.4.tar.bz2
ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.0.tar.bz2
http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.3.tar.bz2
https://gforge.inria.fr/frs/download.php/31831/scotch_6.0.0.tar.gz

and extract these files one at the time using the following lines in the command line:

Code:

tar jxf openmpi-1.6.3.tar.bz2
tar jxf mpfr-3.1.0.tar.bz2
tar jxf gmp-5.0.4.tar.bz2
tar -xzf mpc-0.9.tar.gz
tar -xzf scotch_6.0.0.tar.gz

3. Source the bashrc file in the OpenFOAM distribution by

Code:

. ~/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
and execute in the command line, which compiles the local gcc-version

[CODE]
(cd ~/OpenFOAM/ThirdParty-2.2.0/; ./makeGcc)
[CODE]

4. After successfull compilation of gcc, then execute the following commands. I opened a new terminal:

Code:

cd ~/OpenFOAM/OpenFOAM-2.2.0
. etc/bashrc
export WM_NCOMPPROCS=8 # Here the number 8 is my number of processor
./Allwmake

5. After this step you should have been able to compile OF220 successfully. To make sure, try to execute

Code:

./Allwmake
again. This should give rise to a lot of "... is up to date".

Good luck,

Niels

Chrisi1984 March 20, 2013 11:55

Hi Niels,

thanks a lot for your instruction. It also worked for me.

I just had to change one more thing because in my system GCC/UPC multilib feature is enabled:

In the makeGcc file I had to add that option after line 280

Quote:

--disable-multilib \
Besides from that I would like to know how you post-process you cases with the new OF version since you did not compile Paraview.

Did you link OF2.2 to a previous paraview installation of an older openfoam version? If yes how can i manage to do that?

Kind regards

Chrisi

ngj March 20, 2013 12:00

Hi Chrisi,

Good to hear that you could use the guide.

With respect to paraFoam, then I am not using OF220 for simulations, but merely to check for cross-version compatibility of some code, which I have released. Besides that I never use paraFoam, but rather paraView directly. At one of my computers I have downloaded ParaView3.98, and it works perfectly.

Kind regards,

Niels

apsus March 21, 2013 08:49

Just in time for my project. Thanks for the easy-to-follow guide! Saved me a huge amount of time.

Chrisi1984 March 21, 2013 15:15

Hi,

I just realized that my installation dos not work for parallel calculations.

Does somebody of you experienced the same?

Can the small change in the makeGcc file be responsible for that?

Where exactly I should store those files:

and where I have to type those commands:

Quote:

tar jxf openmpi-1.6.3.tar.bz2
tar jxf mpfr-3.1.0.tar.bz2
tar jxf gmp-5.0.4.tar.bz2
tar -xzf mpc-0.9.tar.gz
tar -xzf scotch_6.0.0.tar.gz
Perhabs I made a mistake with that.

Thanks in advance!

Kind regards

Chrisi

ngj March 22, 2013 14:10

Hi Chrisi,

All the operations, which you are referring to are executed in the ThirdParty-2.2.0 directory.

With respect to parallel computing, I am sorry that I cannot help you, since I have tested the damBreak successfully in parallel. All I can ask is: Does the src/Pstream libraries compile successfully?

Kind regards,

Niels

Chrisi1984 March 23, 2013 05:03

Hi,

thanks for your hint. I recompiled everything after I executed the reffered things in the ThirdParty-2.2.0 directory.

Afterwards besides from decomposePar every command for parallel calculations worked.

Then I recompiled "decomposePar" in the application/utilities folder.

Now everything is running properly also in parallel!

Kind regards

Chrisi

ngj March 23, 2013 05:32

Good:)

/ Niels

DineshramBalaji June 19, 2013 19:18

Hi Niels,

I followed the same instruction. but when I did the
. ~/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc, I got this error


Warning in /home/bluesim/OpenFOAM/OpenFOAM-2.2.0/etc/config/settings.sh:
Cannot find /home/bluesim/OpenFOAM/ThirdParty-2.2.0/platforms/linux64/gcc-4.6.2 installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'foamCompiler' setting to 'system'


How can i correct it?

wyldckat June 20, 2013 16:09

Greetings to all!

@Dinesh: Which Linux distribution are you using? I ask this because it'll make it easier to assist you, in case you need additional packages for building Gcc 4.6.2.

Best regards,
Bruno

DineshramBalaji June 20, 2013 17:11

Hi Bruno,

I am using Ubuntu 10.04.4. Thanks for the help.

wyldckat June 23, 2013 16:15

Hi Dinesh,

Only today did I manage to look into this. Please try following these instructions: http://openfoamwiki.net/index.php/In...u#Ubuntu_10.04 - section Ubuntu 10.04

They were tested with Gcc 4.5.2, which is the version defined in OpenFOAM's settings, but you can attempt to adjust to the Gcc 4.6.2, while also keeping in mind to use "Gcc46" instead of "Gcc45", whenever it appears.

Best regards,
Bruno

DineshramBalaji June 24, 2013 15:28

Hi Bruno,

Thanks for the link. I tried the procedure. But I can't proceed more than step 5. When i start with the make gcc command, it doesn't proceed after that

wyldckat June 24, 2013 16:27

Hi Dinesh,

OK, then let's try to figure out what happened:
  1. Which architecture of Ubuntu are you using? To know, run:
    Code:

    uname -m
  2. Are you following the exact steps given on the wiki page?
  3. Did you start with a fresh copy of OpenFOAM 2.2.0 or at least undo some of the steps you had done with the previous instructions?
  4. Did you edit the file "~/.bashrc" and remove the old instruction for sourcing the environment? Namely a line similar to this one:
    Code:

    source $HOME/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
  5. Are you trying to build with Gcc 4.6.2 or Gcc 4.5.2?
  6. Which exact command gave you an error and what error was it?
    • For example, the following command:
      Code:

      ./makeGcc gcc-4.5.2 gmp-5.0.1 mpfr-2.4.2 mpc-0.8.1 > mkgcc.log 2>&1
      Should take a long while to run. No matter if it takes very long or very little time, the error messages will be logged inside the file "mkgcc.log".
Best regards,
Bruno

DineshramBalaji June 24, 2013 16:58

Hi,

1. The ubuntu architecture is x86_64

2. Yeah, I am following the exact procedure, step by step

3. No since this page contains procedure to download fresh OF 2.2 package, i am doing it in separate folder.

4. when i tried to source the bashrc, there was an error display, as first mentioned by me in this thread

5. I am trying to install gcc 4.6.2

6. the following command gave me the error
./makeGcc gcc-4.5.2 gmp-5.0.1 mpfr-2.4.2 mpc-0.8.1> mkgcc.log 2>&1

The error was

bash: export: `gmp-5.0.1': not a valid identifier
bash: export: `mpfr-2.4.2': not a valid identifier
bash: export: `mpc-0.8.1': not a valid identifier


is this error serious?

wyldckat June 24, 2013 17:14

Hi Dinesh,

OK, I gave this a quick try, but I did not try to build Gcc. Nonetheless, the following steps are what I did differently from the wiki page:
  1. Switched Gcc 4.6.1 to 4.6.2, as indicated by Niels, but I used the following command to do it:
    Code:

    sed -i -e 's=4.6.1=4.6.2=' $HOME/OpenFOAM/OpenFOAM-2.2.0/etc/config/settings.sh
    This should be done between step #2 and #3.
  2. Used "WM_COMPILER=Gcc46" in step #3.
  3. On step #5, I did the following:
    Code:

    sed -i -e 's=\(--with-system-zlib \)=\1--disable-multilib =' makeGcc46

    ./getGcc gcc-4.6.2 mpfr-3.1.0 gmp-5.0.4 mpc-0.9
    ./makeGcc46 gcc-4.6.2 mpfr-3.1.0 gmp-5.0.4 mpc-0.9 > mkgcc.log 2>&1
    wmSET $FOAM_SETTINGS

    Note: If you have already downloaded the files and unpacked them in the ThirdParty-2.2.0 folder, then the "getGcc" line shouldn't be needed.
  4. Then it's just a matter of moving onwards to step #6, assuming the same error is not given after you do the last "wmSET" command line.
Best regards,
Bruno

DineshramBalaji June 25, 2013 15:07

Hi Bruno,

In addition to this error message,

Warning in /home/bluesim/OpenFOAM/OpenFOAM-2.2.0/etc/config/settings.sh:
Cannot find /home/bluesim/OpenFOAM/ThirdParty-2.2.0/platforms/linux64/gcc-4.6.2 installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'foamCompiler' setting to 'system'


which the tutorial itself says we would get, I am also getting the following error

Cannot open configuration file /home/bluesim/OpenFOAM/ThirdParty-2.2.0/platforms/linux64Gcc/openmpi-1.6.3/share/openmpi/mpicc-wrapper-data.txt
Error parsing data file mpicc: Not found


is this error important or can be neglected along with the previous one?

wyldckat June 25, 2013 17:04

Hi Dinesh,

That is indeed a very strange error message. I feels like that there is a conflict of options when Open-MPI was chosen as the MPI toolbox for OpenFOAM.
The only thing that comes to mind is that you might have 2 or more lines in the file "~/.bashrc" that conflict with each other. Perhaps something like having both of the following lines:
Code:

source $HOME/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
source $HOME/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI foamCompiler=ThirdParty WM_COMPILER=Gcc46

So, I would suggest the following steps:
  1. Check the file "~/.bashrc" to see if there is only one reference to OpenFOAM 2.2.0.
  2. Start a new terminal, to make sure that there isn't any conflict of old and new variables.
  3. And if the same error does exist, continue with the instructions, in hope that the problem will solve itself.
Either way, this last message you've gotten should not affect the build process of Gcc 4.6.2.

Best regards,
Bruno

DineshramBalaji June 26, 2013 19:22

Hi Bruno,

Thanks for the help. Just proceeded ignoring the error. Everything seems to work fine including the paraview.
But the mpicc error seems to persist. For eg. when i give
wmSET $FOAM_SETTINGS
I get the following error
Cannot open configuration file /home/bluesim/OpenFOAM/ThirdParty-2.2.0/platforms/linux64Gcc/openmpi-1.6.3/share/openmpi/mpicc-wrapper-data.txt
Error parsing data file mpicc: Not found


Will this be affecting my simulation results?

wyldckat June 27, 2013 03:30

Hi Dinesh,

As I said before, this is a strange message you're getting. It should not affect your simulations, but it's possible that you might not be able to run in parallel.

What do the following commands give you?
Code:

echo $WM_MPLIB
echo $MPI_ARCH_PATH
which mpicc
which mpirun

Best regards,
Bruno


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