Tuesday, October 22, 2013

Compiling Error "Could not run a simple Fortran 77 program. Aborting." when compiling OpenMPI 1.6.5 with GCC 4.8.1 on CentOS 6

I was compiling OpenMPI 1.6.5 with GCC 4.8.1 on CentOS 6.3, I encountered this error "Could not run a simple Fortran 77 program. Aborting."

For more information on compiling GCC, do take a look at  Compiling GNU 4.8.1 on CentOS 6


A quick look, shows that my .bashrc was incorrect written. My PATH and LD_LIBRARY_PATH should reflect the pathing of GCC

export PATH=$PATH:/usr/local/gcc-4.8.2/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc-4.8.1/lib

Secondly, another possible issue could be due to incomplete or unlinked gfortran libraries. Do check with your /usr/local/gcc-4.8.1 that your libgfortran.so.3 is linked and present with the right libraries.


 Lastly, you can force the OpenMPI to compile F77 and FC with the following configuration
# ./configure --prefix=/usr/local/openmpi-1.6.5-gcc-4.8.1 \ 
F77=gfortran FC=gfortran --with-devel-headers --enable-binaries

No comments: