Hello Christian, * Christian Rössel wrote on Fri, Dec 10, 2010 at 02:56:51PM CET: > ./configure --enable-shared F77=mpif77 ... > > where mpif77 translates to > > ifort -I/opt/parastation/mpi2-intel/include > -L/opt/parastation/mpi2-intel/lib -Wl,-rpath > -Wl,/opt/parastation/mpi2-intel/lib -lmpich -lpthread > -L/opt/parastation/lib64 -Wl,-rpath,/opt/parastation/lib64 > -Wl,--enable-new-dtags -lpscom -lrt > > configure fails in finding PIC flags (mpicc (icc) and mpicxx (icpc) PIC > flags are discovered though): > > configure:17627: checking for mpif77 option to produce PIC > configure:17899: result: > > There is no more output concerning the PIC flags in config.log. > With F77=ifort everything works as expected: > > configure:16805: checking for ifort option to produce PIC > configure:17077: result: -fPIC
Yeah, that's because libtool.m4 macros partly match by name, unless the compiler claims to be GCC. A bit dumb, sure, but it's not easy to avoid because portable testing of these flags is not trivial. We might have to think about a more general way to extract the compiler name from an MPI driver (-show and -showme come to mind). For the moment you should be able to work around it using configure lt_cv_prog_compiler_pic_F77=-fPIC \ lt_cv_prog_compiler_pic_FC=-fPIC \ but I'm not sure if you also need fixes for missing -static and -Wl, flags (lt_prog_compiler_wl_F77 and lt_prog_compiler_static_F77 ...). This requires Libtool >= 2.4. Alternatively, the untested patch below should help as well. Can you try it out? Thanks for the report, Ralf Fix PIC flags with mpif77 using ifort on GNU/Linux. * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC) [linux]: Match Intel compiler also using $CC -V output, to avoid false negatives with compiler drivers like mpif77. Report by Christian Rössel. diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 1f61140..e735c75 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -4338,6 +4338,11 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [CF]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; esac ;; esac