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

[OpenFOAM.org] Problems with Compiling OpenFOAM-2.1.1 in Ubuntu 16.04

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By charles4allme

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2018, 09:42
Default Problems with Compiling OpenFOAM-2.1.1 in Ubuntu 16.04
  #1
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hey all,
I am recently new to OpenFOAM, started using it about a month ago. I recently tried to compile OpenFOAM-2.1.1 in my Ubuntu 16.04 and it keeps coming up with the first error;

/home/okorie/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so: undefined reference to `Foam::Reaction<Foam::constTransport<Foam::specieT hermo<Foam::hConstThermo<Foam:erfectGas> > > >::typeName'
collect2: error: ld returned 1 exit status

I have attached my log file I have looked online but all I get is the suggestion of cleaning and compiling all over again but that has not worked. Any help will be appreciated.
Thanks.
Attached Files
File Type: gz log.make.tar.gz (10.4 KB, 14 views)
charles4allme is offline   Reply With Quote

Old   April 16, 2018, 10:13
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quick questions:
  1. Which installation instructions are you following?
  2. Do you need the solvers with chemical reaction capabilities?
    • Because if you don't, then you can already use the OpenFOAM 2.1.1 installation that you currently have.
__________________
wyldckat is offline   Reply With Quote

Old   April 16, 2018, 10:19
Default
  #3
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hi,
  1. I am using installation instructions from the openfoam wiki website https://openfoamwiki.net/index.php/I...u#Ubuntu_16.04
  2. I am working on combustion so I think I would need the solvers with chemical reaction capabilities.
Thanks.

Last edited by wyldckat; April 16, 2018 at 18:09. Reason: made the link clickable
charles4allme is offline   Reply With Quote

Old   April 16, 2018, 11:14
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
More quick questions:
  1. Did you do any modifications to the source code in your OpenFOAM 2.1.1 installation?
  2. Do you only have this version installed? Or do you have more than one OpenFOAM version/variant/fork?
Because the error message you are getting is due to a missing library in the list of dependencies in "Make/options", which should not have occurred, unless something unexpected is being used.

I will have to test this later today at home in my Ubuntu 16.04 installation, to try and reproduce the same error message.
wyldckat is offline   Reply With Quote

Old   April 16, 2018, 11:18
Default
  #5
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hi,
  1. I made no modifications to the source code during the installation.
  2. I have three more versions of OpenFOAM installed i.e. version 2.2.x, 2.2.2. and OpenFOAM-dev. At the moment am only making use of the dev version. Do you suggest I uninstall the versions am not using?
Thanks.
charles4allme is offline   Reply With Quote

Old   April 16, 2018, 13:26
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quote:
Originally Posted by charles4allme View Post
2. I have three more versions of OpenFOAM installed i.e. version 2.2.x, 2.2.2. and OpenFOAM-dev. At the moment am only making use of the dev version. Do you suggest I uninstall the versions am not using?
There is no need to uninstall.
My concern here is how exactly you are keeping each version separated from each other. For example, do you use aliases for loading each individual version; do you only activate one version per terminal or do you load directly between versions in the same terminal?
wyldckat is offline   Reply With Quote

Old   April 16, 2018, 15:55
Default
  #7
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hi,
Thanks for the reply. I use aliases to load the individual version. I also activate one version for each terminal. I don't know if the instructions on the website could be the problem
charles4allme is offline   Reply With Quote

Old   April 16, 2018, 19:31
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi charles4allme,

So, from what I can figure out from your descriptions, everything should have worked properly and as intended.

I've finished re-testing the instructions on my machine and I did not get the same error message that you've gotten.

Mmm... I would like to ask the following, to try and cross-out an hypothesis: Have you installed the package "openfoam" that is provided for Ubuntu via apt? I ask this because that will make a global installation, without the need to use the source command, if I'm not mistaken. The problem is that such an installation would interfere with any other custom builds that you would do...
It could have been something that you could have accidentally done recently, while trying to install the packages "openfoam5" or "openfoam4" or something like that.

But assuming that's not the problem, please try the following steps:
  1. Activate the environment for OpenFOAM 2.1.1.
  2. Run the following command, to go into the source code folder for wallHeatFlux:
    Code:
    cd $FOAM_UTILITIES/postProcessing/wall/wallHeatFlux/
  3. Edit the file "Make/options", for example, by running:
    Code:
    gedit Make/options
  4. Then replace this block:
    Code:
    EXE_LIBS = \
        -lcompressibleRASModels \
        -lreactionThermophysicalModels \
        -lfiniteVolume \
        -lgenericPatchFields \
        -lspecie \
        -lbasicThermophysicalModels
    With this one:
    Code:
    EXE_LIBS = \
    -lcompressibleRASModels \
    -lreactionThermophysicalModels \
    -lfiniteVolume \
    -lgenericPatchFields \
    -lspecie \
    -lbasicThermophysicalModels \
    -lcompressibleTurbulenceModel \
    -lmeshTools \
    -ltriSurface \
    -lbasicSolidThermo \
    -lsolid \
    -lradiationModels \
    -lfileFormats \
    -lSLGThermo \
    -lsolidMixtureProperties \
    -lliquidMixtureProperties \
    -lsolidProperties \
    -lliquidProperties \
    -lthermophysicalFunctions
  5. Save and close the text editor.
  6. Then try to build wallHeatFlux by running the following command:
    Code:
    wclean
    wmake
  7. If all goes well, it should not give you any error message.
    • If this is the case, then the solution should be just a matter of adding the entry "-lbasicThermophysicalModels" to the right of each occurrence of "-lreactionThermophysicalModels" in the "Make/options" files for each one of the applications that did not build successfully.
    • The reason why I wrote the whole list, is because it's the list of libraries I get from a well built wallHeatFlux with OpenFOAM 2.1.1 on my installation of Ubuntu 16.04.
  8. But if it does not work, then post what is the error message that you have gotten.
    • Because it is possible that you would still get the same error message that you've gotten before:
      Code:
      /home/okorie/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so: undefined reference to `Foam::Reaction<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > >::typeName'
       collect2: error: ld returned 1 exit status
      /home/okorie/OpenFOAM/OpenFOAM-2.1.1/wmake/Makefile:149: recipe for target '/home/okorie/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/wallHeatFlux' failed
    • And if this is the situation, then we will have to try and pinpoint what is interfering with this linking step of the build process.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   April 17, 2018, 07:45
