libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PIC flags not found for mpif77(ifort)


From: Christian Rössel
Subject: Re: PIC flags not found for mpif77(ifort)
Date: Thu, 16 Dec 2010 17:18:20 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

Hi Ralf,

Am 12/10/2010 6:55 PM, schrieb Ralf Wildenhues:
> 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?

the patch works if you double quote "CF" and patch _AC_LANG_COMPILER_GNU
(see other mail):

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

Thanks,
Christian

> 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

--
Christian Rössel
Jülich Supercomputing Centre
Telefon +49 2461 61-1773

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]