bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] gsl-1.7, Solaris C, failed make check in siman


From: Diab Jerius
Subject: [Bug-gsl] gsl-1.7, Solaris C, failed make check in siman
Date: Mon, 06 Mar 2006 18:19:55 -0500

gsl-1.7
Sun Solaris C, (Sun Studio 10, Sun C 5.7)

when compiled with any optimization less than -x04, Sun C is choosing
not to inline the square function in siman/test.c, causing linker
errors:

/bin/bash ../libtool --mode=link cc      -o test  test.o libgslsiman.la 
../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la 
../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la -lm
cc -o test test.o  ./.libs/libgslsiman.al ../rng/.libs/libgslrng.al 
../ieee-utils/.libs/libgslieeeutils.al ../err/.libs/libgslerr.al 
../test/.libs/libgsltest.al ../sys/.libs/libgslsys.al 
../utils/.libs/libutils.al -lm
Undefined                       first referenced
 symbol                             in file
square                              test.o
ld: fatal: Symbol referencing errors. No output written to test
*** Error code 1
make: Fatal error: Command failed for target `test'


Here's a snippet from Sun's docs which explains what happens

        The compiler will inline calls to inline definitions only when
        optimizing and only when the compiler optimizer believes it is
        profitable to do so. Otherwise a call to an external function
        will be made. Therefore any program containing inline
        definitions should link with an object file containing an extern
        function definition.

The following change to the double prototype fixed the problem:

% diff test.c.orig test.c
42c42
< inline double square (double x);
---
> extern inline double square (double x);


Thanks,

Diab



-- 
Diab Jerius                  Harvard-Smithsonian Center for Astrophysics
                             60 Garden St, MS 70, Cambridge MA 02138 USA
address@hidden      vox: 617 496 7575         fax: 617 495 7356







reply via email to

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