Default
  #9
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hi,

Thank you for the instructions. I don't think I have installed openfoam package through 'apt'. Is there anyway to check to be certain so I can fully rule that out as a potential problem.

I have also gone ahead to edit my file Make/options and I added those other libraries. I now get this new error.

Code:
linux64GccDPOpt/options:71: *** missing separator.  Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /home/okorie/OpenFOAM/OpenFOAM-2.1.1/applications/utilities/postProcessing/wall/wallHeatFlux
Best regards,
charles4allme
charles4allme is offline   Reply With Quote

Old   April 17, 2018, 13:15
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quote:
Originally Posted by charles4allme View Post
I don't think I have installed openfoam package through 'apt'. Is there anyway to check to be certain so I can fully rule that out as a potential problem.
Try running:
Code:
dpkg -s openfoam | grep Status
Quote:
Originally Posted by charles4allme View Post
Code:
linux64GccDPOpt/options:71: *** missing separator.  Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /home/okorie/OpenFOAM/OpenFOAM-2.1.1/applications/utilities/postProcessing/wall/wallHeatFlux
Something went wrong when you copied the text from the post to the file. Please copy-paste the whole content of the "Make/options" file from that folder to your next post, or simply attach the file.
wyldckat is offline   Reply With Quote

Old   April 17, 2018, 15:28
Default
  #11
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
I tried running the code you sent and I get this output

Code:
dpkg-query: package 'openfoam' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Here is the attached file. Thanks.
Attached Files
File Type: gz options.tar.gz (381 Bytes, 3 views)
charles4allme is offline   Reply With Quote

Old   April 17, 2018, 20:04
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quick answers:
  • So it seems like the "openfoam" package is not installed, so that's one less variable in the mix.
  • The error occurred because unfortunately you didn't simply copy paste the whole block of code that I had posted, you only copied the new lines, but that resulted in a missing backslash, namely here:
    Code:
        -lspecie \
        -lbasicThermophysicalModels
        -lcompressibleTurbulenceModel \
    is missing one in the middle entry there:
    Code:
        -lspecie \
        -lbasicThermophysicalModels \
        -lcompressibleTurbulenceModel \
