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

Building OpenFOAM1.7.0 from source

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2012, 17:47
Default
  #41
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
Hello,

I am trying to compile OF 1.7.1 in Kubuntu 11.10 and am getting errors. I am not sure if it is important but I already have OF 2.1.0 installed and working fine.

versions:
g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
flex 2.5.35


I installed the additional dependencies as suggested above:
Code:
 sudo apt-get install binutils-dev flex bison git-core  build-essential python-dev libreadline5-dev wget zlib1g-dev cmake  libpng12-dev libxt-dev libxi-dev libxrender-dev libxrandr-dev  libxcursor-dev libxinerama-dev libfreetype6-dev libfontconfig1-dev  libglib2.0-dev freeglut3-dev libqt4-dev qt4-dev-tools
The only one that I couldn't install is libreadline5-dev because it is not available in 11.10. However, I do have libreadline-dev installed, I am not sure if this is ok or if libreadline5-dev specifically is needed.

After I run:
Code:
./Allwmake > make.log 2>&1
The log file looks okay until eventually:
Code:
+ wmake all solvers
make[1]: Entering directory `/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/DNS'
make[2]: Entering directory `/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/DNS/dnsFoam'
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude     -I/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/src/randomProcesses/lnInclude     -I/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/src/sampling/lnInclude -IlnInclude -I. -I/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude -I/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/src/OSspecific/POSIX/lnInclude   -fPIC Make/linux64GccDPOpt/dnsFoam.o -L/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt \
	     -lfiniteVolume     -lrandomProcesses     -lsampling     -lmeshTools -lOpenFOAM -liberty -ldl   -lm -o /home/mdenno/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/dnsFoam
/usr/bin/ld: Make/linux64GccDPOpt/dnsFoam.o: undefined reference to symbol 'Foam::OPstream::write(Foam::Pstream::commsTypes, int, char const*, long)'
/usr/bin/ld: note: 'Foam::OPstream::write(Foam::Pstream::commsTypes, int, char const*, long)' is defined in DSO /home/mdenno/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/openmpi-1.4.1/libPstream.so so try adding it to the linker command line
/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/openmpi-1.4.1/libPstream.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/dnsFoam] Error 1
make[2]: Leaving directory `/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/DNS/dnsFoam'
make[1]: *** [dnsFoam] Error 2
make[1]: Target `application' not remade because of errors.
make[1]: Leaving directory `/home/mdenno/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/DNS'
make: *** [DNS] Error 2
And the errors keep going...

Any thoughts?

Last edited by mgdenno; May 14, 2012 at 17:51. Reason: md5sums do match
mgdenno is offline   Reply With Quote

Old   May 14, 2012, 18:39
Default
  #42
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 Matthew,

Well, OpenFOAM 1.7.1 isn't compatible with Gcc 4.6.1 See here: http://openfoamwiki.net/index.php/In...tion_.28GCC.29

You can either install Gcc 4.4.x that Ubuntu 11.10 has or make a custom build of Gcc 4.4.x or 4.5.x. For then using Gcc 4.4.x... there are a few explanations: GCC and other compiler issues with OpenFOAM - but the best one might be described here, "On how to use gcc44 in RHEL/CentOS/Rocks": OpenFOAM install on RHEL 5.5

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 14, 2012, 20:48
Default
  #43
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
Bruno,

Thanks so much for the advice.

It is compiling now...

Matt
mgdenno is offline   Reply With Quote

Old   March 5, 2022, 13:34
Default Keep geting similar errors in OpenFOAM 2.4.0
  #44
New Member
 
Yovanny Morales Hernández
Join Date: May 2018
Posts: 11
Rep Power: 7
yMorH is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Matthew,

Well, OpenFOAM 1.7.1 isn't compatible with Gcc 4.6.1 See here: http://openfoamwiki.net/index.php/In...tion_.28GCC.29

You can either install Gcc 4.4.x that Ubuntu 11.10 has or make a custom build of Gcc 4.4.x or 4.5.x. For then using Gcc 4.4.x... there are a few explanations: GCC and other compiler issues with OpenFOAM - but the best one might be described here, "On how to use gcc44 in RHEL/CentOS/Rocks": OpenFOAM install on RHEL 5.5

Best regards,
Bruno
I tried to install OpenFOAM-2.4.0 following the instructions of post #4, however I keep getting similar errors:

HTML Code:
g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -I../solidDisplacementFoam -ItractionDisplacementCorrectionStress -I/home/qbex/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude -I/home/qbex/OpenFOAM/OpenFOAM-2.4.0/src/meshTools/lnInclude -IlnInclude -I. -I/home/qbex/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude -I/home/qbex/OpenFOAM/OpenFOAM-2.4.0/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linuxGccDPOpt/tractionDisplacementCorrectionFvPatchVectorField.o Make/linuxGccDPOpt/solidEquilibriumDisplacementFoam.o -L/home/qbex/OpenFOAM/OpenFOAM-2.4.0/platforms/linuxGccDPOpt/lib \
     -lfiniteVolume -lmeshTools -lOpenFOAM -ldl   -lm -o /home/qbex/OpenFOAM/OpenFOAM-2.4.0/platforms/linuxGccDPOpt/bin/solidEquilibriumDisplacementFoam
/home/qbex/OpenFOAM/OpenFOAM-2.4.0/platforms/linuxGccDPOpt/lib/libtriSurface.so: undefined reference to `yyFlexLexer::yywrap()'
collect2: error: ld returned 1 exit status
/home/qbex/OpenFOAM/OpenFOAM-2.4.0/wmake/Makefile:149: recipe for target '/home/qbex/OpenFOAM/OpenFOAM-2.4.0/platforms/linuxGccDPOpt/bin/solidEquilibriumDisplacementFoam' failed
make[2]: *** [/home/qbex/OpenFOAM/OpenFOAM-2.4.0/platforms/linuxGccDPOpt/bin/solidEquilibriumDisplacementFoam] Error 1
make[2]: Leaving directory '/home/qbex/OpenFOAM/OpenFOAM-2.4.0/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam'
/home/qbex/OpenFOAM/OpenFOAM-2.4.0/wmake/MakefileApps:39: recipe for target 'solidEquilibriumDisplacementFoam' failed
make[1]: *** [solidEquilibriumDisplacementFoam] Error 2
make[1]: Target 'application' not remade because of errors.
make[1]: Leaving directory '/home/qbex/OpenFOAM/OpenFOAM-2.4.0/applications/solvers/stressAnalysis'
/home/qbex/OpenFOAM/OpenFOAM-2.4.0/wmake/MakefileApps:39: recipe for target 'stressAnalysis' failed
make: *** [stressAnalysis] Error 2
make: Target 'application' not remade because of errors.
I am asking is those errors are related to your statements in post #42, gcc version 5.4.0. I have attached the make log to this post.

