Does AIX support C intrinsics cosf, sinf, tanf...

Does AIX support C intrinsics cosf, sinf, tanf...

Post by Charlie Zende » Thu, 07 Feb 2002 03:44:39



Hi,

Does the xlc compiler and/or AIX have any way of accessing the
float version of math functions? When I include math.h and link
to libm.a I cannot find these functions. Yes, I know these are
not required by the ANSI standard, but they are supported by
it. Perhaps they are in some other library? Many other Unices
(Solaris, Linux, IRIX) do support these intrinsics.

Any information appreciated,
Charlie

xlc -qmaxmem=8192 -O -o /home/babyblue/zender/bin/AIX/ncap
/home/babyblue/zender/obj/AIX/ncap.o
/home/babyblue/zender/obj/AIX/ncap_utl.o
/home/babyblue/zender/obj/AIX/getopt.o
/home/babyblue/zender/obj/AIX/getopt1.o
/home/babyblue/zender/obj/AIX/ncap.tab.o
/home/babyblue/zender/obj/AIX/ncap_lex.o -ll -ly
-L/home/babyblue/zender/lib/AIX -L/usr/local/apps/netcdf-3.5/lib32/r4i4
-lnco -lnetcdf -lm
ld: 0711-317 ERROR: Undefined symbol: cosf
ld: 0711-317 ERROR: Undefined symbol: .fabsf
ld: 0711-317 ERROR: Undefined symbol: .fmodf
ld: 0711-317 ERROR: Undefined symbol: .powf
ld: 0711-317 ERROR: Undefined symbol: sinf
ld: 0711-317 ERROR: Undefined symbol: tanf
ld: 0711-317 ERROR: Undefined symbol: acosf
ld: 0711-317 ERROR: Undefined symbol: asinf
ld: 0711-317 ERROR: Undefined symbol: atanf
ld: 0711-317 ERROR: Undefined symbol: expf
ld: 0711-317 ERROR: Undefined symbol: logf
ld: 0711-317 ERROR: Undefined symbol: log10f
ld: 0711-317 ERROR: Undefined symbol: sqrtf
ld: 0711-317 ERROR: Undefined symbol: gammaf
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
make: *** [ncap] Error 8

--
Charlie Zender, zender at uci dot edu, (949) 824-2987, Department of
Earth System Science, University of California, Irvine CA 92697-3100

 
 
 

Does AIX support C intrinsics cosf, sinf, tanf...

Post by Dan Fost » Tue, 26 Feb 2002 13:54:50




Quote:

>Does the xlc compiler and/or AIX have any way of accessing the
>float version of math functions? When I include math.h and link
>to libm.a I cannot find these functions. Yes, I know these are
>not required by the ANSI standard, but they are supported by
>it. Perhaps they are in some other library? Many other Unices
>(Solaris, Linux, IRIX) do support these intrinsics.

Looks like libC or variant is your ticket. Posted and mailed.

$ oslevel
4.3.3.0

$ cd /usr/lib
$ for file in `ls *.a`

Quote:> do
>    echo "Processing: $file"
>    nm $file|grep cosf
> done

Processing: libC.a
acosf                U          -
cosf                 U          -
.acosf               T  268676556
.cosf                T  268677512
acosf                D  536880080      12
cosf                 D  536875832      12
Processing: libC128.a
acosf                U          -
cosf                 U          -
.acosf               T  268680568
.cosf                T  268681524
acosf                D  536881160      12
cosf                 D  536875712      12
Processing: libC128_r.a
acosf                U          -
cosf                 U          -
.acosf               T  268680568
.cosf                T  268681524
acosf                D  536881160      12
cosf                 D  536875712      12
Processing: libC_r.a
acosf                U          -
cosf                 U          -
.acosf               T  268676556
.cosf                T  268677512
acosf                D  536880080      12
cosf                 D  536875832      12

 
 
 

Does AIX support C intrinsics cosf, sinf, tanf...

Post by Charlie Zende » Tue, 26 Feb 2002 15:26:02


Yes but unfortunately libC.a appears to be the C++ library and I am
trying to keep my code ANSI C so I need these functions in libc.a
and accessible from xlc not xlC. This problem is very case sensitive...

--
Charlie Zender, zender at uci dot edu, (949) 824-2987, Department of
Earth System Science, University of California, Irvine CA 92697-3100

 
 
 

Does AIX support C intrinsics cosf, sinf, tanf...

Post by Dan Fost » Tue, 26 Feb 2002 16:28:32




Quote:>Yes but unfortunately libC.a appears to be the C++ library and I am
>trying to keep my code ANSI C so I need these functions in libc.a
>and accessible from xlc not xlC. This problem is very case sensitive...

Hrm. I'm not a developer, but if that's the case, then I think you'd
have to come up with your own floating point routines because I didn't
see those functions in any other libs on a well-loaded AIX 4.3.3 system.

-Dan

 
 
 

Does AIX support C intrinsics cosf, sinf, tanf...

Post by Olaf Rogalsk » Tue, 26 Feb 2002 20:24:21



> Yes but unfortunately libC.a appears to be the C++ library and I am
> trying to keep my code ANSI C so I need these functions in libc.a
> and accessible from xlc not xlC. This problem is very case sensitive...

You can link any library, in what ever weird language it was written,
against your C program. This is all what linking is about: binding
together
*object* code, not source code.