CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Cannot find lOpenFOAM (https://www.cfd-online.com/Forums/openfoam-installation/57414-cannot-find-lopenfoam.html)

danieltourde June 6, 2006 15:19

Hello, I am trying to buid
 
Hello,

I am trying to buid OpenFOAM 1.3 from source on a stock Gentoo Linux box (gcc 4.1.1, glibc 2.4, X11R7). I just follow blindly and stupdly the installation procedure provided with the source code and I get the following errors (a few time before it stops to build):

SOURCE_DIR=.
SOURCE=foamInfoExec.C ; g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter
-Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30
-I/home/ted/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I.
-fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/foamInfoExec.o
/home/ted/OpenFOAM/OpenFOAM-1.3/wmake/bashScripts/mkObjectDir
/home/ted/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/foamInfoExec
g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3
-DNoRepository -ftemplate-depth-30
-I/home/ted/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I.
-fPIC -pthread Make/linuxGcc4DPOpt/foamInfoExec.o
-L/home/ted/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt \
-lOpenFOAM -liberty -o
/home/ted/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/foamInfoExec
/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../i686-pc-linux-gnu/bin/ld:
cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make: ***
[/home/ted/OpenFOAM/OpenFOAM-1.3/applications/bin/linuxGcc4DPOpt/foamInfoExec]
Error 1

Any idea? Help...

Daniel

mattijs June 7, 2006 03:38

> cannot find -lOpenFOAM s
 
> cannot find -lOpenFOAM

seems something has gone wrong earlier when building the OpenFOAM library. Good luck.

theof June 19, 2006 08:07

Hi there, I have waited a whi
 
Hi there,
I have waited a while before posting this but now I am really blocked. I have just recompile OF-1.3 on linux suse 10, gcc-4.0.2. All the libraries compiled fine, libOpenFOAM included. When I want to compile the libPVFoamReader, it first compiles the libvtkFoam then I get the previous "cannot find -lOpenFOAM". I am trying to link with paraview-2.5 compiled with cmake-2.4.2. Any suggestion?
Theophane

theof June 20, 2006 04:57

All is explained on the wiki p
 
All is explained on the wiki page. Thanks for having documented it!

arkangel June 8, 2007 08:15

exactly in which part ?
 
exactly in which part ?

johndeas March 28, 2008 03:56

Hi, I tried to compile a dev v
 
Hi, I tried to compile a dev version of OpenFOAM (from svn), on a RHEL 5, using the compiler provided with the latest stable version of OpenFOAM. However, I get this linking error :

g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude -fPIC -pthread Make/linuxGccDPOpt/kivaToFoam.o -L/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/lib/linuxGccDPOpt \
-lOpenFOAM -ldl -lm -o /home/flurec/temp/dev/OpenFOAM-1.4.1-dev/applications/bin/linuxGccDPOpt/kivaToFo am
/usr/bin/ld: cannot find -lOpenFOAM
collect2: ld returned 1 exit status
make[3]: *** [/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/applications/bin/linuxGccDPOpt/kivaToF oam] Error 1
make[3]: Leaving directory `/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/applications/utilities/mesh/conversion /kivaToFoam'
make[2]: *** [kivaToFoam] Error 2
make[2]: Target `application' not remade because of errors.
make[2]: Leaving directory `/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/applications/utilities/mesh/conversion '
make[1]: *** [conversion] Error 2
make[1]: Target `application' not remade because of errors.
make[1]: Leaving directory `/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/applications/utilities/mesh'
make: *** [mesh] Error 2
make: Target `application' not remade because of errors.

Is there something that need to be fixed in a path ?

johndeas March 28, 2008 04:10

May I add that, if I am in the
 
May I add that, if I am in the src directory, and type wmake libso OpenFOAM, it reports an up to date libOpenFOAM.so

arkangel March 28, 2008 04:13

go to ../OpenFOAM-1.4.1/src
 
go to ../OpenFOAM-1.4.1/src

and issue this command

%wmake libso OpenFOAM

It will tell you more information why OpenFoam cannot be built

arkangel March 28, 2008 04:20

this file exist /home/flur
 
this file exist

/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/lib/linuxGccDPOpt/libOpenFOAM.so

?

johndeas March 28, 2008 05:37

Yes, it exists. I am checking
 
Yes, it exists. I am checking all the paths in the various bashrc to understand why it is not taking into account.

I am also updatding my gcc to the one distributed with at http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/release/ and thus I would like to clean all the executable. Is it possible to run something like wclean globally, or do I have to automate something to launch wclean in every directory where wmake is called ?

johndeas March 28, 2008 05:55

wcleanAll ...
 
wcleanAll ...

johndeas March 28, 2008 09:09

After changing the gcc version
 
After changing the gcc version, I wanted to clean/rebuild my installation with :

foam
wcleanAll
src
rm -rf */platforms
foam
Allwmake

However some librairies are not build. If I try wmake libso triSurface, I get

readSTLASCII.C:234:23: error: FlexLexer.h: no such file or directory

and various errors like

readSTLASCII.C:5079: error: â does not name a type

johndeas March 31, 2008 05:06

I installed flex and zlib (to
 
I installed flex and zlib (to get zlib.h) from repositories even if I understood that they were built in the Allwmake process. If I type which flex, I get /usr/bin/flex, whereas I think I should have got something inside OpenFOAM path, had everything been setup properly. There were no warnings for the one-two hour compilation time before I left for weekend.

However, to my horror when I came back today, I saw I still have compilation errors. I found in the last compilation directives before it stopped compiling warnings like this one:

"readKivaGrid.H:232: warning: deprecated conversion from string constant to â"

and, readKivaGrid.H contains:

char* kivaPatchNames[nBCs] =
{
"piston",
"valve",
"liner",
"cylinderHead",
"axis",
"wedge",
"inflow",
"outflow",
"presin",
"presout",
"symmetryPlane",
"cyclic"
};

whith }; being at line 232

however, there were no errors, but warnings. The error message was:

make[3]: Leaving directory `/home/flurec/temp/OpenFOAM/OpenFOAM-1.4.1-dev/applications/utilities/mesh/conve rsion/kivaToFoam'
make[2]: Leaving directory `/home/flurec/temp/OpenFOAM/OpenFOAM-1.4.1-dev/applications/utilities/mesh/conve rsion'
make[1]: Target `application' not remade because of errors.

Also, if I type wmake libso kivaToFoam, I get
"libNULL.so is up to date"

My hypothesis is that the flex version from my repository is not uptodate (package 2.5.4a-41.fc6), but still, I do not understand why the one supplied with openFOAM in not the one used (and why I had to install zlib-devel to get zlib.h which is supplied in OF by the way). The latter has been built, I can found a flex executable in : applications/utilities/miscellaneous/foamFlex

I am really motivated to get OF built from development version, however I am limited in my understanding of what is currently going on.

johndeas March 31, 2008 05:29

update: I should not have writ
 
update: I should not have written wmake libso reaKiva, if I go the kivaToFoam directory and type wmake, I get :
FOAM_APPBIN/kivaToFoam is up to date.

also, if I type which foamFlex++, I get one which is inside FOAM_APPBIN

jas March 31, 2008 07:00

It is written in the Install-I
 
It is written in the Install-Instruction that
you have to install the OPENFOAM direct into the HOME.

So if I´m right
/home/flurec/temp/dev/OpenFOAM-1.4.1-dev/lib/linuxGccDPOpt/libOpenFOAM.so
should look like
/home/OpenFOAM-1.4.1-dev/lib/linuxGccDPOpt/libOpenFOAM.so

johndeas March 31, 2008 08:30

I modified two variables to ta
 
I modified two variables to take into account that I did not install in the home:

export WM_PROJECT_INST_DIR=/home/flurec/temp/$WM_PROJECT
export WM_PROJECT_USER_DIR=/home/flurec/temp/$LOGNAME-$WM_PROJECT_VERSION

Using similar settings, the stable binary version of OpenFOAM worked (and I was able to compile my owm solvers). But maybe I should ajust other variables to compile the core of OpenFOAM librairies ?


All times are GMT -4. The time now is 11:42.