Thanks in advance for your time.
Attached Files
File Type: zip makelog.txt.zip (25.5 KB, 2 views)
Fouch likes this.

Last edited by yMorH; March 5, 2022 at 13:37. Reason: Forgot version of gcc
yMorH is offline   Reply With Quote

Old   March 6, 2022, 07:09
Default
  #45
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
The errors state that you don't have flex installed. Did you use a system flex or a ThirdParty flex? I don't think that a ThirdParty flex is well tested at all.
yMorH likes this.
olesen is offline   Reply With Quote

Old   March 6, 2022, 12:02
Default
  #46
New Member
 
Yovanny Morales Hernández
Join Date: May 2018
Posts: 11
Rep Power: 7
yMorH is on a distinguished road
Quote:
Originally Posted by olesen View Post
The errors state that you don't have flex installed. Did you use a system flex or a ThirdParty flex? I don't think that a ThirdParty flex is well tested at all.
I'm not sure about the answer to your question, I get the dependencies as posted in #4 after an initial installation failure following the instructions in OpenFOAM foundation for OpenFOAM-2.4.0 and as you can see it fails again.

I found this tread on this website Problems installing OpenFOAM 2.4.0 on Ubuntu 16.04 and there I found a step by step guide to install OpenFOAM-2.4.0,https://openfoamwiki.net/index.php/I...u#Ubuntu_16.04 , I run all the steps in that guide and the installation run smoothly. No more errors so far.

Thanks for your answer!
yMorH is offline   Reply With Quote

Old   March 6, 2022, 13:21
Default
  #47
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quite simply that your error shows the following
Code:
undefined reference to `yyFlexLexer::yywrap()'
So either there is something odd with your flex installation or the lexing code in OpenFOAM itself needs some adjustment. Take a look at how the corresponding bit of code looks like in a newer version of OpenFOAM - perhaps some clues there.
Keep in mind that you are trying to compile code that is about 6.5 years old, so the amount of help you can expect will be pretty modest.
yMorH likes this.
olesen 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
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 06:29
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 04:55
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


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