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

install OpenFoam 1.6 by building source: how?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 2, 2009, 23:45
Default install OpenFoam 1.6 by building source: how?
  #1
New Member
 
Join Date: Sep 2009
Posts: 6
Rep Power: 17
niudie is on a distinguished road
Dear Foamers,

I am experiencing problems while building OF 1.6 from source. I tried several times and failed. I followed the README but still found something is not so clear in it. The following are what I trying to do, what I understood about the README and what confused me:

I want to install OF 1.6 by completely building from the source, both OF 1.6 and the third party stuff.

I downloaded OpenFOAM-1.6.General.gtgz ThirdParty-1.6.General.gtgz and extracted the packages following the README without problems. My system is i386/i686 with SLED 10 SP2, gcc 4.1.2. The gcc is too old according to the doc. I need a gcc 4.3.3. We have a gcc-4.3.3 source in the ThirdParty dir. The following is the Allwmake script in the top-level install dir:
--------------
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x

# wmake is required for subsequent targets
( cd wmake/src && make )

# build ThirdParty sources
( cd $WM_THIRD_PARTY_DIR && ./Allwmake )

src/Allwmake
applications/Allwmake

if [ "$1" = doc ]
then
doc/Allwmake
fi

# ----------------------------------------------------------------- end-of-file

It seems it will build all the third party source before building openfoam. If so, gcc-4.33 would be built before building openfoam. Would that mean I could use my system native gcc-4.1.2 to build third party stuff (including gcc-4.3.3)? Or I must install a gcc-4.3.3 binary first in the designated dir: $WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/ ? The gcc-4.3.3 binary would build everything, even including the gcc-4.3.3 in the third party source?

Thanks in advance.

Niudie
niudie is offline   Reply With Quote

Old   September 3, 2009, 03:09
Default
  #2
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Niudi,

What are the error messages you get? I also had these problem and I just went line by line through the make scripts and found some libraries missing (in my case the binutils and zlib development packages). I installed them and it worked.

Best regards,

Gijs
gwierink is offline   Reply With Quote

Old   September 3, 2009, 04:16
Default mainly lib linking problems
  #3
New Member
 
Join Date: Sep 2009
Posts: 6
Rep Power: 17
niudie is on a distinguished road
Hi Gijs,

Thanks for your reply.

Very often the error message as follows:
------------------------------------------------------------
...
...
/usr/bin/ld: cannot find -lfiniteVolume
collect2: ld returned 1 exit status
make[2]: *** [/home/guo/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/sonicLiquidFoam] Error 1
make[1]: *** [sonicLiquidFoam] Error 2
make[1]: Target `application' not remade because of errors.
make: *** [compressible] Error 2
Making dependency list for source file dsmcFoam.C
/usr/bin/ld: cannot find -lmeshTools
collect2: ld returned 1 exit status
make[3]: *** [/home/guo/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/dsmcFoam] Error 1
make[2]: *** [dsmcFoam] Error 2
make[2]: Target `application' not remade because of errors.
make[1]: *** [dsmc] Error 2
Making dependency list for source file mdEquilibrationFoam.C
/usr/bin/ld: cannot find -lmeshTools
collect2: ld returned 1 exit status
make[3]: *** [/home/guo/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/mdEquilibrationFoam] Error 1
make[2]: *** [mdEquilibrationFoam] Error 2
...
...
------------------------------------------------------------------------------------------------------
and many lines like above. I used gcc-4.3.3 from the third-party binary pack. Seems that the LD_LIBRARY_PATH with something wrong, or the libs never built. I am currently going through line by line the make tree. I would appreciate your advices or tricks.

Best regards,

Niudie
niudie is offline   Reply With Quote

Old   September 3, 2009, 08:59
Default
  #4
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Niudie,

I had the same trouble. In the OpenFOAM Wiki it says that these errors of "cannot find -lsomething" goes away after a second compilation run. That didn't work for me and I went step by step through the Allwmake file in src. Along the way I found that I missed flex, installed it and compiled step by step.

Best regards,

Gijs
gwierink is offline   Reply With Quote

Old   September 3, 2009, 10:44
Default
  #5
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
I made a short-hand guide, which you actually can run as a script (I take no responsibility for a complete screw-up, though) here: http://hvirvel.com/installOF

I just checked it under a new and clean user account in Ubuntu 9.04. Please let me know if it works (if you haven't managed otherwise).

If you do not have an apt-get-Linux, the apt-get line should hint what libs are needed.


/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   September 4, 2009, 01:57
Default Solved
  #6
New Member
 
Join Date: Sep 2009
Posts: 6
Rep Power: 17
niudie is on a distinguished road
Hi Gijs,

The installation by building source is done. The problem resulted from missing the third-party source ( I should have read the README more carefully). building openfoam source needs something from the third party source, otherwise libs like decompositionMethods wouldn't be built and a lot of further building steps would get errors of missing libs. Some important points as below:

1) needs a gcc-4.3.3, I used the one from the third-party binary packaged.
2) the third-party source must be present in a correct path as defined in the bashrc ( in etc/).

