CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFoam Installation in Redhat Enterprise linux 5 (https://www.cfd-online.com/Forums/openfoam-installation/73629-openfoam-installation-redhat-enterprise-linux-5-a.html)

sahm March 12, 2010 14:14

OpenFoam Installation in Redhat Enterprise linux 5
 
Hi Everbody
I have a problem that can be easy to solve, But I don't know how.
I wanted to install OpenFoam on a machine with Redhat Enterprise Linux 5, but the Gcc version of Redhat is 4.1.2 which is not good for OpenFOAM 1.6.
The problem is that the wmake is not working, so I have to update GCC version.
I don't have access to the root of Linux, also I can not reinstall it, since there are many other processes running on it. It`s a cluster being used by many people.
The only way I can do is to update GCC for just one single user. But I don't know how. Does anybody know how to update it for just one User?
Any comments is welcome.

gschaider March 16, 2010 14:51

Quote:

Originally Posted by sahm (Post 249748)
Hi Everbody
I have a problem that can be easy to solve, But I don't know how.
I wanted to install OpenFoam on a machine with Redhat Enterprise Linux 5, but the Gcc version of Redhat is 4.1.2 which is not good for OpenFOAM 1.6.
The problem is that the wmake is not working, so I have to update GCC version.
I don't have access to the root of Linux, also I can not reinstall it, since there are many other processes running on it. It`s a cluster being used by many people.
The only way I can do is to update GCC for just one single user. But I don't know how. Does anybody know how to update it for just one User?
Any comments is welcome.

Possible things to look at:
a) have you tried the compiler that comes with the third-party-binaries? (if push comes to shove you can recompile the compiler. There is a script for that in the third-party-directory)
b) there is a project on sourceForge to support OF on CentOS (for all practical purposes CentOS IS RHEL)
c) there is a "technology preview" of gcc44 distributed by RHEL (maybe you can get your admin to install those)

Bernhard

sahm March 16, 2010 14:59

Still don't know what to do
 
Thank you Bernhard,
Actually the problem is solved now, we contacted the support service for the machine, and we installed the Gcc 4.3.3 rpm file.
But still I would like to know the solution, because this can happen again. I have downloaded the Gcc 4.3.4 on my user from gcc.gnu.org, and unpacked the files, But I don't know how to compile it, can you tell me? Can I compile the Gcc version in the third party of OpenFOAM which doesn't need downloading Gcc again?

wyldckat March 16, 2010 18:11

Greetings SAHM,

Quote:

Can I compile the Gcc version in the third party of OpenFOAM which doesn't need downloading Gcc again?
There is a script that comes with the ThirdParty General package, named makeGcc. To use it, go to the ThirdParty folder and run:
Code:

./makeGcc gcc-4.3.3
This will build the gcc-4.3.3 version that comes with the ThirdParty package.
Now, there are 3 things you'll have to take into account:
  1. the ~/OpenFOAM/OpenFOAM-1.6/etc/bashrc script must be executed before running makeGcc.
  2. you should only unpack the General packages of OpenFOAM, so it won't trigger the "already built" detection.
  3. if your installation is 64bit only, i.e., if the system's gcc isn't built with the multilib option, than my advice is to use the modified script I've already posted some time ago here. Actually, in that thread you'll find a couple more little pearls of wisdom regarding building gcc in OpenFOAM ;)
Additionally, you might need a few more packages to be installed in your Linux installation (local or cluster), that are also listed in that thread above, in post #7. Keep in mind that some of those packages might not be necessary, depending on what you want to built.

I can only assume that if it's in a shared cluster, you won't be needing Paraview on it, but I could be wrong ;) You might actually want Paraview built in the cluster, with the "mesa" driver option on in the makeParaview script, so you can use Paraview's parallel functionality, thus opening the OpenFOAM cases straight from the cluster nodes!

Oh, and just in case you decide to upgrade gcc to 4.4.*, only OpenFOAM 1.6.x is up to specs; the 1.6 version will only build with gcc-4.3.* out-of-the-box.

Best regards,
Bruno

anfho September 14, 2010 13:52

Confused about OF and GCC versions
 
Dear All,
I really appreciate your many comments about OpenFOAM (OF) and gcc. Unfortunately, since I am new to the OF community and not an advanced linux user (I am new to this forum too), I am getting really confused about the OF version that run with wich compiler. Also the cross links make things more difficult for me.

I want to install OF on a cluster with linux red hat enterprise, to which I do not have the root rights. gcc-4.1.2 is pre-installed. I know there is OF 1.7.1 out there wich requires gcc-4.4.4, I believe.

I am really confused what I should do now. Go with an earlier version of OF (the only two I have available are 1.6 and 1.7.0, which don't work with gcc 4.1.2).

Would you recommend to use OF1.6 (32 or 64 bit?) and then upgrade the gcc from the thrid-party package, that comes with the OF downoad package Or would you go with 1.7.1 and try to upgrade the gcc then? Is it really possible to upgrade the gcc compiler on a linux cluster without root rights?

Any help is greatly appreciated.
Best regards,
Andreas

wyldckat September 14, 2010 14:52

Greetings Andreas and welcome to the forum!

I don't know if CentFOAM (official thread http://www.cfd-online.com/Forums/ope...-released.html) has an option to install for user only, but I think that you will need to install some system tools nonetheless, even if you can't upgrade the system's gcc version. And it should work with RHEL!


As for the required gcc version and I quote from the official page:
Quote:

Originally Posted by http://www.openfoam.com/download/source.php
In particular your system will need to include a recent version of gcc (check with gcc --version, we recommend gcc-4.4.? but gcc-4.3.? is sufficient). If the installed version is not recent source pack for newer versions are available from http://gcc.gnu.org/.

As of OpenFOAM 1.7.1, you can also use gcc 4.5.?.


Now, as for building a custom non system installed gcc: You can get the gcc 4.3.3 version that comes with OpenFOAM 1.6, available here. You can use its pre-built gcc version that comes with the binaries. But if you want to build that version from scratch... er, my previous post explains about that :)


