Hi,

I've been playing with the Gumstix OE implementation and have had good luck so far, compiling packages and my own code.  I am trying now to compute an FFT - so I need to be able to perform trigonometric functions such as sine and cosine - and I'm having trouble.  I've tried compiling using glibc and uclibc (where do I set USE_C99_MATH btw, not sure if that's right or not), and in both cases I get the following error:

| NOTE: make -e MAKEFLAGS=
| arm-angstrom-linux-uclibcgnueabi-gcc -march=armv5te -mtune=xscale -L/home/friel/gumstix/gumstix-oe/tmp/staging/arm-angstrom-linux-uclibcgnueabi/lib -Wl,-rpath-link,/home/friel/gumstix/gumstix-oe/tmp/staging/arm-angstrom-linux-uclibcgnueabi/lib -Wl,-O1 fft_example.c fft.c print_to_file.c -o fft_example
| /tmp/ccPh6qL8.o: In function `fft':
| fft.c:(.text+0x2c8): undefined reference to `cos'
| fft.c:(.text+0x300): undefined reference to `sin'
| collect2: ld returned 1 exit status
| make: *** [fft_example] Error 1
| FATAL: oe_runmake failed


I have been searching the archives and google for some time now and had little luck with this.  One site suggested using the command 'nm' to find out if cos and sin are compiled into the library - I believe they are (excerpt below)

nm /home/friel/gumstix/gumstix-oe/tmp/staging/arm-angstrom-linux-gnueabi/lib/libm.a | grep cos
e_acos.o:
e_acosh.o:
00000000 T __ieee754_acosh
         U __cos32
         U __docos
         U __dubcos
00000000 T __ieee754_acos
e_cosh.o:
00000000 T __ieee754_cosh
         U __cos
         U __sincos
         U __cos
         U __sincos
         U __sincos
         U __cos
k_cos.o:
s_cos.o:
00001e7c T __cos
00001e7c T __cosl
         U __docos
         U __mpcos
         U __mpcos1
00001e7c W cos
00001e7c W cosl

The makefile I'm using is below - as you can see I have used the -lm flag for ld.

CC      = gcc
CFLAGS  = -c -Wall
LDFLAGS = -lm
SOURCES = fft_example.c fft.c print_to_file.c
OBJECTS = $(SOURCES:.cpp=.o)
EXECUTABLE = fft_example

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
        $(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
        $(CC) $(CFLAGS) $< -o $@


I could use some advice, getting close to putting in a LUT instead (might be a good option anyhow).

Thanks in advance,

Jim