Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28558 Discussions

Compiling 32 bit gfortran program with Makefile on Centos 7 gives errors such as: /bin/ld: cannot fi


I downloaded the latest release of gfortran from: gcc-11.1.0.tar.xz to a VMware Centos 7 32 bit Virtual Machine.

I was able to build gfortran and run a Fortran hello world program.

When I run my company's Makefile to build a "complex" Fortran proprietary program, I get the following errors. (Note: xyz, abc.o and rst.o are not the actual identifiers in the output.)

Making xyz
Making xyz1.Linux
Loading xyz1 ...gfortran -w -u -g -m32 -static xyz.o abc.o rst.o ../../libs/lib1/1.a -lpthread ../../libs/lib1/1.a -lpthread -o xyz

/bin/ld: cannot find -lpthread
/bin/ld: cannot find -lpthread
/bin/ld: cannot find -lgfortran
/bin/ld: cannot find -lm
/bin/ld: cannot find -lquadmath
/bin/ld: cannot find -lm
/bin/ld: cannot find -lc

collect2: error: ld returned 1 exit status 
make: *** [PROGRAM] Error 1

I found this in the gfortran directory that I downloaded gfortran to : gcc-11.1.0-32bit/lib/

And, I found these two symbolic links:

cd /bin;ls -laF ld
/bin/ld -> /etc/alternatives/ld*

cd /etc/alternatives;ls -laF ld 
/etc/alternatives/ld -> /usr/bin/ld.bfd*

cd ld.bfd
-bash: cd: ld.bfd: No such file or directory

Question: What do I do to compile everything with this Makefile (Fortran program)?

In order to get past a previous Makefile error: I executed the following command because the Makefile couldn't find the csh:

sudo yum install csh

0 Kudos
2 Replies
Honored Contributor III

This forum is for the Intel Fortran compiler only, not gfortran. I suggest instead asking in Fortran Discourse - Fortran open source community (

(Edit: I see you already did that. You're getting help there.)

0 Kudos

Thanks for the information, I've posted the question to the suggested group.

0 Kudos