Or, if you feel like experimenting, you could try using FreeFOAM (it's OpenFOAM, but it uses cmake), which the latest git version apparently allows building OpenFOAM with gcc 4.1.2 :)

Best regards,
Bruno

anfho September 15, 2010 11:06

Hi Bruno,
thanks a lot for the quick reply. I think the best way for me is to go with OF-1.7.1 and install the gcc-4.3.3 that comes with the OF-1.6 package. What did you mean with building from scratch? I am sure there is a thread that explains how to install gcc-4.4.4 from OF-1.6 and I do not want to kill too much of your time, however, since there are a lot of details that have to be changed in the source files, I would appreciate if we could go through that step by step. So the best bet is to start with your reply from above? Thanks!
Andreas

wyldckat September 15, 2010 11:20

Hi Andreas,

What I meant with «building from scratch» is to build gcc 4.3.3 that comes with ThirdParty-1.6.General, instead of using the pre-built version that comes with the binary ThirdParty-1.6.linux(64)Gcc package.

I suggest that you first try CentFOAM (see this thread: http://www.cfd-online.com/Forums/ope...-released.html). If that doesn't work, then I can try writing something more dedicated to this issue. Actually, I can even modify a script I've already got for cross-compiling gcc with mingw... but like I said, only after you've tried CentFOAM ;)

Best regards,
Bruno

anfho September 15, 2010 12:06

Bruno,
not sure what SL 5.x stands for. Is that the RHEL version? The RHEL version on the cluster that I am using is 4.1.2-46. Can I install the release you are referencing to in that OS?
Andreas

wyldckat September 15, 2010 12:13

Hi Andreas,

I believe SL is Scientific Linux. Those three versions are all related to Red Hat Enterprise Linux (i.e., RHEL :)).

Unfortunately, I believe that CentFOAM only targets the 5.x series :(

Later today I'll try to either explain things better or modify the script I have :)

Best regards,
Bruno

anfho September 15, 2010 12:20

Bruno,
also: installing CentFOAM requires the "yum" command, which needs root rights. Since I do not have root rights, I think installing CentFOAM is not really an option... So installing OF1.7.1 with gcc4.3.3 rom OF1.6 anyway?
Andreas

wyldckat September 15, 2010 20:30

1 Attachment(s)
Greetings Andreas,

EDIT: I've made a blog post with an update of this build-gcc44 script, as well with build-gcc45: Automated scripts for building gcc 4.4.x and 4.5.x for using with OpenFOAM 1.7 series

OK, I've created a modified version of the build-mingw44 script I made at blueCAPE for cross-compiling OpenFOAM 1.7.0 in Linux for Windows (see here if you're curious). The resulting script is named build-gcc44, which will take care of downloading and building binutils and gcc and some of it's direct dependencies (namely gmp and mpfr). Keep in mind that this script will not take care of all of the necessary steps to get your system ready for building OpenFOAM!

The following steps are needed for this to work (might not be complete, since I haven't tested this yet on a CentOS 4):
  1. Check and/or request your cluster/RHEL administrator to install these packages (the names are from Debian, so you'll need to find similar names in RHEL):
    • flex - it should include the binaries flex and flex++, as well as FlexLexer.h.
    • libreadline5-dev - this has the readline library and respective header files.
    • texinfo - this is required during building gcc for documentation... but I can't remember what were the needed files :(
    • byacc and bison - these are two applications, one needed for building gcc, the other for building OpenFOAM.
  2. Get OpenFOAM 1.7.0/1 or 1.7.x into your system, by following the instructions at www.openfoam.com.
  3. After getting OpenFOAM's bashrc sourced (search for «source the etc/bashrc» in the project's installation page) into the working environment, edit the file "$WM_PROJECT_DIR/etc/settings.sh" and change the following lines:
    • change:
      Code:

      gcc_version=gcc-4.4.3
      to:
      Code:

      gcc_version=gcc-4.4.4
    • change:
      Code:

      : ${compilerInstall:=system}
      to:
      Code:

      : ${compilerInstall:=OpenFOAM}
  4. Source the bashrc file once more, or start a new terminal and source it again.
  5. Download the attached build-gcc44.tar.gz and unpack it in the "$WM_THIRD_PARTY_DIR".
  6. Now run:
    Code:

    cd $WM_THIRD_PARTY_DIR
    ./build-gcc44

    It will download the files mentioned before (binutils, gcc, gmp, mpfr) and build them in the proper order.
  7. Whenever there is an error, it will tell you in which log file the error is listed. Check it for the things it says it needs and try to get them. If you can't figure it out, compress and attach the relevant log file.
    If you can get them, then run build-gcc44 again.
  8. When you finally have gcc fully built, then you can move on to building OpenFOAM.

Now, keep in mind that these steps will only get as far as building OpenFOAM and OpenMPI. And this is assuming that you can get the remaining necessary packages that I'm not giving instructions about. If you need a software package that you can't request to be installed in the system, then you will have to download the source code and build it yourself... usually with a group of commands like this:
Code:

./config --prefix=/the/folder/where/to/install
make
make install

As for ParaView, it requires a larger heap load of packages to be installed and/or built (most likely all would have to be built in RHEL 4 :() which is too much work to even bother, or so I believe :( The best option would be to simply get the ready to use version from www.paraview.org and follow the instructions I've already detailed here: Using the official pre-built ParaView 3.8.0 version with OpenFOAM...

Good luck!
Bruno

anfho September 16, 2010 12:15

Hi Bruno,
thanks a lot for your post. I really appreciate your help. Finally, I could also get a hold of the cluster admin. And I have to apologize as I am a new user of this cluster, too. The admin told me that there was CentOS 5.4 installed. Is this the same as CentOS/SL 5.x? I got confused about the Linux versions. Because when I entered "gcc --version" I got the output: "gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) Copyright (C) 2006 Free Software Foundation, Inc." Therefore I thought RHEL 4.1.2 would be installed.
But still - eventhough CentOS 5.4 is installed it is the old gcc 4.1.2 compiler. So is it possible to use CentFOAM (as disussed here: http://www.cfd-online.com/Forums/ope...eleased-2.html) and then try to find a work around of the "yum" command? Meaning can I update the gcc compiler on CentOS 5.x also, like you showed me for RHEL 4.x above?

Also, why does OpenCFD and everyone in this forum recommend to compile OpenFOAM with gcc? gcc is known to produce inefficient codes (at least that what the cluster admin says). Wouldn't it be better to use icc or pgi? On the cluster there is icc 10.1 installed.

As far as the needed packages for gcc go:
-flex version 2.5.4
-bison 2.3
is installed. I am not sure about
-libreadlines5-dev
-texinfo
-byacc
are these standard packages? Are they at least standard and included in CentOS 5.4?

Thanks very much!
Andreas

anfho September 16, 2010 12:39

Is there a command to check the linux version?

wyldckat September 16, 2010 19:23

Hi Andreas,

Posting the same thing on two "similar" threads brings people to a paradoxal issue: "to which thread do we answer" and you will probably lead different people to answer you pretty much the same thing!

So, let's go through your question list, one issue at a time:
  • Since you do have access to CentOS 5.4 (and yes, it is considered CentOS 5.x, since "x=0:5" :D), then ask your system's admin to either check or install the packages listed on Linnemann's CentFOAM page under manual installation, namely the packages:
    Code:

    ncurses-devel tix.x86_64 glibc-devel flex-devel zlib-devel libXt-devel
    The remaining ones I believe that by your description you already have access to. Then you can either use Linnemann's script for finishing the installation, or you can continue to follow the "manual installation" instructions. AFAIK, CentFOAM's packages of OpenFOAM 1.7.0 already come with gcc 4.4.4 pre-built and ready to use, so you will not have to suffer the small hell of building gcc :D
  • As for ICC or PGI: Intel's C/C++ compiler is roughly supported in OpenFOAM. In my signature link you can find a link to a thread that tells you what is missing in OpenFOAM for it to build with ICC. But I'm not sure what is the lowest ICC version compatible with OpenFOAM 1.7.
  • As for ICC being better than GCC: well, OpenFOAM is open source code and GCC is also open source, sooo it's only natural that OpenFOAM sticks with open source software :) Additionally, Intel's C/C++ compiler has had it's problems with the CFD crowd, because although ICC provides faster applications, it sometimes looses floating point accuracy in favor of speed.
    So, what basically happens is that when a CFD code is developed with a specific compiler version, the resulting built applications are validated with experimental data or previously known solutions. So, if OpenFOAM is well tested with GCC, and builds with ICC, it doesn't necessarily mean that the results with ICC will be as valid as the results with GCC!
  • As for knowing the Linux version, there are several ways of knowing, such as:
    Quote:

    Originally Posted by http://www.howtoforge.com/how_to_find_out_about_your_linux_distribution
    Code:

    cat /etc/issue
    cat /etc/*release
    cat /etc/*version


  • Last but not least, the script build-gcc44 I've posted yesterday does automatically what Linnemann's link for gcc 4.3.x explains.
Best regards,
Bruno

PS: By the way, this forum allows you to edit your posts, so you didn't have to do two consecutive posts on the same thread :p

anfho September 22, 2010 12:43

Hi Bruno,
again, thanks very much for the great help. I am working with the cluster admin on these issues now and will get back to you when I (we) encounter difficulties. Just one question in the meantime: Is is possible to upgrade to newer versions once I get CentFOAM to work? The newest OF release is 1.7.1 (as on: http://www.openfoam.com/download/source.php) and CentFOAM is basically OF 1.7.0, right?
Best regards, Andreas

wyldckat September 23, 2010 09:36

Hi Andreas,

It's pretty easy to have 1.7.1 and 1.7.x once you've got OpenFOAM 1.7.0 up and running. Simply run:
Code:

cd $WM_THIRD_PARTY/../
ln -s ThirdParty-1.7.0 ThirdParty-1.7.1
ln -s ThirdParty-1.7.0 ThirdParty-1.7.x

Then unpack OpenFOAM-1.7.1.gtgz or use git to get 1.7.x. Then in the end of your "~/.bashrc" file, do something like this:
Code:

alias of170='. $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc'
alias of171='. $HOME/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc
alias of17x='. $HOME/OpenFOAM/OpenFOAM-1.7.x/etc/bashrc

Then every time you start a new terminal, run of170 or of171 or of17x and you will have the desired environment set to go.

Finally, run Allwmake in OpenFOAM-1.7.1 or 1.7.x. And voilá, if all goes well, you are ready to go!

Best regards,
Bruno

pit September 24, 2010 08:51

Hi Bruno,
I found this thread because I want reply the CentFOAM thread. Here I've installed CentFOAM (OF-1.7.0) on a RHEL 5 machine after a lot of problems trying to install OF on the normal way.

First it looks quite good and I have no critical errors after the 'foamInstallationTest'. Also it runs with the standard solver etc.
But now I tried to compile extensions/solver with wmake. I get no errors while compiling, but when using it leads to segfault.

msuho October 6, 2010 23:02

Hi. Hope this thread is still active.

I'm trying to install OpenFOAM 1.7.1 on RHEL 5.4 by building from source. The gcc-4.4.4 compiler is installed on this system under /opt, as it is a cluster system with many users, and all additions to the red hat binary software stack are built as modules. I can build the source as per the download instructions, & run the installation test successfully, but when I proceed with trying the tutorials, I find that
I am not linking to the proper libstd++.so.6. My LD_LIBRARY_PATH lists the gcc-4.4.4 lib path first, but no dice.

For instance, for icoFoam I show:

: ldd icoFoam
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./icoFoam)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./icoFoam)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libfiniteVolume.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libfiniteVolume.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libtriSurface.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libtriSurface.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libmeshTools.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libmeshTools.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libdecompositionMethods.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libdecompositionMethods.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/liblagrangian.so)
./icoFoam: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/liblagrangian.so)
libfiniteVolume.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libfiniteVolume.so (0x00002b1e23ada000)
libOpenFOAM.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so (0x00002b1e24a2d000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003dbf400000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003dc5000000)
libm.so.6 => /lib64/libm.so.6 (0x0000003dbf000000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003dc4000000)
libc.so.6 => /lib64/libc.so.6 (0x0000003dbec00000)
libPstream.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/dummy/libPstream.so (0x00002b1e2506b000)
libtriSurface.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libtriSurface.so (0x00002b1e2526f000)
libmeshTools.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libmeshTools.so (0x00002b1e254e1000)
libz.so.1 => /usr/lib64/libz.so.1 (0x0000003dbfc00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003dbe800000)
libdecompositionMethods.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libdecompositionMethods.so (0x00002b1e25940000)
liblagrangian.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/liblagrangian.so (0x00002b1e25b5f000)
libscotchDecomp.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/dummy/libscotchDecomp.so (0x00002b1e25d7a000)
libmetisDecomp.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/dummy/libmetisDecomp.so (0x00002b1e25f7f000)
libparMetisDecomp.so => /opt/crc/OpenFOAM/1.7.1/gcc-4.4.4/OpenFOAM-1.7.1/lib/linux64GccDPOpt/dummy/libparMetisDecomp.so (0x00002b1e26183000)
newcell.crc.nd.edu{msuhovec}83:

I am not familiar with wmake- I can't figure out where the library paths are being set during the build.

I've totally blown away the source tree & rebuilt it twice to make sure I was not picking up anything built with gcc 4.1.2, but I've gotten the same results.

Any ideas appreciated.

Thanks,

Mark

wyldckat October 7, 2010 07:30

Greetings Mark and welcome to the forum!

You seem to have root powers, so why don't you try CentFOAM: http://www.cfd-online.com/Forums/ope...-released.html

It has instructions for both automatic and manual installations of OpenFOAM for CentOS, RHEL and SL 5.x. And I believe it has already been updated to 1.7.1. If not, once you have 1.7.0 working, it'll be very easy to get the 1.7.1 working!

Only if CentFOAM goes wrong for you, then we can try and help you ;)

Best regards,
Bruno

msuho October 7, 2010 09:09

Bruno-

Thanks for the reply.

I would dearlly love to install the binary, but am not permitted. Since we support many versions of many different software packages, and most users only use a few, everything
is built & installed under /opt, and the modules package is used to configure each package's environment settings.

Having read couple of your installation threads, let me ask you a couple of questions:

1) I'm not proficient with wmake- since there aren't Makefiles as I understand them, where are the compilation/ linking flags set? Can OpenFOAM be configured to build using only static libraries?

2) There was a thread where you talked about changing "settings" so that OpenFOAM used the 3rd party compiler instead of the system's I'm wondering if I might use that to my advantage, as my compiler is installed in a non-standard place.

Thanks,

Mark

wyldckat October 7, 2010 18:38

Hi Mark,

Quote:

Originally Posted by msuho (Post 278285)
I would dearlly love to install the binary, but am not permitted. Since we support many versions of many different software packages, and most users only use a few, everything is built & installed under /opt, and the modules package is used to configure each package's environment settings.

I've never used CentFOAM, but I have investigated a bit how it's inner workings are. It requires some system packages and it's only for 64bit architectures (x86_64 if I'm not mistaken), but the remainder of the installation of OpenFOAM+ThirdParty is put in the /opt folder! If I'm not mistaken, that's mentioned in the manual installation part of CentFOAM's wiki page. And it already comes with it's own pre-built gcc 4.4.4 :)

Quote:

Originally Posted by msuho (Post 278285)
1) I'm not proficient with wmake- since there aren't Makefiles as I understand them, where are the compilation/ linking flags set?

OK, wmake has a structured system to comply with the various architectures. In OpenFOAM's folder, you have the wmake folder. Inside that folder you have the main Makefile used for all architectures, but this shouldn't need any changes. Still inside that same folder, you have the rules folder, which in turn has various folders for each architecture.
The default rule folder is linux64Gcc and inside it you will find various files for configuring parts related to each binary used (gcc, g++, flex, bison, etc...).
In the rules folder you also have the General folder, which has the default definitions and will also gather the partial information from the defined target rule folder.
Now, all of these above relate to each other: Makefile<-General<-linux64Gcc
The rule folder is deduced by concatenating "$WM_ARCH$WM_COMPILER", which in turn is defined in "$WM_PROJECT_DIR/etc/bashrc".

Now, if you are wondering "this is all nice, but where do I define where the folder of my shiny new gcc 4.4.4?" - Well, it's defined in the file "$WM_PROJECT_DIR/etc/settings.sh" :D There you can choose whether to use the system's gcc or your own custom version, as well as where it should be. If you study that file, you'll figure out that OpenFOAM already has in mind a place where to keep custom gcc's, namely: "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version" :cool:
So, this also answers your number 2 question ;) It's all intertwined :)

A little side note: If you feel this is too much hassle, you can try FreeFOAM, which is OpenFOAM based in CMake instead of wmake. And if you want the FreeFOAM version that is closest to the official 1.7.x version, you'll have to go to the git branch "pu", if I'm not mistaken.

Quote:

Originally Posted by msuho (Post 278285)
Can OpenFOAM be configured to build using only static libraries?

Not without some tweaking :( I've talked about this before here, and if you search for Cray XT here in the forum, I believe those users also need a static build of OpenFOAM and that there is already a guide somewhere...
Wait... now that I think of it, probably it's pretty simple - in the rule file linux64Gcc/c++, there is this line:
Code:

LINKLIBSO  = $(CC) $(c++FLAGS) -shared
Switching from shared to static might do the trick! Arg... why didn't I think of this sooner :( Well, this solution might not work perfectly, but with some minor adjustments, it might work pretty well.

Ah, I almost forgot: in each source code folder for each OpenFOAM library and application, there is a folder named Make, that has two files: files and options. These two define the final/dedicated settings for each one of those libraries and applications. So on each one you might want to do some final adjustments... although it might be easier to fix upstream in the main Makefile or in the rules...

OK... after all of this writing, I think that all that is left is testing, tweaking and running :D

Best regards and good luck!
Bruno

msuho October 11, 2010 09:35

Bruno-

Thank you for the most thorough crash course on the OpenFOAM wmake/configuration hierachy. I found it tremendously helpful.

I changed (in settings.csh) the gccDir, gmpDir, mpfrDir, and mpcDir to point to our versions, and changed the compiler option from system to OpenFOAM, and I was
able to build OpenFOAM 1.7.1 from source. The OpenFOAM executables resolve their
shared library dependecies, and I can run blockMesh & icoFoam. WooHoo!

Now On to the next problem- Paraview. We already have Paraview 3.8.0 built
in our environment in- you guessed it- /opt. And source builds of cmake and QT as well, since Paraview needs them. I need to build the OpenFOAM (ParaFoam) Paraview linkage software using our stuff. I see a thread about this- I guess I'll start there.

Thanks again for your help,

Mark

wyldckat October 11, 2010 09:43

Hi Mark,

You're welcome :) Probably there is already somewhere written how it works, but it felt faster to simply write things down instead of searching ;)

As for ParaView, since you already have 3.8.0 built:
Quote:

Originally Posted by http://www.cfd-online.com/Forums/blogs/wyldckat/317-using-official-pre-built-paraview-3-8-0-version-openfoam.html
  1. Now open the file "$HOME/OpenFOAM/OpenFOAM-1.7.0/bin/paraFoam" in your favorite simple text editor and replace every entry ".OpenFOAM" with ".foam". Now save and close the file.
And voilá, you now should have a fully working paraFoam script at your disposal! Along with ParaView 3.8.0, with no further building required :)

Best regards,
Bruno

msuho October 11, 2010 10:03

Thanks Bruno-

So, what, if anything, do I need to build in the Third Party directory in I've got a working
Paraview installation already?

Thanks,

Mark

wyldckat October 11, 2010 10:27

Hi Mark,

By what I understood of your other post and I quote:
Quote:

Originally Posted by msuho (Post 278684)
Now On to the next problem- Paraview. We already have Paraview 3.8.0 built
in our environment in- you guessed it- /opt.

I interpreted from your post that you already had ParaView 3.8.0 built and ready to be used! So it would just be a matter of adapting the paraFoam script, so it would use the internal reader that comes since 3.8.0 (previous versions only worked with OpenFOAM 1.2 or 1.3).
I forgot to mention that in the quoted link in my previous post, there are more instructions on how to use an already built ParaView 3.8.0.

Eitherway, you can try to use the pre-built version from www.paraview.org or build a local version. But if you build a local version, easily will you build OpenFOAM's original plugin for ParaView (the one that opens ".OpenFOAM" files). It's just that the internal version already comes ready to use... and has some advantages over the original version.

Best regards,
Bruno

archymedes October 22, 2010 11:02

OF 1.7.1 on Cluster Redhat v2.6.18-128.1.6.el5
 
Hi everybody,

I am also trying to install Of on a cluster, no root rights.
I would like to install 1.7.1 becuase I've already modified some cody on my local machine for it.

I've followed the instruction on OpenFoam.com.
The standard compiler on the cluster is gcc - version 4.1.3 but gcc44 (4.4.0) is also available.
So I've added
Code:

alias gcc="/usr/bin/gcc44"
alias cc="/usr/bin/gcc44"

to my .bash_profile and sourced it.

foamSystemCheck is OK.
.Allwmake runs for 1 hour returning errors :
Code:

/hpc_home/cschmitz/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/dictionaryTemplates.C: In member function ‘T Foam::dictionary::lookupOrDefault(const Foam::word&, const T&, bool, bool) const [with T = Foam::Switch]’:
/hpc_home/cschmitz/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude/readPISOControls.H:9:  instantiated from here
/hpc_home/cschmitz/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/dictionaryTemplates.C:44: error: call of overloaded ‘Switch(Foam::pTraits<Foam::Switch>)’ is ambiguous
/hpc_home/cschmitz/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/Switch.H:140: note: candidates are: Foam::Switch::Switch(int)
/hpc_home/cschmitz/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/Switch.H:134: note:                Foam::Switch::Switch(bool)
/hpc_home/cschmitz/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/Switch.H:62: note:                Foam::Switch::Switch(const Foam::Switch&)
make[2]: *** [Make/linux64GccDPOpt/dieselFoam.o] Error 1

Afterwards when I run foamInstallationTest it tells me
Code:

CRITICAL ERROR: gcc version lower than required
                Supplied version: 4.1.2
                Minimum required: 4.3.1

gcc      4.1.2    /usr/bin/gcc                                           
gzip    1.3.5    /bin/gzip                                               
tar      1.15.1    /bin/tar

but when I check
gcc --version its 4.4 ???

does anyone have an idea ?

Thanks,
Archy

wyldckat October 22, 2010 11:08

Hi Claus,

Don't use alias. See this explanation: OpenFOAM install on RHEL 5.5 post #2

Best regards,
Bruno

johny October 27, 2010 12:06

Hello Bruno,
I've a similar problem as Andreas and have been following your suggestions.
I've tried unseccessfully with ./build-gcc44 command. Can you please help me on how I can proceed further....
It terminated with the following message

Configuring binutils
Building binutils
Installing binutils
Configuring gcc
Building gcc
make of gcc failed - log available: /work/OpenFOAM/buildLogs/gcc-Gcc_make.log

Please have a glance on to the attachment and help me.

Thanks,
Johny




Quote:

Originally Posted by wyldckat (Post 275357)
Greetings Andreas,

EDIT: I've made a blog post with an update of this build-gcc44 script, as well with build-gcc45: Automated scripts for building gcc 4.4.x and 4.5.x for using with OpenFOAM 1.7 series

OK, I've created a modified version of the build-mingw44 script I made at blueCAPE for cross-compiling OpenFOAM 1.7.0 in Linux for Windows (see here if you're curious). The resulting script is named build-gcc44, which will take care of downloading and building binutils and gcc and some of it's direct dependencies (namely gmp and mpfr). Keep in mind that this script will not take care of all of the necessary steps to get your system ready for building OpenFOAM!

The following steps are needed for this to work (might not be complete, since I haven't tested this yet on a CentOS 4):
  1. Check and/or request your cluster/RHEL administrator to install these packages (the names are from Debian, so you'll need to find similar names in RHEL):
    • flex - it should include the binaries flex and flex++, as well as FlexLexer.h.
    • libreadline5-dev - this has the readline library and respective header files.
    • texinfo - this is required during building gcc for documentation... but I can't remember what were the needed files :(
    • byacc and bison - these are two applications, one needed for building gcc, the other for building OpenFOAM.
  2. Get OpenFOAM 1.7.0/1 or 1.7.x into your system, by following the instructions at www.openfoam.com.
  3. After getting OpenFOAM's bashrc sourced (search for «source the etc/bashrc» in the project's installation page) into the working environment, edit the file "$WM_PROJECT_DIR/etc/settings.sh" and change the following lines:
    • change:
      Code:

      gcc_version=gcc-4.4.3
      to:
      Code:

      gcc_version=gcc-4.4.4
    • change:
      Code:

      : ${compilerInstall:=system}
      to:
      Code:

      : ${compilerInstall:=OpenFOAM}
  4. Source the bashrc file once more, or start a new terminal and source it again.
  5. Download the attached build-gcc44.tar.gz and unpack it in the "$WM_THIRD_PARTY_DIR".
  6. Now run:
    Code:

    cd $WM_THIRD_PARTY_DIR
    ./build-gcc44

    It will download the files mentioned before (binutils, gcc, gmp, mpfr) and build them in the proper order.
  7. Whenever there is an error, it will tell you in which log file the error is listed. Check it for the things it says it needs and try to get them. If you can't figure it out, compress and attach the relevant log file.
    If you can get them, then run build-gcc44 again.
  8. When you finally have gcc fully built, then you can move on to building OpenFOAM.

Now, keep in mind that these steps will only get as far as building OpenFOAM and OpenMPI. And this is assuming that you can get the remaining necessary packages that I'm not giving instructions about. If you need a software package that you can't request to be installed in the system, then you will have to download the source code and build it yourself... usually with a group of commands like this:
Code:

./config --prefix=/the/folder/where/to/install
make
make install

As for ParaView, it requires a larger heap load of packages to be installed and/or built (most likely all would have to be built in RHEL 4 :() which is too much work to even bother, or so I believe :( The best option would be to simply get the ready to use version from www.paraview.org and follow the instructions I've already detailed here: Using the official pre-built ParaView 3.8.0 version with OpenFOAM...

Good luck!
Bruno


wyldckat October 27, 2010 12:25

Greetings Johny,

I wouldn't mind looking at the attachment, but there isn't one :(

Try attaching a compressed version:
Code:

tar -czf gcc_make_log.tar.gz /work/OpenFOAM/buildLogs/gcc-Gcc_make.log
Best regards,
Bruno

johny October 27, 2010 14:24

1 Attachment(s)
Thanks Bruno for your instant reply....Sorry...I didn't notice that....Here I'm attaching once again...


Quote:

Originally Posted by wyldckat (Post 281047)
Greetings Johny,

I wouldn't mind looking at the attachment, but there isn't one :(

Try attaching a compressed version:
Code:

tar -czf gcc_make_log.tar.gz /work/OpenFOAM/buildLogs/gcc-Gcc_make.log
Best regards,
Bruno


johny October 27, 2010 16:30

Quote:

Originally Posted by johny (Post 281069)
Thanks Bruno for your instant reply....Sorry...I didn't notice that....Here I'm attaching once again...



Also I missed to mention that my current gcc is
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)

wyldckat October 27, 2010 18:05

Hi Johny,
Quote:

Originally Posted by johny (Post 281078)
Also I missed to mention that my current gcc is
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)

:eek: Wow, RedHat series 3 :D I believe the most recent version is already series 5.

OK, your system is missing "fenv.h" which apparently should be part of "libc6.so"... which you probably don't have due to having an old system. But still, you can try installing the development files for libc (check in your package installer in RedHat, whose name I don't know :(). You can also try finding it in your system:
Code:

find / -name "fenv.h"
Although this could take a while to find...

You can try the following change in the build-gcc44 script, but I haven't tested yet it's effect (if any):
  1. Find the function "configure_gcc()" which has this code:
    Code:

      ${GCC_HOME}/configure -v \
        --prefix=${PREFIX} --disable-multilib \
        --with-pkgversion='OpenFOAM' --enable-languages=${GCC_LANGS} \
        --enable-__cxa_atexit --enable-libstdcxx-allocator=new \
        > ${LOG_FOLDER}/gcc-${WM_COMPILER}_configure.log 2>&1

  2. Make this change in bold:
    Code:

      ${GCC_HOME}/configure -v --disable-decimal-float \
        --prefix=${PREFIX} --disable-multilib \
        --with-pkgversion='OpenFOAM' --enable-languages=${GCC_LANGS} \
        --enable-__cxa_atexit --enable-libstdcxx-allocator=new \
        > ${LOG_FOLDER}/gcc-${WM_COMPILER}_configure.log 2>&1

My theory is that this change should remove the need for fenv.h, but I don't know exactly what are the repercussions :(

Best regards,
Bruno

johny October 28, 2010 04:24

Thanks Bruno,

I'd already looked for this fenv.h file but it seemed to be from a different library....I just copy it....I just copied one of these files to directory where it was searching for it and of no use:)

But I looked for the library libc6.so which I couldn't find....Do you think installing this library could help---If so please let me know where I can get those from

Anyway I'll make the changes you suggested in the script and let you know the repercussions...

/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/platforms/linux64/include/c++/4.3.1/tr1/fenv.h
/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/platforms/linux64/include/c++/4.3.1/fenv.h
/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/libstdc++-v3/include/tr1/fenv.h
/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/libstdc++-v3/include/c_compatibility/fenv.h
/home/johny/Desktop/gcc-4.5.0/libstdc++-v3/include/tr1/fenv.h
/home/johny/Desktop/gcc-4.5.0/libstdc++-v3/include/c_compatibility/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/download/gcc-4.4.4/libstdc++-v3/include/tr1/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/download/gcc-4.4.4/libstdc++-v3/include/c_compatibility/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/gcc-4.4.4/libstdc++-v3/include/tr1/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/gcc-4.4.4/libstdc++-v3/include/c_compatibility/fenv.h






Quote:

Originally Posted by wyldckat (Post 281091)
Hi Johny,

:eek: Wow, RedHat series 3 :D I believe the most recent version is already series 5.

OK, your system is missing "fenv.h" which apparently should be part of "libc6.so"... which you probably don't have due to having an old system. But still, you can try installing the development files for libc (check in your package installer in RedHat, whose name I don't know :(). You can also try finding it in your system:
Code:

find / -name "fenv.h"
Although this could take a while to find...

You can try the following change in the build-gcc44 script, but I haven't tested yet it's effect (if any):
  1. Find the function "configure_gcc()" which has this code:
    Code:

      ${GCC_HOME}/configure -v \
        --prefix=${PREFIX} --disable-multilib \
        --with-pkgversion='OpenFOAM' --enable-languages=${GCC_LANGS} \
        --enable-__cxa_atexit --enable-libstdcxx-allocator=new \
        > ${LOG_FOLDER}/gcc-${WM_COMPILER}_configure.log 2>&1

  2. Make this change in bold:
    Code:

      ${GCC_HOME}/configure -v --disable-decimal-float \
        --prefix=${PREFIX} --disable-multilib \
        --with-pkgversion='OpenFOAM' --enable-languages=${GCC_LANGS} \
        --enable-__cxa_atexit --enable-libstdcxx-allocator=new \
        > ${LOG_FOLDER}/gcc-${WM_COMPILER}_configure.log 2>&1

My theory is that this change should remove the need for fenv.h, but I don't know exactly what are the repercussions :(

Best regards,
Bruno


johny October 28, 2010 06:48

Hi Bruno....
Altering your script didn't help either...:mad:


Quote:

Originally Posted by johny (Post 281135)
Thanks Bruno,

I'd already looked for this fenv.h file but it seemed to be from a different library....I just copy it....I just copied one of these files to directory where it was searching for it and of no use:)

But I looked for the library libc6.so which I couldn't find....Do you think installing this library could help---If so please let me know where I can get those from

Anyway I'll make the changes you suggested in the script and let you know the repercussions...

/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/platforms/linux64/include/c++/4.3.1/tr1/fenv.h
/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/platforms/linux64/include/c++/4.3.1/fenv.h
/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/libstdc++-v3/include/tr1/fenv.h
/auto/opt/vwgfoam/ThirdParty/gcc-4.3.1/libstdc++-v3/include/c_compatibility/fenv.h
/home/johny/Desktop/gcc-4.5.0/libstdc++-v3/include/tr1/fenv.h
/home/johny/Desktop/gcc-4.5.0/libstdc++-v3/include/c_compatibility/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/download/gcc-4.4.4/libstdc++-v3/include/tr1/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/download/gcc-4.4.4/libstdc++-v3/include/c_compatibility/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/gcc-4.4.4/libstdc++-v3/include/tr1/fenv.h
/work/OpenFOAM/ThirdParty-1.7.1/gcc-4.4.4/libstdc++-v3/include/c_compatibility/fenv.h


wyldckat October 28, 2010 09:25

Hi Jonhy,

Well, I did say:
Quote:

My theory is that this change should remove the need for fenv.h, but I don't know exactly what are the repercussions :(
After some online searching, it seems that fenv.h is part of more recent versions of libc.so.6 (this is the proper name for it, not libc6 like I said before :(), but I didn't find from since when.

If you still have access to the RedHat service (or if your system's administrator still has access), you should be entitled to at least ask them for support about this issue. And my guess is that you better act quickly, because of this: Red Hat Enterprise Linux 3 & CentOS 3 end-of-life announced

From my part, the only I could try to do is to install CentOS 3.9 in a Virtual Machine, try to use my build scripts there and try to solve it. But I don't know when I could get around to try that :( And other than that, there is little left I can do.

The best solution for you, if possible, would be to upgrade your system up to RHEL or CentOS 5.x or 6.x.

Best regards,
Bruno

johny October 28, 2010 10:06

Thanks Bruno for the support....I think I got to ask the administrator for an urgent update !!!

Quote:

Originally Posted by wyldckat (Post 281190)
Hi Jonhy,

Well, I did say:After some online searching, it seems that fenv.h is part of more recent versions of libc.so.6 (this is the proper name for it, not libc6 like I said before :(), but I didn't find from since when.

If you still have access to the RedHat service (or if your system's administrator still has access), you should be entitled to at least ask them for support about this issue. And my guess is that you better act quickly, because of this: Red Hat Enterprise Linux 3 & CentOS 3 end-of-life announced

From my part, the only I could try to do is to install CentOS 3.9 in a Virtual Machine, try to use my build scripts there and try to solve it. But I don't know when I could get around to try that :( And other than that, there is little left I can do.

The best solution for you, if possible, would be to upgrade your system up to RHEL or CentOS 5.x or 6.x.

Best regards,
Bruno


maruthamuthu_venkatraman October 29, 2010 09:49

OpenFOAM1.7.x installation on RHEL 4.0 cluster
 
Hello,
I understand from the forum and from others that installing OF1.7.x is not a trivial task in RHEL 4.0. However its not impossible. So I need some of your suggestion to get it done.

gcc in the system is quite old version i.e. gcc 3.4.6. It need to be updated, but when I run the foamSystemCheck it says system pass and asked me to do OF installation. I hope its not working .

Anyhow the recent version of gcc4.4. cannot be compiled in RHEL ?? If so is it possible to get a compiled gcc4.4. and its dependencies from some where and shall use it for compiling the sources.

Thanks in advance

wyldckat October 30, 2010 07:53

Greetings Venkatraman,

Like I told Jonhy, the only way for me to build gcc 4.4.x in an old RHEL like system, would be for me to install CentOS 3.9, or in your case, CentOS 4.

You can try using the ThirdParty package from CentFOAM, that already comes with gcc 4.4.4 pre-built, but it's only for x86_64 and it's not guaranteed that it will work in older RHEL, since that version was built for RHEL series 5.

Last week I posted about my findings on attempts for building gcc 4.4.4 with the latest glibc: Trying to include glibc in my build-gcc scripts...
It describes that I wasn't successful, but it felt that I was pretty close to being successful. But in the near future, I won't be able to investigate it any further :( So, if you have time to continue my investigation, feel free to do so ;)

By the way, a final note: I know that the latest git FreeFOAM (a variant/fork based on OpenFOAM that builds with CMake instead of wmake) is able to build with gcc 4.1.2. So, if you guys can at least build a version of gcc >= 4.1.2, then you can try FreeFOAM.

Best regards and good luck!
Bruno

maruthamuthu_venkatraman October 30, 2010 08:50

Dear Bruno,
Thanks for your replies. There are no plans to update the RHEL version in near future . So I need to live with this system for the time being .

Some told me that there is a possibility to copy the compiled gcc, gmp and mpfr ? and paste it on ThirdPaty-1.7.x/platforms/LinuxGcc location to solve this issue.

If you are aware about such thing, could you shed some light upon it?

Thanks


All times are GMT -4. The time now is 16:50.