CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   [] OF7 compiling error on RHEL 6.5 (

ssdoria July 24, 2019 14: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:


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/
collect2: fatal error: cannot find 'ld'
compilation terminated.
make: *** [/opt/share/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/dummy/] Error 1

GCC version:


gcc -v
Using built-in specs.
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:


ld -v
GNU ld version 20100205

wyldckat July 25, 2019 19:02

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


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

  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 22: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 09:13


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 20:33

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.
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 14: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 03:17.