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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 11, 2010, 12: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: 18
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, 13:02
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
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, 13:34
Default
  #3
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
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, 18:46
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
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, 14:32
Default
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   June 14, 2010, 08:03
Default
  #6
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
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, 08:13
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
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, 03:14
Default
  #8
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
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


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 18:22
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 14: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 22:18


All times are GMT -4. The time now is 00:07.