autoconf
[Top][All Lists]
Advanced

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

AC_F77_DUMMY_MAIN failure with Oracle Solaris Studio 12.2 compilers


From: Christian Rössel
Subject: AC_F77_DUMMY_MAIN failure with Oracle Solaris Studio 12.2 compilers
Date: Wed, 4 May 2011 14:34:33 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

Hi all,

the macro AC_F77_DUMMY_MAIN (and AC_FC_DUMMY_MAIN as well) causes
configure to abort when using Oracle Solaris Studio 12.2 compilers.

This is the relevant configure output:

...
checking for Fortran 77 libraries of f77...  -lfai -lfui -lfsu -lsunquad
-lmtsk -lpthread -lm /opt/packages/studio/12.2/prod/lib/libc_supp.a
checking for gcc... cc
checking whether we are using the GNU C compiler... no
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking for dummy main to link with Fortran 77 libraries... unknown
configure: error: in `/home/roessel/studio_ac_dummy_main/_build_studio':
configure: error: linking to Fortran libraries from C fails
See `config.log' for more details

config.log (attached) reveals a linking error:

configure:3203: cc -o conftest -g   conftest.c   -lfai -lfui -lfsu
-lsunquad -lmtsk -lpthread -lm
/opt/packages/studio/12.2/prod/lib/libc_supp.a >&5
/usr/bin/ld: cannot find -lmtsk

All libraries are available on my system but the compile command lacks
"-L<path>" LDFLAGS. It is interesting that the result of "checking for
Fortran 77 libraries of f77" does not have any LDFLAGS at all.

I also checked with gcc, intel, pgi and (bg)xl compilers. They all pass
the AC_F77_DUMMY_MAIN macro. But in contrast to the studio compiler they
return -L LDFLAGS for the Fortran library check, e.g.

checking for Fortran 77 libraries of ifort...
-L/opt/packages/intel/11.1.072/lib/ia32
-L/usr/lib/gcc/i486-linux-gnu/4.4.5/
-L/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/ -L/lib/../lib/
-L/usr/lib/../lib/ -L/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../ -L/lib/
-L/usr/lib/ -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lirc_s -ldl

So, why are the -L flags missing when compiling with the studio
compiler? By looking at config.log I actually found the relevant paths
(line 166 of config.log):

/usr/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
--enable-new-dtags /opt/packages/studio/12.2/prod/lib/crti.o
/opt/packages/studio/12.2/prod/lib/crt1.o
/opt/packages/studio/12.2/prod/lib/values-xi.o conftest.o -o conftest -Y
"/opt/packages/studio/12.2/prod/lib/compilers/rtlibs/usr/lib:/opt/packages/studio/12.2/lib:/opt/packages/studio/12.2/prod/lib:/lib:/usr/lib"
-Qy
"-R/opt/packages/studio/12.2/lib:/opt/packages/studio/12.2/prod/lib/compilers/rtlibs/usr/lib:/opt/packages/studio/12.2/lib"
-lfai -lfui -lfsu -lsunquad -lmtsk -lpthread -lm -lc
/opt/packages/studio/12.2/prod/lib/libc_supp.a
/opt/packages/studio/12.2/prod/lib/crtn.o

It's either the -Y or the -Qy option given to ld:

-Y
"/opt/packages/studio/12.2/prod/lib/compilers/rtlibs/usr/lib:/opt/packages/studio/12.2/lib:/opt/packages/studio/12.2/prod/lib:/lib:/usr/lib"

-Qy
"-R/opt/packages/studio/12.2/lib:/opt/packages/studio/12.2/prod/lib/compilers/rtlibs/usr/lib:/opt/packages/studio/12.2/lib"

To have a successful outcome of AC_F77_DUMMY_MAIN it is in my case
sufficient to additionally pass
LDFLAGS=-L/opt/packages/studio/12.2/prod/lib/compilers/rtlibs/usr/lib to
configure, so it can be either of the two options. But according to "man
ld" I assume it is -Y.

I identified _AC_FC_LIBRARY_LDFLAGS (lib/autoconf/fortran.m4) as the
macro where the actual parsing of the ld output is performed in order to
deteremine the linker flags. There we already look for a "-YP" option.
Is it sufficient to just add a -Y case there? If yes, how can this be done?

The above observations were made using following minimal configure.ac:
AC_INIT([ac_f77_dummy_main_test],[1],[])
AC_F77_DUMMY_MAIN
AC_OUTPUT

Any help appreciated.

Best regards,
Christian
--
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
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Besuchen Sie uns auf unserem neuen Webauftritt unter www.fz-juelich.de

Attachment: config.log
Description: Text Data


reply via email to

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