On 23JAN2002, Erik Lindahl wrote:

> I'm trying to add support for the Intel icc and ifc C and Fortran
> compilers under linux,
> but both these compilers have the nasty habit of writing the filename
> and compile-time
> remarks to stderr.
> 
> This means that libtool tests for the -static flag, -DPIC/-fpic, etc
> fail since they all
> interpret anything on stderr as a warning or error.


While it's true that writing to stderr is a nasty habit, I don't
believe that that's what's causing libtool to fail.  From what I can
tell, the problem is caused by libtool not recognizing icc as either
gcc or a vendor compiler.  It therefore sets can_build_shared to "no"
and refuses to build a shared library.

The kludge that I'm currently using is to detect the Intel compiler,
trick libtool into thinking it's running under Solaris -- Sun's
compiler uses similarly named flags to Intel's -- invoke
AM_PROG_LIBTOOL, and reset the host OS:

AC_PROG_CC_INTEL_LINUX
if test "$ac_cv_prog_cc_intel_linux" = yes; then
   true_host_os=$host_os
   host_os=solaris_no_just_kidding
fi
AM_PROG_LIBTOOL
if test "$ac_prog_cc_intel_linux" = yes; then
   host_os=$true_host_os
fi

...where I've defined AC_PROG_CC_INTEL_LINUX as follows:

dnl Determine if the C compiler is likely to be the Intel Linux compiler.
AC_DEFUN(AC_PROG_CC_INTEL_LINUX,
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for the Intel Linux C compiler],
   ac_cv_prog_cc_intel_linux,
   [ac_cv_prog_cc_intel_linux=no
    case "$host_os" in
     *linux*)
       test `$CC -V 2>&1 | egrep -c 'Intel.*C.*Compiler'` -gt 0 && 
ac_cv_prog_cc_intel_linux=yes
       ;;
    esac
   ])
if test "$ac_cv_prog_cc_intel_linux" = yes; then
   AC_DEFINE([INTEL_LINUX_CC], ,
     [Define if your C compiler is the Intel compiler for Linux.])
fi
])

 
> So, do you guys have any ideas or opinions about this?
> 
> One possible way of doing it could be to scan the stderr output for the
> option
> we are testing, and only fail the test if there seems to be a report
> about a flag.
> 
> By scanning for the flag we are testing, or one of the words "option" or
> "flag" I'm
> pretty sure we should cover everything.


Another way is to generate a wrapper script that filters out whatever
is written to stderr on a "clean" compile+link.  I started writing
some Autoconf code to do this, but abandoned it when I discovered
that the aforementioned kludge was all that was necessary to get icc
working.

I hope this helps,

-- Scott



_______________________________________________
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool

Reply via email to