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

Problems compiling OpenFOAM-1.5

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 21, 2010, 04:50
Default Problems compiling OpenFOAM-1.5
  #1
New Member
 
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 6
botp is on a distinguished road
Hi,

I am currently trying to compile OpenFOAM-1.5, by including one line at a time in the OpenFOAM-1.5/Allwmake file. There were no compiler errors before I included the line
"(cd src && ./Allwmake)".

The following is copied from the compiler output:

Code:
+ wmake libso dynamicMesh
SOURCE=fvMeshDistribute/fvMeshDistribute.C ;  g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3  -DNoRepository -ftemplate-depth-40 -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/src/meshTools/lnInclude -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/src/triSurface/lnInclude -IlnInclude -I. -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/fvMeshDistribute.o
In file included from fvMeshDistribute/fvMeshDistribute.H:398,
                 from fvMeshDistribute/fvMeshDistribute.C:27:
fvMeshDistribute/fvMeshDistributeTemplates.C: In static member function `static void Foam::fvMeshDistribute::sendFields(Foam::label, const Foam::wordList&, const Foam::fvMeshSubset&)':
fvMeshDistribute/fvMeshDistributeTemplates.C:294: error: expected primary-expression before '>' token
make: *** [Make/linux64GccDPOpt/fvMeshDistribute.o] Error 1
+ wmake libso dynamicFvMesh
/usr/bin/ld: cannot find -ldynamicMesh
collect2: ld returned 1 exit status
make: *** [/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libdynamicFvMesh.so] Error 1
+ wmake libso topoChangerFvMesh
/usr/bin/ld: cannot find -ldynamicFvMesh
collect2: ld returned 1 exit status
make: *** [/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libtopoChangerFvMesh.so] Error 1
+ wmake libso fvMotionSolver
/usr/bin/ld: cannot find -ldynamicMesh
collect2: ld returned 1 exit status
make: *** [/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfvMotionSolvers.so] Error 1
+ wmake libso engine
/usr/bin/ld: cannot find -ldynamicMesh
collect2: ld returned 1 exit status
make: *** [/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libengine.so] Error 1
+ wmake libso ODE
'/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libODE.so' is up to date.
+ wmake libso randomProcesses
'/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/librandomProcesses.so' is up to date.
+ cd thermophysicalModels
+ ./Allwmake
As seen, do the "Error 1" occur several times. Anyone who has a suggestion how to solve this problem?

Kind regards,
Bo Terp


PS. I know that 1.5 is an old version, but I use a utility developed and tested in OF-1.5, so I would like to stay with that version.
botp is offline   Reply With Quote

Old   December 21, 2010, 15:52
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,521
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Bo Terp,

If I'm not mistaken, OpenFOAM 1.5 will only build with gcc versions up to 4.3.x (x>=0). So, the error you are getting is probably due to your gcc version being 4.4.x or 4.5.x.

Usually, Linux distros have an older gcc version available in their repositories. For example, Ubuntu 10.10 has gcc 4.4.4 by default, but you can also install gcc 4.3.5 and 4.1.2. For example, I've got these three installed in my Ubuntu installation (altough I don't remember installing all of them...). Oh, you'll need both gcc and g++! These older versions can be called by running gcc-4.3 and gcc-4.1.

As for changing the gcc version to be used by OpenFOAM's wmake, see this post: OpenFOAM install on RHEL 5.5


If you still have problems compiling OpenFOAM 1.5, it would be easier if we knew the Linux distribution you are using and gcc/g++ version you are using.

Best regards and good luck!
Bruno
wyldckat is offline   Reply With Quote

Old   December 22, 2010, 06:07
Default
  #3
New Member
 
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 6
botp is on a distinguished road
Thank you very much for your quick reply!

I think you are right that the errors are due to an incorrect compiler version; but unfortunately I am still doing it wrong...

I have tried to use the gcc compiler (4.3.3) from the ThirdParty directory by making the following changes to the bashrc and settings.sh, but it was unsuccessful... I still get the same compiler errors.

Is it actually possible to link to ThirdParty or do I need to install the compiler locally on the system?

Kind regards,
Bo Terp

Ps. All help is truly appreciated!


System information:
Distribution: CentOS 4.6 (Working on a cluster with no administrator privileges)
gcc: gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9)

Changes in /OpenFOAM-1.5-dev/etc/bashrc:
WM_CC='gcc' ----> WM_CC='gcc43'
WM_CXX='g++'----> WM_CXX='g++43'

Changes in /OpenFOAM-1.5-dev/etc/settings.sh:
compilerInstall=System ---> compilerInstall=OpenFOAM
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH ----> [...]/gcc-4.3.3/[...]
botp is offline   Reply With Quote

Old   December 22, 2010, 19:36
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,521
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Bo Terp,

You could have said it before, that you were trying to build OpenFOAM 1.5-dev! The "-dev" version is very different from the official 1.5 version! The 1.5-dev version has received far more updates than the official 1.5 and 1.5.x versions of OpenFOAM!
The 1.5-dev version is know to even build with gcc 4.5.1!!

Here is a thread about it: 1.5-dev GCC-4.5.1 - you can start reading from post #8, because that's where I start to explain how I managed to build it with gcc 4.5.1
Although, I suggest using gcc 4.4.4 or 4.4.5, because I'm not sure if 1.5-dev is fully compatible with gcc 4.5.1. But it should also work quite well with gcc 4.3.3!

Best regards and good luck!
Bruno
wyldckat is offline   Reply With Quote

Old   December 23, 2010, 21:41
Default
  #5
New Member
 
maxwell
Join Date: Aug 2010
Posts: 3
Rep Power: 7
randomid is on a distinguished road
the same as me when compiling openfoam-1.5-dev,
my system compiler version is 4.4.*,and i put a pre-compile gcc 4.3.3 in the ThirdParty directory, but the compile process may be use the system compiler.


SOURCE=writePointSet.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=1861 -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -DREADLINE=1 -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/meshTools/lnInclude -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/writePointSet.o
SOURCE=writeFuns.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=1861 -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -DREADLINE=1 -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/meshTools/lnInclude -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/writeFuns.o
SOURCE=writePatch.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=1861 -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -DREADLINE=1 -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/meshTools/lnInclude -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/writePatch.o
SOURCE=setSet.C ; g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=1861 -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -DREADLINE=1 -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/meshTools/lnInclude -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/setSet.o
g++ -m32 -Dlinux -DDP -DFOAM_DEV_REVISION_NUMBER=1861 -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -DREADLINE=1 -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/meshTools/lnInclude -IlnInclude -I. -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/root/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -pthread Make/linuxGccDPOpt/writePointSet.o Make/linuxGccDPOpt/writeFuns.o Make/linuxGccDPOpt/writePatch.o Make/linuxGccDPOpt/setSet.o -L/root/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt \
-lmeshTools -lreadline -lncurses -lOpenFOAM -ldl -lm -o /root/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linuxGccDPOpt/setSet
/usr/bin/ld: cannot find -lmeshTools
collect2: ld returned 1 exit status
make[3]: *** [/root/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linuxGccDPOpt/setSet] Error 1
make[2]: *** [setSet] Error 2
randomid is offline   Reply With Quote

Old   January 5, 2011, 06:51
Default
  #6
New Member
 
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 6
botp is on a distinguished road
Hi,

I am still struggling with compiling OpenFOAM-1.5-dev.
Several of the previous problems with the compiler version etc. have been solved and I have been able to run ./Allwake in the src directory successfully.

But, when running ./Allwmake in the applications directory I get the following error
Code:
...

+ cd applications
+ ./Allwmake
+ cd solvers
+ wmake all
g++ -m64 -Dlinux64 -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/cfdTools     -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude     -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/thermophysicalModels/basic/lnInclude     -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/turbulenceModels/RAS -IlnInclude -I. -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude   -fPIC Make/linux64GccDPOpt/rhoSimpleFoam.o -L/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt \
     -lfiniteVolume     -lmeshTools     -lbasicThermophysicalModels     -lspecie     -lcompressibleRASModels     -llduSolvers -lOpenFOAM -liberty -ldl   -lm -o /home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/rhoSimpleFoam
g++ -m64 -Dlinux64 -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude     -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/randomProcesses/lnInclude     -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/sampling/lnInclude -IlnInclude -I. -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude   -fPIC Make/linux64GccDPOpt/dnsFoam.o -L/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt \
     -lfiniteVolume     -lrandomProcesses     -lsampling     -lmeshTools -lOpenFOAM -liberty -ldl   -lm -o /home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/dnsFoam
/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make[2]: *** [/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/rhoSimpleFoam] Error 1
make[1]: *** [rhoSimpleFoam] Error 2
/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make[2]: *** [/home/afm/afmbtp/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linux64GccDPOpt/dnsFoam] Error 1
make[1]: *** [dnsFoam] Error 2
make[1]: Target `application' not remade because of errors.
make: *** [DNS] Error 2

