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 install on RHEL 5.5 (https://www.cfd-online.com/Forums/openfoam-installation/80948-openfoam-install-rhel-5-5-a.html)

phinallydone October 12, 2010 02:03

OpenFOAM install on RHEL 5.5
 
I’m attempting to install OpenFOAM on RHEL 5.5. I’ve downloaded gcc44 and all necessary dependencies. How do I configure the source to use gcc44 (/usr/bin/gcc44) instead of gcc (/usr/bin/gcc)? Is this a setting in OpenFOAM-1.7.1/etc/bashrc? Thanks in advance.

wyldckat October 12, 2010 09:30

Greetings phinallydone,

I'm assuming you are using the x86_64 architecture version of RHEL. If so, scroll down in OpenFOAM's bashrc and search for this piece of code:
Code:

x86_64)
        case $WM_ARCH_OPTION in
        32)
            export WM_COMPILER_ARCH='-64'
            export WM_CC='gcc'
            export WM_CXX='g++'
            export WM_CFLAGS='-m32 -fPIC'
            export WM_CXXFLAGS='-m32 -fPIC'
            export WM_LDFLAGS='-m32'
            ;;
        64)
            WM_ARCH=linux64
            export WM_COMPILER_LIB_ARCH=64
            export WM_CC='gcc'
            export WM_CXX='g++'
            export WM_CFLAGS='-m64 -fPIC'
            export WM_CXXFLAGS='-m64 -fPIC'
            export WM_LDFLAGS='-m64'
            ;;
        *)
            echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
            ;;
        esac
        ;;

There simply change the gcc and g++ entries to gcc44 and g++44.

If you aren't using the x86_64 architecture version of RHEL, then you can simply export WM_CC and WM_CXX accordingly to your architecture.

Best regards,
Bruno

phinallydone October 13, 2010 11:51

Worked great. Thanks!

namCFD February 8, 2011 19:23

Hello Bruno,

I sincerely hope you can point me in the right direction.

Since my system gcc version is 4.1.2. I have installed a gcc version 4.4.5 in a /opt/gcc445 so the command "which gcc44" point to /opt/gcc445/bin/gcc44, and similarly for g++44.

I also changed the /etc/bashrc file accordingly to post #2 above.

The beginning of log file for Allwmake is:

Makefile:54: /home/hnguyen/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64gcc44/general: No such file or directory
Makefile:55: /home/hnguyen/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64gcc44/c++: No such file or directory
make: *** No rule to make target `/home/hnguyen/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64gcc44/c++'. Stop.

Thank you for your time and advice.

gwierink February 9, 2011 02:16

Hi Nam,

Quote:

Makefile:54: /home/hnguyen/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64gcc44/general: No such file or directory
Could it be that you need to make wmake rules for your new linux64gcc44 setup? Does this help?:

Code:

cp -r /home/hnguyen/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64Gcc /home/hnguyen/OpenFOAM/OpenFOAM-1.7.1/wmake/rules/linux64gcc44

namCFD February 9, 2011 17:08

Hello Gijs,

Thank you for your suggestion. I think I did this thing all wrong. I should have placed the compiler in the ThirdParty directory for it to work correctly as recommended by this

http://www.openfoam.com/archive/1.6/docs/README.php.

I will try this and update this post.

UPDATE:
So I stumbled upon these blogs by Bruno:

http://www.cfd-online.com/Forums/blo...-7-series.html

http://www.cfd-online.com/Forums/blo...-openfoam.html

Following these blogs and everything works. OpenFOAM-1.7.1 and ParaView 3.8.0 were installed on my Scientific Linux 5.5 (a clone of Enterprise Red Hat 5.5) 64 bit system.

Regards,

yss88 May 17, 2011 14:24

1 Attachment(s)
Hello,
since I have a similar problem with installing OF I decided to post here. I hope it isn't a problem :)
The cluster I am using has gcc44 installed in usr/bin/gcc44 and so far I changed the entries in bashrc as required in post #2 to gcc44 and g++44, but I still got some errors.
When running Allwmake from the Thirdparty directory I got the message that my compiler is not able to produce working executables, and running the Allwmake in apllications gave the errfile I've attached. I tried to find if there's g++44 but couldn't find it.
Maybe it would be best to compile gcc locally?
Thanks in advance for the help, I really appreciate it.

gwierink May 18, 2011 00:05

Hi Yavor,

Are those really all the errors you got? The log starts with applications and a bit further down it says "/usr/bin/ld: cannot find -lfiniteVolume". Did $WM_PROJECT_DIR/src actually compile properly?

yss88 May 19, 2011 03:52

Quote:

Originally Posted by gwierink (Post 308064)
Hi Yavor,

Are those really all the errors you got? The log starts with applications and a bit further down it says "/usr/bin/ld: cannot find -lfiniteVolume". Did $WM_PROJECT_DIR/src actually compile properly?

This is not the entire error log, because I stopped the compilation process when I saw these errors, but the /src couldn't compile properly also. I found that others have had the same error "cannot find -lfiniteVolume", but I decided to ask for some help not to mess up things :)

gwierink May 19, 2011 04:15

Aha, that's exactly the point. The error you got is quite late in the installation process, when you're compiling the applications. So, your src didn't compile properly. Do you have a build log of src?

yss88 May 22, 2011 04:15

1 Attachment(s)
Yes, I'm attaching it below.

gwierink May 22, 2011 04:32

Line 11 of your error log says
Quote:

OPwrite.C:29:17: error: mpi.h: No such file or directory
If you're compiling on a desktop, probably ThirdParty (openmpi) did not compile properly. If you're on a cluster (and using something else than the openmpi provided with ThirdParty) you need to specify where your MPI library lives. So, how did compilation of ThirdParty go?

yss88 May 22, 2011 04:57

1 Attachment(s)
I'm compiling on a cluster, and "which mpicxx" returns /opt/bin/mpich2/bin/mpicxx. I've attached the build logs from thirdparty.

gwierink May 22, 2011 06:43

Hmm, logfile line 17:
Quote:

configure: error: Could not run a simple C++ program. Aborting.
Have you set your compiler directives correctly, so that OpenFOAM can find gcc-4.4? Have a look here, it's a different cluster, but maybe it's useful ...

lishijie March 30, 2012 21:17

Hi,
now I want to install OpenFOAM 2.1.0 on RHEL5.5, and I have installed Gcc4.6.3, but OpenFOAM still can't make correct, how should I do?

wyldckat April 1, 2012 04:38

Greetings lishijie,

Quote:

Originally Posted by lishijie (Post 352367)
Hi,
now I want to install OpenFOAM 2.1.0 on RHEL5.5, and I have installed Gcc4.6.3, but OpenFOAM still can't make correct, how should I do?

I'm going to answer you with a quote from a recent thread:
Quote:

Originally Posted by linnemann (Post 351472)
Just install centFOAM

It will not do anything to your system.

It comes with its own GCC version 4.6.x.

There are multiple guides/help on how to compile OF on CentOS 5.x releases.

This thread has guide for OF-1.7 but the procedure is the same for 2.1
http://www.cfd-online.com/Forums/ope...-released.html

Best regards,
Bruno


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