CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [foam-extend.org] Problems with "cannot find -liberty" (https://www.cfd-online.com/Forums/openfoam-installation/134199-problems-cannot-find-liberty.html)

Nicolao April 25, 2014 15:23

Problems with "cannot find -liberty"
 
Hello,
I'm having the famous problem of "cannot find -liberty" when I'm making the foam-extended 3.0 installation.
I've already checked almost every post about this issue, and I cannot find a solution. All posts I read suggest that you must install the binutils-dev package. However, I already have it installed.
I've just installed the Ubuntu 14.04, and I'm not sure if there some kind of incompatibility or something like that.

I'm sorry to bring up this problem again, but I'm starting to give up the installation.

Thanks

wyldckat April 25, 2014 16:53

Greetings Nicolao,

It would seem that the Google force is not strong in you ;) I Googled just now for this:
Code:

FOAM extend 3.0 ubuntu 14.04
and the first link was for this page: http://openfoamwiki.net/index.php/In...om_source_code
If you look for "Ubuntu 14.04" on that page, you'll see what packages are needed to be installed. The list looks nearly identical to all other Ubuntu's, except the new package is called "libiberty-dev". This has been available on that wiki page since the 18th of April ;)

Best regards,
Bruno

Nicolao April 28, 2014 14:47

Thank you Bruno!
It worked just fine!

pankajhrajput March 4, 2016 15:19

Hi Nicolao and Bruno