...
When looking around the forum I can see that /usr/bin/ld: cannot find -l<something> is a common error, but I haven't been able to find an explanation for the /usr/bin/ld: cannot find -lOpenFOAM.

Anyone who has a suggestion what causes this error?

I am using ThirdParty from OF-1.6, and the gcc-rules (./wmake/rules/linux64Gcc) from OF-1.7.0. I.e. gcc.4.3.3, gmp-4.2.4 and mpfr-2.4.1. Besides that I have exported WM_64=on as suggested here

Kind regards,
Bo Terp
botp is offline   Reply With Quote

Old   January 5, 2011, 09:30
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,521
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

I should have posted this on my first post here on this thread, but I guess it's better late than ever

OK, got to the base project folder for OpenFOAM 1.5-dev and run Allwmake like this:
Code:
cd $WM_PROJECT_DIR
./Allwmake > make.log 2>&1
tar -czf make.log.tar.gz make.log
This will keep a log of the build process and the last line will compress the log into a gzip tarball. Then please attach the compressed log file to your next post. This way we can be certain of what is going on, otherwise we'll just be trying to guess what is wrong.

edit: @Bo Terp, that blog post seems to be referring to OpenFOAM 1.3, so the "WM_64=on" is no longer needed for newer OpenFOAM versions. But that reference to installing binutils-dev is still valid for modern versions OpenFOAM!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 5, 2011, 11:17
Default
  #8
