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: Wed, 15 Dec 2010 16:38:13 +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.

I upgraded to 2.4. but this leads to another error. I will investigate this.

> Alternatively, the untested patch below should help as well.  Can you
> try it out?

Unfortunately the patch didn't work. configure does not execute the new
case branch although the innermost condition matches.

BTW, the same problem occurs for mpif77 and mpif90 using the PGI
compilers. Called with -V they produce:

pgf90 10.9-0 64-bit target on x86-64 Linux -tp core2-64
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2010, STMicroelectronics, Inc. All Rights Reserved.

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



reply via email to

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