CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] OF7 compiling error on RHEL 6.5 (https://www.cfd-online.com/Forums/openfoam-installation/219369-of7-compiling-error-rhel-6-5-a.html)

ssdoria July 24, 2019 15:47

OF7 compiling error on RHEL 6.5
 
I'm using a RHEL 6.5 with GCC 8.2 and OF6 compiles well, but OF7 throws the following:


Code:

wmake dummy
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100  -IlnInclude -I. -I/opt/share/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude -I/opt/share/OpenFOAM/OpenFOAM-7/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed /opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/src/Pstream/dummy/UPstream.o /opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/src/Pstream/dummy/UIPread.o /opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/src/Pstream/dummy/UOPwrite.o -L/opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib \
            -lpthread  -o /opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/dummy/libPstream.so
collect2: fatal error: cannot find 'ld'
compilation terminated.
make: *** [/opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/dummy/libPstream.so] Error 1

GCC version:

Code:

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/share/gcc/8.2.0/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++,fortran --with-isl=/opt/share/isl/0.18/ --with-mpc=/opt/share/mpc/1.0.3/ --with-mpfr=/opt/share/mpfr/3.1.4/ --with-gmp=/opt/share/gmp/6.1.0/ --prefix=/opt/share/gcc/8.2.0/
Thread model: posix
gcc version 8.2.0 (GCC)

ld version:

Code:

ld -v
GNU ld version 2.20.51.0.2-5.36.el6 20100205


wyldckat July 25, 2019 20:02

Quick answer:
  1. Edit these two text files in OpenFOAM-7:
    Code:

    wmake/rules/linux64Gcc/c++
    wmake/rules/linux64Gcc/c

  2. Remove from the last two lines in that file the following argument:
    Code:

    -fuse-ld=bfd
  3. Try building OpenFOAM once again.
This is because the conventional installations of GCC+Binutils will provide the gold and bfd variants of ld, but your installation only has the bfd one apparently.


Knowing how you install GCC+Binutils would make it easier to figure out in which situations we need this change.

ssdoria July 25, 2019 23:34

It worked like a charm!
 
Bruno, it worked like a charm. Thanx a lot.

Obrigadão. Abri uma garrafa de ginja em sua homenagem! Abraços,

wyldckat July 27, 2019 10:13

Quote:

Originally Posted by ssdoria (Post 740074)
Bruno, it worked like a charm. Thanx a lot.

You're welcome. Please also let us know how GCC+Binutils in that machine.

ssdoria July 27, 2019 21:33

binutils-2.20.51.0.2-5.36.el6.x86_64
Gcc is 8.2 loaded by module. This is an HPC.

module unload
gcc/8.2.0 isl/0.18 mpfr/3.1.4 paraview/4
gmp/6.1.0 mpc/1.0.3 openmpi/3.1.2 zlib/1.2.8

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/share/gcc/8.2.0/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-
wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++,fortran --
with-isl=/opt/share/isl/0.18/ --with-mpc=/opt/share/mpc/1.0.3/ --with-mpfr=/opt/sha
re/mpfr/3.1.4/ --with-gmp=/opt/share/gmp/6.1.0/ --prefix=/opt/share/gcc/8.2.0/
Thread model: posix
gcc version 8.2.0 (GCC)

wyldckat August 3, 2019 15:36

@ssdoria: Many thanks! OK, then it's a custom build done by the HPC system administrators... I guess that the "binutils" they custom built only has a single ld, hence the error.


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