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

OF-1.6.x applications don't compile, although rest does

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 11, 2010, 11:21
Default OF-1.6.x applications don't compile, although rest does
  #1
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9
gwierink is on a distinguished road
Dear all,

I am compiling OpenFOAM-1.6.x on a cluster with Scientific Linux 4 (64 bit). After some effort things seemed to work as ThirdParty compiled (except parMGridGen, but I don't think I need it), openmpi-1.3.3 compiled, Pstream compiled, OpenFOAM-1.6.x/src compiled, so I thought I was all set. But now applications need to be compiled and I get an error. When the script goes to
Code:
wmake all solvers
ld complains it can't find "-l/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x" (which is my home dir on the cluster) with the follwoing error:

Code:
+ wmake all solvers
+ wmake laplacianFoam
Making dependency list for source file laplacianFoam.C
make[1]: Entering directory `/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/applications/solvers/basic/laplacianFoam'
SOURCE=laplacianFoam.C ;  g++ -m64 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -IlnInclude -I. -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src//homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/laplacianFoam.o
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H: In function ‘int main(int, char**)’:
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H:6: warning: unused variable ‘momentumPredictor’
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H:9: warning: unused variable ‘fluxGradp’
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H:12: warning: unused variable ‘transonic’
g++ -m64 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -IlnInclude -I. -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src//homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude   -fPIC Make/linux64GccDPOpt/laplacianFoam.o -L/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt \
     -lfiniteVolume -l/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x -liberty -ldl   -lm -o /homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/laplacianFoam
/usr/bin/ld: cannot find -l/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x
collect2: ld returned 1 exit status
I have looked through many threads where ld can't find -l<thisAndThat>, but I am having trouble solving the issue. Would anyone have a suggestion how to fix this? The thing that I think is weird, is that everything else compiles, except the actual solvers.

Thank you in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   June 11, 2010, 12:02
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
I haven't used 1.6 myself, but this looks odd to me. "/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x" is not a library, so it doesn't seem surprising ld would complain. From the output I get using 1.5 I'd expect to see "-lOpenFOAM" there instead. Hope this helps.

- Anton
akidess is offline   Reply With Quote

Old   June 11, 2010, 12:34
Default
  #3
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9
gwierink is on a distinguished road
Hi Anton,

Quote:
I'd expect to see "-lOpenFOAM" there instead
Could it be an environment variable that is not set or set to some wrong place?
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   June 11, 2010, 17:46
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Gijsbert,

If I interpreted correctly, Scientific Linux is based on Enterprise Linux... which I can only assume it's Red Hat Enterprise Linux. And Fedora is somewhat based on Red Hat Linux, sooo... You probably need the following solution (from OpenFOAM-1.5-dev SVN15xx with gcc-4.4.2):
Quote:
Originally Posted by philippose View Post
The current solution to the problem is, to use the -P directive when invoking cpp.

I modified the file: OpenFOAM-1.5-dev/wmake/rules/linuxGcc/general to incorporate this change, and the compile went through fine....

Code:
CPP        = /lib/cpp $(GFLAGS) -P   <-- Changed line
LD         = ld -melf_i386

PROJECT_LIBS = -l$(WM_PROJECT) -ldl

include $(GENERAL_RULES)/standard

include $(RULES)/X
include $(RULES)/c
include $(RULES)/c++
In your case, the base folder is OpenFOAM-1.6.x.

I say this solution (and it's strange that the building procedure didn't break sooner) is because there is more then one miss-definition in the output that you posted... more specifically this:
Code:
-I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src//homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lnInclude
The two paths got merged in a very bad way So, my hunch is that the file "laplacianFoam/Make/options" (and similar others) is either corrupted (missing one or more "\") or that your Scientific Linux installation needs the "-P" argument for running gcc and thus interpreting the options files correctly!


If you want instructions on how to build OpenFOAM 1.6.x in Fedora type Linux... er, Red Hat Linux type I suppose, here it is:
Quote:
Originally Posted by from my signature's link
Fedora 12 using the system gcc 4.4.3 (it's not a complete tutorial): Problem Installing OF 1.6 Ubuntu 9.10 (64 bit) - How to use GCC 4.4.1 post #11
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 12, 2010, 13:32
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
I would think it depends on the system myself. I do not have this problem on SUSE Linux Enterprise or openSUSE (gcc 4.4.1).
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   June 14, 2010, 07:03
Default
  #6
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9
gwierink is on a distinguished road
Dear Anton, Bruno, and Alberto,

Many thanks for your replies!

Quote:
Scientific Linux is based on Enterprise Linux... which I can only assume it's Red Hat Enterprise Linux
Yep, that is correct.

I changed the WM_PROJECT environment variable to "OpenFOAM", as Anton mentioned, so the
Quote:
"/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x" is not a library
got solved.
I also added the -P flag, as Bruno suggested.


I recompiled the whole lot, including ThirdParty, but still get an error when compiling lalacianFoam (that's just the random solver I started compiling first):

Code:
[wierink_g@lclth01 basic]$ wmake laplacianFoam
Making dependency list for source file laplacianFoam.C
SOURCE=laplacianFoam.C ;  g++ -m64 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt -IlnInclude -I. -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOptOPENMPI/laplacianFoam.o
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H: In function ‘int main(int, char**)’:
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H:6: warning: unused variable ‘momentumPredictor’
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H:9: warning: unused variable ‘fluxGradp’
/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readSIMPLEControls.H:12: warning: unused variable ‘transonic’
g++ -m64 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt -IlnInclude -I. -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude   -fPIC Make/linux64GccDPOptOPENMPI/laplacianFoam.o -L/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOptOPENMPI \
     -lfiniteVolume -lOpenFOAM -liberty -ldl   -lm -o /homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/laplacianFoam
/usr/bin/ld: cannot find -lfiniteVolume
collect2: ld returned 1 exit status
make: *** [/homelth/wierink_g/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/laplacianFoam] Error 1
Now ld complians it can't find lfiniteVolume ...

Would anyone have any idea? Thanks in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   June 14, 2010, 07:13
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Are you sure OpenFOAM compiled properly with no errors?

Check if the finite volume library is present in (I'm assuming the library path didnt change from 1.5 here):
OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/libfiniteVolume.so

If it is there, the system doesn't know where to find the OpenFOAM libraries. There might be another $WM variable you have to set, and appending LD_LIBRARY_PATH might also be worth a try.
akidess is offline   Reply With Quote

Old   June 15, 2010, 02:14
Default
  #8
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9
gwierink is on a distinguished road
Dear friends,

Thank you for your support. The problem got solved. It turned out that some ThirdParty things (openmpi in particular) seemed to compile ok, but didn't link. I then compiled openmpi "by hand" (as in not by script) and it worked. Also, I had a typo in bashrc , if that isn't embarrassing, I don't know what is ... After some fiddling, it works!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 17:22
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 13:24
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51
compile the UDF Li Jingping FLUENT 2 April 14, 2003 21:18


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