|
[Sponsors] |
December 21, 2010, 03:50 |
Problems compiling OpenFOAM-1.5
|
#1 |
New Member
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 15 |
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 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. |
|
December 21, 2010, 14:52 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
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: http://www.cfd-online.com/Forums/ope...tml#post278809 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
__________________
|
|
December 22, 2010, 05:07 |
|
#3 |
New Member
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 15 |
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/[...] |
|
December 22, 2010, 18:36 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
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: http://www.cfd-online.com/Forums/ope...c-4-5-1-a.html - 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
__________________
|
|
December 23, 2010, 20:41 |
|
#5 |
New Member
maxwell
Join Date: Aug 2010
Posts: 3
Rep Power: 15 |
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 |
|
January 5, 2011, 05:51 |
|
#6 |
New Member
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 15 |
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 ... 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 |
|
January 5, 2011, 08:30 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
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 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
__________________
|
|
January 5, 2011, 10:17 |
|
#8 |
New Member
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 15 |
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 |
|
January 5, 2011, 10:35 |
|
#9 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Bo Terp,
Ah HA, finally I've figured out what's wrong Quote:
The relevant detail in particular is this: Quote:
Bruno
__________________
|
|||
January 6, 2011, 07:34 |
|
#10 |
New Member
Bo Terp Paulsen
Join Date: Oct 2010
Posts: 13
Rep Power: 15 |
Now, everything is compiling and working perfectly... Thank you very much for your help!
Kind regards, Bo Terp |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some Problems about the Boundary Conditions in OpenFoam | lzgwhy | OpenFOAM Running, Solving & CFD | 47 | October 10, 2017 08:33 |
[OpenFOAM] Paraview/Parafoam in OpenFoam 1.5 dev | titio | ParaView | 0 | December 9, 2009 12:13 |
[OpenFOAM] Paraview/Parafoam in OpenFoam 1.5 dev | titio | ParaView | 0 | December 9, 2009 12:12 |
OpenFoam for heat transport problems | Martin Lorenz (Lorenz) | OpenFOAM Running, Solving & CFD | 16 | March 18, 2009 03:05 |
Adventure of fisrst openfoam installation on Ubuntu 710 | jussi | OpenFOAM Installation | 0 | April 24, 2008 14:25 |