I am trying to build OpenMPI-1.2.6 with Lahey Fortran,
and I am running into problems.  The issue is buliding
shared libraries with Lahey.  Lahey can do it, but they
don't use the construct -fPIC to specify it.  They
use --shared.

If I don't include anything, then the build fails near
the end when linking with a Fortran object with an
error message like:


/usr/bin/ld: testcode.o: relocation R_X86_64_32S against `a local
symbol' can not be used when making a shared object; recompile with
-fPIC

If I add --shared to FCFLAGS, the configure process will not finish
(configure line below).  It crashes because when it tries to build
a small test program, it will seg fault.

# ./configure FCFLAGS=--shared CC=gcc CXX=g++ F77=lf95 FC=lf95 F90=lf95 --prefix=/opt/openmpi/1.2.6-lahey-8.00a --without-gridengine --enable-io-romio --with-io-romio-flags=--with-file-sys=nfs+ufs --with-openib=/opt/hjet/ofed/1.3.1

Relevant config.log output:

configure:36725: checking if Fortran compiler works
configure:36781: lf95 -o conftest --shared   conftest.f  >&5
Encountered 0 errors, 0 warnings in file conftest.f.
configure:36784: $? = 0
configure:36790: ./conftest
./configure: line 36791: 29048 Segmentation fault      ./conftest$ac_exeext
configure:36793: $? = 139
configure: program exited with status 139
configure: failed program was:
|       program main
|
|       end


So my hack to fix this was to add --shared to the
FCFLAGS in ompi/mpi/f90/Makefile and build the
code.

What is the correct way for the configure process
to know that if the compiler is lf95, to use
--shared when compiling objects?

Thanks,
Craig



--
Craig Tierney (craig.tier...@noaa.gov)

Reply via email to