libtool
[Top][All Lists]
Advanced

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

override compiler, but also linker


From: John Donners
Subject: override compiler, but also linker
Date: Wed, 16 May 2012 14:48:18 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Dear all,

I'm having some trouble with building a large software
package using libtool. It consists of many smaller libraries,
of which only one uses MPI for parallel processing.
I only want to use the MPI-compiler wrappers for this one,
but this is difficult with one libtool for the whole project.

The important section in libtool is:

# ### BEGIN LIBTOOL TAG CONFIG: FC
...
# A language specific compiler.
CC="ifort"

...
archive_cmds="\$CC -shared -nofor_main \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
...

I can override the compiler by setting FC=mpif90 in the Makefile, so then it
calls libtool as follows:

/bin/sh ../../../../../../libtool --tag=FC   --mode=link mpif90 ...
libtool: link: mpif90 -shared -nofor_main ...

Unfortunately, this does not override the compiler used in the linker-command:

/bin/sh ../../../../../../libtool --tag=FC  --mode=link mpif90 ...
libtool: link: ifort -shared -nofor_main ...

Apparently, it keeps using the CC as defined in the selected section in libtool.

I solved the problem temporarily with the following change in libtool:

archive_cmds="\${FC:-\$CC} -shared -nofor_main \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"

which uses the correct linker command, both with and without setting FC.
But I guess there is a more appropriate (and permanent) way of doing this.
I hope you could help me with some suggestions.

Cheers,
John

--
John Donners
Consultant
OSD
SARA    
Science Park 140
1098 XG Amsterdam
T +31 (0)20 592 3055
F +31 (0)20 668 3167
M +31 (0)6 1903 9023
E address@hidden
www.sara.nl




reply via email to

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