New Member
 
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 6
botp is on a distinguished road
Hi Bruno and thank you for your quick reply,

I have attached the log file as suggested in your previous post; hopefully this file will reveal the source of all the compiler errors...

Regarding the binutils-dev I am not sure if this is installed or not. I have tried to download the source code and compile it, but I have my doubts whether it succeeded... And since I am not sure whether this is the source of my errors, I didn't spend to much time on it.

Your help is appreciated!

Kind regards,
Bo Terp


Attached Files
File Type: gz make.log.tar.gz (25.8 KB, 2 views)
botp is offline   Reply With Quote

Old   January 5, 2011, 11:35
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,521
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Bo Terp,

Ah HA, finally I've figured out what's wrong
Quote:
Code:
+ wmake libso OpenFOAM
linux64GccDPOpt/options:14: *** missing separator.  Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created
I've already come across these issues in the past, as you can see here: 1.5-dev GCC-4.5.1
The relevant detail in particular is this:
Quote:
Originally Posted by wyldckat View Post
remove those pesky "//" lines from the files files and options that some libraries have... namely:
Code:
src/OpenFOAM/Make/options
src/engine/Make/files
Good luck!
Bruno
wyldckat is offline   Reply With Quote

Old   January 6, 2011, 08:34
Default
  #10
New Member
 
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 6
botp is on a distinguished road
Now, everything is compiling and working perfectly... Thank you very much for your help!

Kind regards,
Bo Terp
botp is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some Problems about the Boundary Conditions in OpenFoam lzgwhy OpenFOAM Running, Solving & CFD 13 July 8, 2014 06:17
Paraview/Parafoam in OpenFoam 1.5 dev titio OpenFOAM Post-Processing 0 December 9, 2009 13:13
Paraview/Parafoam in OpenFoam 1.5 dev titio OpenFOAM Paraview & paraFoam 0 December 9, 2009 13:12
OpenFoam for heat transport problems Martin Lorenz (Lorenz) OpenFOAM Running, Solving & CFD 16 March 18, 2009 04:05
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


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