I recently updated to Ubuntu 15.01 and was making the foam-extend-3.2 installation. I kept on getting the famous 'cannot find -liberty' error (which I was able to resolve thanks to Bruno's post :)) however, I am also getting 'cannot find -lfoam' error. I have searched a lot online but I couldnt find anything that would fix this error, maybe I am not looking in the right direction. :confused:

Do you guys know what could be causing this 'cannot find -lfoam' error?

Thanks.

wyldckat March 6, 2016 10:36

Quote:

Originally Posted by pankajhrajput (Post 588099)
however, I am also getting 'cannot find -lfoam' error. I have searched a lot online but I couldnt find anything that would fix this error, maybe I am not looking in the right direction. :confused:

Quick request:
  1. Run:
    Code:

    foam
    ./Allwmake > log.make 2>&1
    gzip < log.make > log.make.gz

  2. Attach the file "log.make.gz" to your next post.
This way I can diagnose the origin/reason of the error.

Ali Blues March 7, 2016 11:15

Dear Bruno,
I'm installing foam-extend 3.2.x on a workstation with Ubuntu-12, as non-root. So I made the appropriate modifications in etc/prefs.sh to use third party software and use FOAM as compiler.

in etc/prefs.sh:

Code:

export WM_COMPILER=Gcc49
export WM_THIRD_PARTY_USE_GCC_492=1
export compilerInstall=FOAM
export QT_THIRD_PARTY=1

# For AllMake.stage1
export WM_THIRD_PARTY_USE_CMAKE_322=1

# For AllMake.stage2
export WM_THIRD_PARTY_USE_OPENMPI_188=1

# For AllMake.stage3
export WM_THIRD_PARTY_USE_METIS_510=1
export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1
export WM_THIRD_PARTY_USE_LIBCCMIO_261=1
export WM_THIRD_PARTY_USE_MESQUITE_212=1
export WM_THIRD_PARTY_USE_SCOTCH_604=1
export WM_THIRD_PARTY_USE_PARMETIS_403=1
export WM_THIRD_PARTY_USE_PYFOAM_064=1
export WM_THIRD_PARTY_USE_HWLOC_1101=1


# For AllMake.stage4
export WM_THIRD_PARTY_USE_QT_486=1
export WM_THIRD_PARTY_USE_PARAVIEW_431=1

So when I compile using ./AllMake, everything seems to be fine. But then when I try to compile foam, I get the error as others have in this post, i.e.
Code:

/usr/bin/ld: cannot find -liberty.
Would you have any suggestions for how I can resolve this.
Thanks in advance.

Best
Ali

wyldckat March 7, 2016 15:54

Quick answer @Ali: I don't have time to fully test this, but please try the following steps:
Code:

foam
sed -iold -e "s=\-liberty==" wmake/rules/*/general

Now you can run "Allwmake" again, like this:
Code:

foam
./Allwmake > log.make 2>&1

It will take a long time to build. Once it's done, please run it again, to get a summary of the error messages:
Code:

./Allwmake > log.make 2>&1
Now look for the first error in "log.make". Hopefully there will be none.

pankajhrajput March 7, 2016 15:59

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 588309)
Quick request:
  1. Run:
    Code:

    foam
    ./Allwmake > log.make 2>&1
    gzip < log.make > log.make.gz

  2. Attach the file "log.make.gz" to your next post.
This way I can diagnose the origin/reason of the error.

Hi Bruno

Thanks for your reply. Please find the log file attached with this post.

Thanks again
Pankaj

wyldckat March 7, 2016 16:16

Hi Pankaj,
Quote:

Originally Posted by pankajhrajput (Post 588537)
Thanks for your reply. Please find the log file attached with this post.

:confused: From where did you download the source code for foam-extend 3.2? Did you do any changes to the source code?

Because the error message that you are getting is because the "libfoam.so" was built with the name "libOpenFOAM.so"!?

To solve this issue, got into the foam-extend-3.2 folder:
Code:

foam
And edit the file "src/foam/Make/files" and change the last line from "libOpenFOAM" to "libfoam".
Then run "Allwmake" once again, the same way you did before.

Best regards,
Bruno

pankajhrajput March 7, 2016 17:23

Quote:

Originally Posted by wyldckat (Post 588540)
And edit the file "src/foam/Make/files" and change the last line from "libOpenFOAM" to "libfoam".
Then run "Allwmake" once again, the same way you did before.

Hi Bruno

Thanks for your prompt reply. Your recommended change fixed the problem and I was able to build it successfully. I think I changed that line in a desperate attempt to fix the installation build (before i found this post) and forgot about it. :o

Thanks again for your help, I really appreciate it.

Pankaj

Ali Blues March 8, 2016 04:48

Dear Bruno,
As always you're awesome! It worked, it just gives the following warning at the end which says that it is for "project developers"; whatever that means.
Best
Ali

Code:

CMake Warning (dev) at CMakeLists.txt:54 (TARGET_LINK_LIBRARIES):
  Policy CMP0023 is not set: Plain and keyword target_link_libraries
  signatures cannot be mixed.  Run "cmake --help-policy CMP0023" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The keyword signature for target_link_libraries has already been used with
  the target "PV4FoamReader_SM".  All uses of target_link_libraries with a
  target should be either all-keyword or all-plain.

  The uses of the keyword signature are here:

  * /home/ali/foam/foam-extend-3.2/ThirdParty/packages/ParaView-4.3.1/platforms/linux64Gcc49DPOpt/lib/cmake/paraview-4.3/ParaViewPlugins.cmake:1099 (target_link_libraries)

This warning is for project developers.  Use -Wno-dev to suppress it.


wyldckat March 13, 2016 14:10

Quote:

Originally Posted by Ali Blues (Post 588610)
It worked, it just gives the following warning at the end which says that it is for "project developers"; whatever that means.

Quick answer: you can safely ignore that message.

dkokron August 25, 2016 10:57

Bruno,

Removing all references to -liberty from the wmake/rules/*/general files resolved this issue for me. Thanks for the suggestion.

wyldckat August 25, 2016 16:24

Greetings Dan,

Many thanks for the feedback and reminder!
I'm testing now on Ubuntu 16.04 and I'll make a pull request for the "nextRelease" branch at foam-extend 3.2 for this, so that they can do a larger build test.

I never really understood why we were ever depending on the "libiberty.so" library.

Best regards,
Bruno


All times are GMT -4. The time now is 14:22.