Thanks for your discussion and hints.

Best regards,

Niudie
niudie is offline   Reply With Quote

Old   September 4, 2009, 02:02
Default
  #7
New Member
 
Join Date: Sep 2009
Posts: 6
Rep Power: 17
niudie is on a distinguished road
Hi Mads,

Thanks for your script. I solved my problem before reading your post. I may try your script in another computer with RHLE and share the infos.

Best regards,

Niudie
niudie is offline   Reply With Quote

Old   September 5, 2009, 15:47
Default
  #8
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
Hi Niudie. Super.

I've just updated the apt-get section of the script with a few more libs that was needed.


/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   February 5, 2010, 05:01
Default wmake & "make distclean"
  #9
New Member
 
Bart Weisser
Join Date: Feb 2010
Posts: 4
Rep Power: 16
bart_weisser is on a distinguished road
Hello there:

First time user here! I have been trying to figure out how to get wmake and the make script "distclean" from Debian Lenny (or any distro for all that matter). When I did a makeall on the ThirdParty stuff, it kept complaining either about wmake or having no idea what to do with "make distclean". Perhaps someone could lend a hand? I have been at this for the last three days

Thanks a million, Bart.
bart_weisser is offline   Reply With Quote

Old   February 5, 2010, 05:36
Default
  #10
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
May I suggest:

1) install Ubuntu 9.10 from scratch
2) run the OpenFOAM installation script found in my signature, line by line
3) foam away

/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   April 26, 2011, 01:10
Default
  #11
Member
 
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 16
cheng1988sjtu is on a distinguished road
Hi All,

I'm compiling openfoam1.7.1 on cluster using intel as compiler and openmpi-1.4.3, However , I encountered this error
HTML Code:
+ wmake libso mpi
make: *** No rule to make target `/home/44792/OpenFOAM/ThirdParty-1.7.1/platforms/linux64Gcc/openmpi-1.4.1/include/mpi.h', needed by `Pstream.dep'.  Stop.
......
icpc: command line remark #10279: option '-xT' is deprecated and will be removed in a future release. See '-help deprecated'
lnInclude/pTraits.H(71): warning #597: "Foam::pTraits<PrimitiveType>::operator Foam::vector() const [with PrimitiveType=Foam::vector]" will not be called for implicit or explicit conversions
          operator PrimitiveType() const
          ^
          detected during:
            instantiation of class "Foam::pTraits<PrimitiveType> [with PrimitiveType=Foam::vector]" at line 87 of "lnInclude/Field.H"
            instantiation of class "Foam::Field<Type> [with Type=Foam::vector]" at line 146 of "lnInclude/edgeI.H"

lnInclude/pTraits.H(76): warning #597: "Foam::pTraits<PrimitiveType>::operator Foam::vector &() [with PrimitiveType=Foam::vector]" will not be called for implicit or explicit conversions
          operator PrimitiveType&()
          ^
          detected during:
            instantiation of class "Foam::pTraits<PrimitiveType> [with PrimitiveType=Foam::vector]" at line 87 of "lnInclude/Field.H"
            instantiation of class "Foam::Field<Type> [with Type=Foam::vector]" at line 146 of "lnInclude/edgeI.H"
I'm pretty sure in some file that I didn't assign the right path, however, I cann't find which file.

I've changed the $WM_COMPILER=Icc,

and I've changed $MPI_ARCH_PATH=/usr/mpi/intel/openmpi-1.4.3

Also, I've changed the ~/.cshrc, and sourced that.

This could be due to the previous failure when I'm trying to compile using ThirdParty-1.7.1, However, I was told that in cluster, if I want to use parallel computing, I'd better use the system openmpi and compiler, so how can I clean the previous stored path?

Any help will be highly appreciated, I've been stucked here for a while.
cheng1988sjtu is offline   Reply With Quote

Old   April 26, 2011, 01:18
Default Btw
  #12
Member
 
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 16
cheng1988sjtu is on a distinguished road
BTW, I've tried to compile use default gcc/openmpi, but the pre-installed gcc is just 4.1.2, way too old for openfoam1.7.1, since I don't have the root right, I can only try intel as compiler.
the icc version is 12.0.0
cheng1988sjtu is offline   Reply With Quote

Old   April 26, 2011, 01:25
Default
  #13
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Charlie,

It looks like you're having Pstream trouble. You need to set WM_COMPILER etc, as you did, but also provide some wmake rules so that the compiler can find the mpi libraries on your system. Have a look here how I rigged up wmake rules to make OpenFOAM compile.
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   April 26, 2011, 01:48
Default Thank you!
  #14
Member
 
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 16
cheng1988sjtu is on a distinguished road
Thank you very much for you reply.

It think that's what I need. I'll try it tomorrow and let you know the result.
cheng1988sjtu 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 Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43
install openfoam 1.6 on opensuse 11.0 andresbh OpenFOAM Installation 8 September 30, 2009 01:48
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 05:55
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


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