CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Installing 2.1.x (Repository Release) on RHEL 6.2 (http://www.cfd-online.com/Forums/openfoam-installation/101889-installing-2-1-x-repository-release-rhel-6-2-a.html)

socon009 May 16, 2012 11:09

Installing 2.1.x (Repository Release) on RHEL 6.2
 
1 Attachment(s)
Hello,

I am installing OpenFOAM-2.1.x (Repository Release) in the following directory:

/opt/OpenFOAM

Following insructions per the OpenFOAM website:

http://www.openfoam.org/download/git.php

First, I make sure that I obtain the repository:

Code:

yum install git
git clone git://github.com/OpenFOAM/OpenFOAM-2.1.x.git

Download ThirdParty-2.1.0.tgz to /opt/OpenFOAM from the following website:

https://sourceforge.net/projects/foam/files/foam/2.1.0/

Code:

cd /opt/OpenFOAM
tar xzf ThirdParty-2.1.0.tgz
mv ThirdParty-2.1.0 ThirdParty-2.1.x

Download dependent packages for RHEL 6.2 (i.e. assumed same as Fedora 15/16 dependent packages):

Code:

sudo yum groupinstall 'Development Tools'
sudo yum install openmpi openmpi-devel qt-devel qt-webkit-devel zlib-devel

Set environment variables:

Code:

export FOAM_INST_DIR=/data/app/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.x/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile

Check the system:

Code:

cd $WM_PROJECT_DIR/bin
./foamSystemCheck

"System check: PASS"

Set the number of processors for wmakeScheduler:

Code:

export WM_NCOMPPROCS=10
(This workstation has 12 local cores)

Run ./Allwmake

Code:

cd ..
sudo ./Allwmake

Thanks to Bruno and Tobi for instructions on how to make log and error files:

Code:

su
./Allwmake 1> make.log 2> error.log

The (truncated) error log (first ~90 KB of text) that I obtained is attached to this post in .txt format.

I truncated the log but included the last few lines that pertain to the exit status. Please let me know if I can clean up this error.log in a way that is easier for someone to debug. (I'd like to be able to help those that are able/willing to help me in whatever way I can.)

Unfortunately, this is only as far as I have been able to get. (You may see how far through the process I am by referring to the aforementioned link to OpenFOAM's instructional website)

I am skeptical of the following:

1. whether I have suitable environment variables;
2. whether I have all requisite packages to build on RHEL 6.2

Thank you very much for any help or insight that you are able to offer.

Best,
Shaun

wyldckat May 16, 2012 16:17

Hi Shaun,

Quote:

Originally Posted by socon009 (Post 361450)
I am installing OpenFOAM-2.1.x (Repository Release) in the following directory:

/opt/OpenFOAM

Baaaad idea, specially if you're building it as root. You're risking the safety of your workstation, because if you mess up 1 miserable command, you might break your OS installation.

But OK, moving onward, assuming you're an experienced Linux user.

Quote:

Originally Posted by socon009 (Post 361450)
Set environment variables:

Code:

export FOAM_INST_DIR=/data/app/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.x/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile


Uhm, you should decide where exactly you want OpenFOAM installed ;) Additionally, since you installed the system version of Open-MPI, here is what you should have:
Code:

export FOAM_INST_DIR=/opt/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.x/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile WM_MPLIB=SYSTEMOPENMPI

Secondly, since you're using RHEL, I believe that you need the following command to be execute before those lines of code:
Code:

module load openmpi-x86_64
I got this command from here: http://www.openfoam.org/download/fedora.php - it's the only thing needed for you and the 2.1.x version.
By the way: yes, the Fedora package list you used should be a good reference for RHEL as well.

The errors shown in the attached file indicate that Open-MPI was nowhere to be seen, possibly due to the missing previous module load command.

As for logging and reporting the errors, I usually suggest the following instructions:
  1. Run Allwmake like this:
    Code:

    ./Allwmake > make.log
  2. When it's done, edit the "make.log" file and search-and-replace any sensitive paths and names.
  3. Then compress the file like this:
    Code:

    tar -czf make.log.tar.gz make.log
  4. Finally, attach the file "make.log.tar.gz" in your next post.


Last but not least: when using RHEL or CentOS or SL, I usually suggest CentFOAM: http://sourceforge.net/apps/mediawik...itle=Main_Page

Best regards,
Bruno

socon009 May 16, 2012 19:14

Hey Bruno, great post!

1. CentFOAM was my fallback option. But I am determined to learn more about Linux. Therefore I am purposefully putting myself through this - no pain, no gain. :cool:

2a. I would actually prefer that each user have their own compilation of OpenFOAM so that when it comes time to modify the source, other users will not be affected by the changes made. (Does it matter that the system only allots ~3GB per user for their home directory?)

2b. Is there a way to reach the configuration mentioned above by this method? (My goal isn't to just get the software installed as much as it is to learn how Linux ticks.)

3a. I did NOT know that about Open-MPI. So I have installed the system version as opposed to the individual user version? Would one be required to load both in the same way? I'm terribly intrigued about environments, libraries, etc. -- Any resources you can offer would be quickly and thoroughly torn into. (Grade-A n00b here!)

3b. Can you please explain what this line is commanding?

Code:

[ -f foamDotFile ] && . foamDotFile WM_MPLIB=SYSTEMOPENMPI
My take on it is... "If the file 'foamDotFile' exists then source it." But now that you have added the WM_MPLIB argument, I am almost certained I have misinterpreted. :o

4. By the way, what tipped you off that OpenMPI was not loaded?

5. All of my tars had been compressing to a minimum of 150 KB (regardless of uncompressed size)... and I believe the maximum attachable file size is 97.7 KB. Any hints?

I will attempt again, as you have suggested.

Also, I just wanted to say how great it is to communicate with people who know their way around Linux. I am super eager to learn. :D

Thanks again,
Shaun

socon009 May 16, 2012 19:15

double-posted

wyldckat May 17, 2012 09:35

Hi Shaun,

Quote:

Originally Posted by socon009 (Post 361529)
2a. I would actually prefer that each user have their own compilation of OpenFOAM so that when it comes time to modify the source, other users will not be affected by the changes made. (Does it matter that the system only allots ~3GB per user for their home directory?)

2b. Is there a way to reach the configuration mentioned above by this method? (My goal isn't to just get the software installed as much as it is to learn how Linux ticks.)

I vaguely remember that OpenFOAM requires 1 to 2 GB for a full build...
Usually the principle for a system wide installation is simple:
  1. Build on your home folder.
  2. When completed, switch to root mode and copy the OpenFOAM-* and ThirdParty-* folders to the target place, such as "/opt/OpenFOAM".
  3. Edit the file "/opt/OpenFOAM/OpenFOAM-*/etc/bashrc" and change the installation path in the file.
  4. Change permissions:
    Code:

    chown -R root:root /opt/OpenFOAM
    chmod -R o-Xr /opt/OpenFOAM

    I'll have to check these two commands, but I think it's correct.

Quote:

Originally Posted by socon009 (Post 361529)
3a. I did NOT know that about Open-MPI. So I have installed the system version as opposed to the individual user version? Would one be required to load both in the same way? I'm terribly intrigued about environments, libraries, etc. -- Any resources you can offer would be quickly and thoroughly torn into. (Grade-A n00b here!)

3b. Can you please explain what this line is commanding?

Code:

[ -f foamDotFile ] && . foamDotFile WM_MPLIB=SYSTEMOPENMPI
My take on it is... "If the file 'foamDotFile' exists then source it." But now that you have added the WM_MPLIB argument, I am almost certained I have misinterpreted. :o

You've understood it correctly. What I added is used by OpenFOAM's bashrc file for exporting additional parameters. For more on this, read this blog post of mine: Advanced tips for working with the OpenFOAM shell environment

Quote:

Originally Posted by socon009 (Post 361529)
4. By the way, what tipped you off that OpenMPI was not loaded?

Says right in the error log that the mpi library wasn't being found.

Quote:

Originally Posted by socon009 (Post 361529)
5. All of my tars had been compressing to a minimum of 150 KB (regardless of uncompressed size)... and I believe the maximum attachable file size is 97.7 KB. Any hints?

The first errors are usually the most important ones. Edit the file and remove half of it or something like that...

Best regards,
Bruno

socon009 May 17, 2012 11:02

Quote:

Originally Posted by wyldckat (Post 361663)
I vaguely remember that OpenFOAM requires 1 to 2 GB for a full build...
Usually the principle for a system wide installation is simple:
  1. Build on your home folder.
  2. When completed, switch to root mode and copy the OpenFOAM-* and ThirdParty-* folders to the target place, such as "/opt/OpenFOAM".
  3. Edit the file "/opt/OpenFOAM/OpenFOAM-*/etc/bashrc" and change the installation path in the file.
  4. Change permissions:
    Code:

    chown -R root:root /opt/OpenFOAM
    chmod -R o-Xr /opt/OpenFOAM

    I'll have to check these two commands, but I think it's correct.

Ok, understanding this is actually very important to me, as this will not be the only software that I will need to install for multiple users.

What you have stated above sounds like the procedure for installing OpenFOAM as a local user utilizing fewer root privileges using the $HOME directory path, followed by the creation of a "back up" or "reference" installation to be controlled (and distributed to others) by the system admin.

After the initial installation in the user's home directory, the root must COPY, (leaving the original in its place), the installation to the /opt/OpenFOAM directory and modify the bashrc file as well privileges.

At this point, it seems that there will be two installations on the system. (1) in the local user's directory, and (2) in the system's /opt/OpenFOAM directory.

Would one then be able to take the installation located in /opt/OpenFOAM and copy it to other users' directories?

Following that logic, would the installation located in /opt/OpenFOAM then act as a "back-up" installation while the others are in full user control?

If this is right, then "Hurray!" - that's what I'm looking for. If not, thank you for your patience and let me know if I need to just RTFM :o :D

Thanks,
Shaun

wyldckat May 17, 2012 11:25

Hi Shaun,
Quote:

Originally Posted by socon009 (Post 361677)
Following that logic, would the installation located in /opt/OpenFOAM then act as a "back-up" installation while the others are in full user control?

If this is right, then "Hurray!" - that's what I'm looking for. If not, thank you for your patience and let me know if I need to just RTFM :o :D

The idea is to have a central installation, that users use without modifying. The original build is for the responsible to use as he/she deems necessary for updates and such.

The OpenFOAM user guide at least gives the idea that one should not modify the core code of OpenFOAM. Each user should always work on a copy of the tutorials, as well as building custom applications for themselves only. Example: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

I had assumed from the "/opt/OpenFOAM" reference that you were already familiar with the deb/rpm installations of OpenFOAM that exist for Ubuntu, Fedora and openSUSE.

As for installing other software to be shared with all users, it depends on the type of installation: if it's just a matter of installing, then you can do it directly as root. If you need to build code, do it in a safe place one or twice, to see what it really does... I know I wrote a longer description about this the other day... here we go: http://www.cfd-online.com/Forums/ope...tml#post360406 post #9

Best regards,
Bruno

socon009 May 17, 2012 12:04

[QUOTE=wyldckat;361505]
Code:

module load openmpi-x86_64
export FOAM_INST_DIR=/opt/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.x/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile WM_MPLIB=SYSTEMOPENMPI

Hmmm, returns...

Quote:

bash: mpicc: command not found
bash: mpicc: command not found
I also tried to find "mpicc" on my system. No luck. :eek:

But I definitely have tried "sudo yum install openmpi", etc., on multiple occassions.

Any thoughts? :confused:

wyldckat May 17, 2012 18:26

Hi Shaun,

This weekend perhaps I can checkout how this works, but for now I'd suggest that you check the manual for "module load":
Code:

man module
My guess is that there should be a second module for the development tools for Open-MPI.

Best regards,
Bruno

socon009 May 19, 2012 11:38

Ok, I will be sure to check this out.

While troubleshooting the missing soft links I discovered other issues with my system.

Seeing as there is no ubiquitously common knowledge that would help deduce what is causing the errors that I am experiencing, I want to thank everyone who has contributed thus far and take some time for personal study (and a possible system restore :eek:).

You guys are great. Thank you for your selfless service to others in the CFD and FOSS communities. I hope to one day do the same. :D

Best,
Shaun


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