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

[OpenFOAM.org] problem with -lscotch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2018, 13:55
Default problem with -lscotch
  #1
New Member
 
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10
poorya72 is on a distinguished road
Dear all,

I've been faced with the following error during OpenFOAM installation.

/usr/bin/ld: cannot find -lscotch
/usr/bin/ld: cannot find -lscotcherrexit
collect2: error: ld returned 1 exit status
make: *** [/home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libscotchDecomp.so] Error 1

I would appreciate having your thoughts on this.
poorya72 is offline   Reply With Quote

Old   December 16, 2018, 15:12
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Quick answer: Seems like the Scotch library is not installed or there is no custom build available in your installation.

Please indicate which installation instructions you are following and in which Linux Distribution, to make it easier to guide you.
__________________
wyldckat is offline   Reply With Quote

Old   December 16, 2018, 16:05
Default
  #3
New Member
 
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10
poorya72 is on a distinguished road
Thanks for your answer

I am building OpenFOAM from source code on a remote Linux server and don't have root privilege, because of that I've installed prerequisites for OpenFOAM manually.

Linux distribution is Rocks 7.0 (Manzanita).

I've downloaded and installed the scotch from the following address:
https://github.com/poulson/scotch
After installation, I changed my bashrc and added the following lines to it(address of libraries):

LD_LIBRARY_PATH=/home/poorya/.local/lib
export LD_LIBRARY_PATH

but it doesn't work....
poorya72 is offline   Reply With Quote

Old   December 18, 2018, 10:45
Default
  #4
New Member
 
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10
poorya72 is on a distinguished road
This time I installed scotch in $FOAM_APPBIN by the following command:
make prefix=/home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt install

Now, I get the following error:

wmake scotchDecomp
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtua l-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -DOMPI_SKIP_ MPICXX -I/opt/openmpi/include -pthread -I/home/poorya/OpenFOAM/ThirdParty-6/platforms/linux64GccDPInt32/scotch_6.0.3/i nclude -I/usr/include/scotch -I../decompositionMethods/lnInclude -IlnInclude -I. -I/home/poorya/OpenFOAM/OpenFOAM-6/sr c/OpenFOAM/lnInclude -I/home/poorya/OpenFOAM/OpenFOAM-6/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add- needed -Xlinker --no-as-needed /home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/src/parallel/decompose/ scotchDecomp/scotchDecomp.o -L/home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib \
-L/home/poorya/OpenFOAM/ThirdParty-6/platforms/linux64GccDPInt32/scotch_6.0.3/lib -L/home/poorya/OpenFOAM/ThirdP arty-6/platforms/linux64GccDPInt32/lib -lscotch -lscotcherrexit -lrt -o /home/poorya/OpenFOAM/OpenFOAM-6/platforms/li nux64GccDPInt32Opt/lib/libscotchDecomp.so
/usr/bin/ld: /home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libscotch.a(library_arch.o): relocati on R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libscotch.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [/home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libscotchDecomp.so] Error 1
poorya72 is offline   Reply With Quote

Old   December 18, 2018, 11:15
Default
  #5
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Hello Poorya

I don't think it makes sense to install scotch to $FOAM_APPBIN which normally contains application binaries such as solvers, mesh generators from OF stack.

With that being said it is not root-cause of your error. See:
Code:
/usr/bin/ld: /home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libscotch.a(library_arch.o): 
  relocati on R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/home/poorya/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libscotch.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
It looks like you built a static scotch library which cannot be used by the linker since it applies dynamic linking. Try to build a new version using "-fPIC" and maybe "-dynamic" flags to produce a shared object. Also it is better to stick to the OF settings for your install prefix:
Code:
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
fertinaz is offline   Reply With Quote

Old   December 18, 2018, 12:24
Default
  #6
New Member
 
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10
poorya72 is on a distinguished road
Hi, Fertinaz

Thanks for your answer. Yes, the installation directory is odd, as I said in my second reply, even after exporting LD_LIBRARY_PATH, FOAM didn't find the libraries. It was a trick to make sure it would find the libraries.

As it seems, the former problem is solved but there is a new problem.
Would you please explain how can I build a new version using "-fPIC" and "-dynamic" flags?
poorya72 is offline   Reply With Quote

Old   December 18, 2018, 13:13
Default
  #7
Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15
fertinaz is on a distinguished road
Yes, but exporting "LD_LIBRARY_PATH" was in your bashrc. Therefore if you source OF in your bashrc as well, there might be conflicts. Additionally, "LD_LIBRARY_PATH=/home/poorya/.local/lib" is also a bad idea. You can append / prepend new directories to this list but avoid the type of declaration you use.

Anyway, I checked the scotch repo you cloned and it looks like a bit more complicated than I thought. You need to make a copy of the appropriate makefile in the "Make.inc" directory. See file "Makefile.inc.i686_pc_linux2.shlib" in that folder and replace it with the existing "Makefile.inc". This one allows you to produce the shared object you need. For me now it looks like this:
Code:
[ertinaz@supernova src]$ find . -name "libscotch.*" -type f
./libscotch/libscotch.so
Then all you have to do is to update your "LD_LIBRARY_PATH" properly.

// Fatih
fertinaz is offline   Reply With Quote

Old   December 18, 2018, 15:45
Default
  #8
New Member
 
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10
poorya72 is on a distinguished road
Thanks
It worked.
poorya72 is offline   Reply With Quote

Old   December 19, 2018, 18:23
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Quick note: I'm glad the problem is solved and sorry for the late reply.

Essentially the original problem seems to be because the package for "ThirdParty-6" was not downloaded and unpacked successfully, because that package provides Scotch and the means to build it as OpenFOAM expects it to work.

Now my doubt is why the package for "ThirdParty-6" was not downloaded... most installation instructions mention the need to download it, so perhaps something went wrong during downloading and unpacking?
wyldckat is offline   Reply With Quote

Old   December 20, 2018, 03:16
Default
  #10
New Member
 
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10
poorya72 is on a distinguished road
I'm sorry. I had made a stupid mistake.
I thought Third-party package is only for installing Paraview, so I didn't install it before openFoam installation.
poorya72 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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 21:55.