wyldckat is offline   Reply With Quote

Old   April 19, 2018, 06:31
Default
  #13
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hello,

Apologies for the late reply. I have corrected the mistake and I still get the same error

Code:
/home/okorie/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so: undefined reference to `Foam::Reaction<Foam::constTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > >::typeName'
collect2: error: ld returned 1 exit status
/home/okorie/OpenFOAM/OpenFOAM-2.1.1/wmake/Makefile:149: recipe for target '/home/okorie/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/wallHeatFlux' failed
make: *** [/home/okorie/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/wallHeatFlux] Error 1
Thanks.
charles4allme is offline   Reply With Quote

Old   April 19, 2018, 11:20
Default Why 2.x version?
  #14
Member
 
Rahul Vadrabade
Join Date: Apr 2018
Posts: 46
Rep Power: 8
Rvadrabade is on a distinguished road
Latest version is 5.x available why are you using older version?

Follow Steps :

open terminal : (enter one by one)
sudo add-apt-repository http://dl.openfoam.org/ubuntu
sudo sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"

sudo apt-get update

apt-get install synaptic

search for openfoam and install version 5

finalize installation with : gedit ~/.bashrc
(at end of file : ) source /opt/openfoam5/etc/bashrc

save and enjoy
Rvadrabade is offline   Reply With Quote

Old   April 19, 2018, 14:11
Default
  #15
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
Hi Rvadrabade,

I really appreciate the advice but am in a peculiar situation. I need the version 2.1.1 because am working with someone's solver that made use of applications and models from version 2.1.1 to generate their own model.

I would go ahead and check if version 5.x has the available applications and models anyways.

Thanks.
Rvadrabade likes this.
charles4allme is offline   Reply With Quote

Old   April 30, 2018, 18:28
Default
  #16
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
@charles4allme: Sorry for the late reply, but I'm still confused as to why this error is happening and I haven't figured out how I can reproduce the same error...

Nonetheless, please run the following command:
Code:
uname -a
and let us know what it gives you.
For example, I have gotten the following information in a virtual machine I'm testing right now for something else:
Code:
Linux ofuser-virtual-machine 4.4.0-15-generic #31-Ubuntu SMP Fri Mar 18 19:06:37 UTC 2016 i686 athlon i686 GNU/Linux
This is for Ubuntu 16.04, but it's the 32-bit version (i686). Since there is no clear indication if you have the 32 or 64-bit version installed, so it's better to check which exact one you are using.
wyldckat is offline   Reply With Quote

Old   May 15, 2018, 07:45
Default
  #17
Member
 
Join Date: Feb 2018
Posts: 91
Rep Power: 8
charles4allme is on a distinguished road
@wyldckat: Apologies for the late reply as I got busy with others and thank you for your reply and support. I ran the command and here is what it gave me


Code:
Linux maqsood-Precision-T7610 4.4.0-121-generic #145-Ubuntu SMP Fri Apr 13 13:47:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
charles4allme is offline   Reply With Quote

Old   May 31, 2018, 10:01
Default
  #18
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
It's been so long since the original report, that I'm lost on what could possibly be the error here.

My best guess is that there might have been a bug when unpacking the source code packages, which resulted in this problem.
In other words, deleting the current 2.1.1 installation and starting over from downloading the "tar.gz" files once again and unpacking them and so on, is my best guess on solving this problem.
wyldckat 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
[OpenFOAM.org] Problems installing OpenFOAM 2.3.1 in Ubuntu 12.04 masoudshao OpenFOAM Installation 10 August 9, 2018 07:13
[OpenFOAM.org] Building OpenFOAM 3.0.1 on Ubuntu 16.04 - failed erico OpenFOAM Installation 30 February 2, 2017 10:24
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
[OpenFOAM.org] 4.0: Problems compiling ParaView on Ubuntu 16.04 RishabhG OpenFOAM Installation 1 September 18, 2016 16:55
Compiling OpenFOAM 1.7.1 on Ubuntu 10.10 samiam1000 OpenFOAM Installation 4 November 24, 2010 09:00


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