CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Compilation Error 1 (Allwmake) on Ubuntu 11.04 (http://www.cfd-online.com/Forums/openfoam-installation/88876-compilation-error-1-allwmake-ubuntu-11-04-a.html)

freemankofi May 28, 2011 17:28

Compilation Error 1 (Allwmake) on Ubuntu 11.04
 
Hi,
I am trying installing OF 1.7.1 on my Ubuntu 11.04 (latest version). I keep on get this "error 1" message. It seems some library is missing:

SOURCE=derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField. C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/wideBandDiffusiveRadiationMixedFvPatchScalarField. o
/usr/bin/ld: cannot find -lfiniteVolume
collect2: ld returned 1 exit status
make: *** [/home/adane/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libradiation.so] Error 1

/usr/bin/ld: cannot find -lbasicThermophysicalModels
/usr/bin/ld: cannot find -lreactionThermophysicalModels
collect2: ld returned 1 exit status
make: *** [/home/adane/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libchemistryModel.so] Error 1

etc.

First, I follow the installation instructions on OF website and even install it my home directory on a cluster. This means, it's coming coming these particular computers which is using Ubuntu latest version (64bit).

Secondly, if anyone knows similar posting please let me know about it.

Thanks

wyldckat May 28, 2011 18:44

Greetings Freeman,

Mmm, it's not finding libraries...

OK, by steps:
  1. What packages have you installed in Ubuntu for building OpenFOAM, if any!? Here's an old reference list for Ubuntu: http://www.cfd-online.com/Forums/ope...tml#post268828
  2. Run Allwmake like this:
    Code:

    ./Allwmake > make.log 2>&1
    This will make a full log into make.log, including errors that are outputted during the building process (i.e. "2>&1" does the redirect of stderr to stdout).
  3. Find the first error, which is where you most likely will catch the real problem. If you can't figure out the error message(s), then pack it and attach it to your next post.
Good luck!
Bruno

freemankofi May 30, 2011 10:25

Bruno,
Q1: I am using Source Pack Installation for OF version 1.7.1 (http://www.openfoam.com/download/source.php). Please note that, I am using "sudo apt-get ...) because my experience with it is that it doesn't allow me to build my own solver since during compilation it tries to access /opt/... which required root user or some admin permission.

But the source pack can be installed in one's local directory and therefore would be easier for creating my own solver. As I indicated in my first posting this very version has been successfully installed on a linux cluster. I am trying to install on a new Workstation which is running on Ubuntu 11.04.


Q2 & 3, Please see below:
========================================
Start ThirdParty Allwmake
========================================

========================================
Compile specific mpi libraries

have OPENMPI shared library
========================================
Build Scotch decomposition library

+ cd scotch_5.1/src
+ mkdir -p /home/adane/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt
+ make scotch
(cd libscotch ; make VERSION=\"5.1\" scotch && make install)
make[1]: Entering directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
rm -f *~ *.o lib*.so common2* parser_yy.c parser_ly.h parser_ll.c *scotch.h *scotchf.h y.output dummysizes
make CC="gcc" CCD="gcc" SCOTCHLIB=scotch \
scotch.h \
scotchf.h \
libscotch.so \
libscotcherr.so \
libscotcherrexit.so
make[2]: Entering directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
gcc -O3 -fPIC -DCOMMON_TIMING_OLD -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DSCOTCH_VERSION=\""5.1"\" dummysizes.c -o dummysizes -lz -lm -lrt
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [dummysizes] Error 1
make[2]: Leaving directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
make[1]: *** [scotch] Error 2
make[1]: Leaving directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
make: *** [scotch] Error 2
========================================
Build PTScotch decomposition library (requires MPI)

+ cd scotch_5.1/src
+ mkdir -p /home/adane/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/openmpi-1.4.1
+ make ptscotch
(cd libscotch ; make VERSION=\"5.1\" ptscotch && make ptinstall)
make[1]: Entering directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
rm -f *~ *.o lib*.so common2* parser_yy.c parser_ly.h parser_ll.c *scotch.h *scotchf.h y.output dummysizes
make CFLAGS="-O3 -fPIC -DCOMMON_TIMING_OLD -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DSCOTCH_PTSCOTCH" CC="mpicc" SCOTCHLIB=ptscotch \
scotch.h \
scotchf.h \
libptscotch.so \
libptscotcherr.so \
libptscotcherrexit.so
make[2]: Entering directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
mpicc -O3 -fPIC -DCOMMON_TIMING_OLD -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DSCOTCH_PTSCOTCH -DSCOTCH_VERSION=\""5.1"\" dummysizes.c -o dummysizes -lz -lm -lrt
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [dummysizes] Error 1
make[2]: Leaving directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
make[1]: *** [ptscotch] Error 2
make[1]: Leaving directory `/home/adane/OpenFOAM/ThirdParty-1.7.1/scotch_5.1/src/libscotch'
make: *** [ptscotch] Error 2

wyldckat May 30, 2011 17:10

Hi Freeman,

Ah, so far it's pretty simple, simply install the package zlib1g-dev:
Code:

sudo apt-get install zlib1g-dev
Then run Allwmake again just like as before.

Best regards,
Bruno

freemankofi May 30, 2011 19:12

Bruno,
Thanks. You made my day...:)

Regards
Freeman

freemankofi May 31, 2011 09:47

Bruno,
Unfortunately, it didn't work (please see appended). Also, perhaps, this might help you too (it looks like it's looking for "/usr/bin/ld", ?)

make[1]: Entering directory `/home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/DNS'
make[2]: Entering directory `/home/adane/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/adane/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/randomProcesses/lnInclude -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/sampling/lnInclude -IlnInclude -I. -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/dnsFoam.o -L/home/adane/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt \
-lfiniteVolume -lrandomProcesses -lsampling -lmeshTools -lOpenFOAM -liberty -ldl -lm -o /home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/dnsFoam
/usr/bin/ld: cannot find -liberty
collect2: ld returned 1 exit status
make[2]: *** [/home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/dnsFoam] Error 1
make[2]: Leaving directory `/home/adane/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/adane/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/DNS'
make: *** [DNS] Error 2
make[1]: Entering directory `/home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/basic'
make[2]: Entering directory `/home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/basic/laplacianFoam'
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude -I/home/adane/OpenFOAM/OpenFOAM-1.7.1/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/laplacianFoam.o -L/home/adane/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt \
-lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/laplacianFoam
/usr/bin/ld: cannot find -liberty
collect2: ld returned 1 exit status
make[2]: *** [/home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/laplacianFoam] Error 1
make[2]: Leaving directory `/home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/solvers/basic/laplacianFoam'
make[1]: *** [laplacianFoam] Error 2

Appendix
Checking basic setup...
-------------------------------------------------------------------------------
Shell: bash
Host: pipeflows
OS: Linux version 2.6.38-8-generic
-------------------------------------------------------------------------------


Checking main OpenFOAM env variables...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory Valid Crit
-------------------------------------------------------------------------------
$WM_PROJECT_INST_DIR /home/adane/OpenFOAM yes yes
$WM_PROJECT_USER_DIR /home/adane/OpenFOAM/adane-1.7.1 no no
$WM_THIRD_PARTY_DIR /home/adane/OpenFOAM/ThirdParty-1.7.1 yes yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory Valid Path Crit
-------------------------------------------------------------------------------
$WM_PROJECT_DIR /home/adane/OpenFOAM/OpenFOAM-1.7.1 yes yes yes

$FOAM_APPBIN ...7.1/applications/bin/linux64GccDPOpt yes yes yes
$FOAM_SITE_APPBIN ...nFOAM/site/1.7.1/bin/linux64GccDPOpt no no
$FOAM_USER_APPBIN ...7.1/applications/bin/linux64GccDPOpt no no
$WM_DIR .../adane/OpenFOAM/OpenFOAM-1.7.1/wmake yes yes yes
-------------------------------------------------------------------------------


Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
-------------------------------------------------------------------------------
Environment_variable Set_to_file_or_directory Valid Path Crit
-------------------------------------------------------------------------------
$FOAM_LIBBIN ...M/OpenFOAM-1.7.1/lib/linux64GccDPOpt yes yes yes
$FOAM_SITE_LIBBIN ...nFOAM/site/1.7.1/lib/linux64GccDPOpt no no
$FOAM_USER_LIBBIN ...FOAM/adane-1.7.1/lib/linux64GccDPOpt no no
$MPI_ARCH_PATH ...1/platforms/linux64Gcc/openmpi-1.4.1 yes yes yes
-------------------------------------------------------------------------------


Third party software
-------------------------------------------------------------------------------
Software Version Location
-------------------------------------------------------------------------------
gcc 4.5.2 /usr/bin/gcc
gzip 1.3.12 /bin/gzip
tar 1.25 /bin/tar
icoFoam
WARNING: Conflicting installations:
OpenFOAM settings : /home/adane/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/icoFoam
current path :
CRITICAL ERROR

-------------------------------------------------------------------------------


Summary
-------------------------------------------------------------------------------
Base configuration ok.

*** The foam installation contains 1 critical error(s)
*** Review the output for warning messages and consult
*** the installation guide for trouble shooting.

done.

any idea?
Freeman

wyldckat June 1, 2011 03:57

Hi Freeman,

This is what happens when you don't follow my instructions to the line :D
You should have installed the artillery of packages that I indicated that were in the thread "http://www.cfd-online.com/Forums/ope...tml#post268828 post #4":
Quote:

Originally Posted by wyldckat (Post 268828)
This is a command line that will install most of the necessary (and some possibly unnecessary) packages for building OpenFOAM and ParaView:
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 library "libiberty.so" is on one of those packages... but I'm not sure which one... possibly in binutils-dev.

Best regards,
Bruno

freemankofi June 2, 2011 10:57

Bruno,
Thanks. I got it installed, just that paraFoam doesn't work with error: $HOME//OpenFOAM-1.7.1/bin/paraFoam: 142: paraview: not found. I believe the error is coming from "CMake Error: The following variables are used in this project, but they are set to NOTFOUND." I check that dirctory and everything is ok.

But never mind I have installed the full ParaView Viewer via Ubuntu Software centre. That worked fine for now ...

Once again thanks for your help!
Freeman

wyldckat June 4, 2011 07:54

Hi Freeman,

Then this might be helpful:
Quote:

Originally Posted by http://www.cfd-online.com/Forums/blogs/wyldckat/701-using-official-pre-built-paraview-3-10-1-version-openfoam.html
Now open the file "$WM_PROJECT_DIR/bin/paraFoam" in your favorite simple text editor and replace every entry ".OpenFOAM" with ".foam". Now save and close the file.
NOTE: if you're feeling too lazy to open a text editor, try this:
Code:

sed -i -e 's=\.OpenFOAM=\.foam=' $WM_PROJECT_DIR/bin/paraFoam

Best regards,
Bruno

Toorop June 10, 2011 10:09

Hi Bruno,

I would like to create a log file as you suggested in your post.
Code:

./Allwmake > make.log 2>&1
Terminal message: bash: make.log: Permission denied
I tried sudo before the command but it didn't help.

The other workaround that I tried:
Code:

./Allwmake | tee $HOME/Documents/debug.txt
This gives a plethora of error messages on the terminal and the debug.txt contains:
Code:

make: Nothing to be done for `all'.
no git description found

Note: ignore spurious warnings about missing mpicxx.h headers
make[1]: Entering directory `/opt/openfoam171/applications/solvers/DNS'
make[1]: Leaving directory `/opt/openfoam171/applications/solvers/DNS'
...
Found readline/readline.h  --  enabling readline support.
...
make[1]: Entering directory `/opt/openfoam171/applications/utilities/thermophysical'
make[1]: Leaving directory `/opt/openfoam171/applications/utilities/thermophysical'

... section represents the other solvers and utilities.

With
Code:

sudo ./Allwmake | tee $HOME/Documents/debug.txt
the terminal and the debug file is the same:
Code:

Error: Current directory is not $WM_PROJECT_DIR
The environment variable are not consistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.

Strange, since if I execute pwd or echo $WM_PROJECT_DIR I get the same output.

The other wired thing is with foamInstallationTest. It gives me:
Code:

Checking basic setup...
-------------------------------------------------------------------------------
FATAL ERROR: OpenFOAM environment not configured.

I'm an Ubuntu 11.04 user, have the openfoam171 in /opt. I have successfully installed 1.7.1 as the official site suggested, but the ./Allwmake command wont work properly I think. I can create my own solvers to $FOAM_USER_APPBIN. Bit strange.

Thanks!

freemankofi June 10, 2011 10:31

hi Toorop,
Perhaps, Bruno will get back to you on it.

In the meantime, I think you have permission issue. Because usually "/opt/...." can only be accessed/executed/written etc by "root" user and therefore compilation wouldn't work unless you log on as root user.

If you're root user, then % sudo su. Note that, doing this means that anytime either yourself or anyone wants to compile must always have to log on as root user.

To avoid the above: follow carefully the instructions listed on openfoam source package page (http://www.openfoam.com/download/source.php), where you can install on your local directory. This doesn't need sudo or whatsoever but you have to set environment anytime you open a new terminal (i'ven't been able to set it for good!).

The other way is to install "ready made" (http://www.openfoam.com/download/ubuntu.php) which can also be installed in either local directory (/home/) or /opt/.... For my case since I'm administrator and other people will also use OF, I installed "ready-made" in /opt/ and source package in my local directory (/home). This allows those who're "light" or novice users to enjoy OF while I am also able to create a solver.

I hope this helps...
Freeman

wyldckat June 10, 2011 12:53

Hi Tibor and Freeman!

Freeman is right: the best thing would be to use the source version.

But if you still want to use the version already installed, and risk having no working OpenFOAM version, then run:
Code:

sudo chmod -R o+w /opt/openfoam171
This will give you writing permissions onto that folder and everything in it.

Additionally, the usual packages necessary for building OpenFOAM in Ubuntu are:
Quote:

Originally Posted by http://www.cfd-online.com/Forums/openfoam-installation/88988-changing-of171-single-precision.html#post310482
This is a command line that will install most of the necessary (and some possibly unnecessary) packages for building OpenFOAM and ParaView:
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
Right now I'm not 100% on which packages are truly needed for you, so if I'm not mistaken:
Code:

sudo apt-get install binutils-dev flex bison build-essential zlib1g-dev libglib2.0-dev

Best regards,
Bruno

Toorop June 14, 2011 06:10

Freeman and Bruno, thank you, I have managed to compile OF1.7.1. Thumbs up! Next time I will go for the source pack installation, hopefully without any major problems! :D

Cheers!


All times are GMT -4. The time now is 02:35.