|
[Sponsors] |
December 9, 2018, 13:55 |
problem with -lscotch
|
#1 |
New Member
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10 |
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. |
|
December 16, 2018, 15:12 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
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.
__________________
|
|
December 16, 2018, 16:05 |
|
#3 |
New Member
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10 |
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.... |
|
December 18, 2018, 10:45 |
|
#4 |
New Member
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10 |
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 |
|
December 18, 2018, 11:15 |
|
#5 |
Member
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15 |
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 Code:
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION |
|
December 18, 2018, 12:24 |
|
#6 |
New Member
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10 |
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? |
|
December 18, 2018, 13:13 |
|
#7 |
Member
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 15 |
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 // Fatih |
|
December 18, 2018, 15:45 |
|
#8 |
New Member
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10 |
Thanks
It worked. |
|
December 19, 2018, 18:23 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
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? |
|
December 20, 2018, 03:16 |
|
#10 |
New Member
poorya
Join Date: Feb 2016
Posts: 10
Rep Power: 10 |
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. |
|
|
|
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 |