CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.org] OpenFOAM 2.4.x on CentOS 6.5

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By kpsl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2015, 07:57
Default OpenFOAM 2.4.x on CentOS 6.5
  #1
New Member
 
Kris
Join Date: Nov 2010
Posts: 21
Rep Power: 15
kpsl is on a distinguished road
Dear Foamers,

as the title suggests I am trying to compile OpenFOAM-2.4.x on CentOS 6.5.

So far I have been following these instructions:
http://openfoamwiki.net/index.php/In...CentOS_SL_RHEL

I manage to compile all the third party compilers etc. just fine but when I get to compiling OpenFOAM I get the following error:

Code:
primitives/triad/triad.C:36: error: expected initializer before '<' token
primitives/triad/triad.C:39: error: expected initializer before '<' token
Now, according to my research on the forum and the rest of the internet, this error occurs when using gcc version 4.4 or lower.
See:
http://www.cfd-online.com/Forums/ope...edhat-el5.html

While CentOS 6.5 does come with gcc-4.4.7, I am, however, using gcc-4.8.4 as installed per the instructions on opwnfoamwiki.net.

Has anybody else encountered this issue and possibly found some kind of solution? Any help would be greatly appreciated.

Kind regards
Kris
kpsl is offline   Reply With Quote

Old   July 25, 2015, 08:41
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Kris,

Something went wrong while you were following the instructions. My guess is that when you executed this command:
Code:
source $HOME/OpenFOAM/OpenFOAM-2.4.x/etc/bashrc WM_NCOMPPROCS=4 foamCompiler=ThirdParty \
WM_COMPILER=Gcc48 WM_MPLIB=SYSTEMOPENMPI
the command string was broken. Because this is the same as running in a single line:
Code:
source $HOME/OpenFOAM/OpenFOAM-2.4.x/etc/bashrc WM_NCOMPPROCS=4 foamCompiler=ThirdParty WM_COMPILER=Gcc48 WM_MPLIB=SYSTEMOPENMPI
The other possibility is that the alias creation command wasn't successful, namely this command:
Code:
echo "alias of24x='module load openmpi-x86_64; source \$HOME/OpenFOAM/OpenFOAM-2.4.x/etc/bashrc $FOAM_SETTINGS'" >> $HOME/.bashrc
Or perhaps even that the following command wasn't properly used:
Code:
wmSET $FOAM_SETTINGS
To help diagnose the problem, please let me know what the following commands give you:
Code:
echo $FOAM_SETTINGS

grep "alias" ~/.bashrc
Best regards,
Bruno
kpsl likes this.
__________________
wyldckat is offline   Reply With Quote

Old   July 27, 2015, 06:50
Default
  #3
New Member
 
Kris
Join Date: Nov 2010
Posts: 21
Rep Power: 15
kpsl is on a distinguished road
Dear Bruno,

first off, thank you very much for your quick response
Your first hunch was indeed correct in that I was not sourcing correctly.

I am forced to install in an alternative location because my $HOME directory is a network mount and thus very slow compared to my local drives. Looking back I should have just created a symbolic link in ~/OpenFOAM, thus enabling me to follow your instructions exactly, but instead I was sourcing as follows in my .bashrc:

Code:
module load openmpi-x86_64
export FOAM_INST_DIR=/data/app/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.4.x/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile
WM_NCOMPPROCS=6 
foamCompiler=ThirdParty
WM_COMPILER=Gcc48 
WM_MPLIB=SYSTEMOPENMPI
This of course meant that the $FOAM_SETTINGS were not defined correctly and that OpenFoam would use the system's compiler regardless of my settings.
Thanks to your hint I changed the relevant entry in my .bashrc to the following:
Code:
module load openmpi-x86_64
export FOAM_INST_DIR=/data/app/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.4.x/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile WM_NCOMPPROCS=6 foamCompiler=ThirdParty WM_COMPILER=Gcc48 WM_MPLIB=SYSTEMOPENMPI
As a result the settings are now correctly defined:
Code:
echo $FOAM_SETTINGS
WM_NCOMPPROCS=6 foamCompiler=ThirdParty WM_COMPILER=Gcc48 WM_MPLIB=SYSTEMOPENMPI
and OF compiles without a hitch. I also managed to compile ParaView 4.10 with python support and mpi as per your instructions.

Thank you very much for your help and for your excellent guidance. Keep up the great work
Kris
wyldckat likes this.
kpsl is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 06:15
Difference between OpenFOAM on Centos 7 and On Windows 10 (cygwin) JensGoldberg OpenFOAM Programming & Development 0 November 10, 2016 03:30
[OpenFOAM.org] Paraview install failing (With OpenFOAM 3.0.0 and CentOS 7) davidrobinson50 OpenFOAM Installation 1 June 2, 2016 17:54
OpenFOAM 1.6 package - CentOS 5.3 x86_64 linnemann OpenFOAM Installation 36 September 2, 2009 12:46


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