[sac-user] Compiling SAC_from_C demos

Neumair Guenther - S0810306018 S0810306018 at students.fh-hagenberg.at
Thu Jun 7 17:36:54 CEST 2012

Dear SAC Team/Users, 

I have some trouble compiling the sac_from_c demo from sac2c-1.00-17729-beta-linux-i386.tar.gz

Simple programs like those in /sac/demos/applications/numerical/misc
compile without errors. However i have to use a SAC module within C so 
i tried compiling /sac/demos/basics/sac_from_c using the given makefile.
However the compiler throws out some undefined references

/opt/sac2c-1.00-beta-linux-athlon/sac/demos/basics/sac_from_c$ make
gcc -o summarizer summarizer.c `sac4c Sum -ccflags` `sac4c Sum -ldflags`
./libcwrapper.so: undefined reference to `SACf_ArrayTransform__sum__i_S'
./libcwrapper.so: undefined reference to `SACf_ArrayTransform__sum__d_S'
./libcwrapper.so: undefined reference to `SACf_ComplexArrayTransform__sum__SACt_ComplexArrayTransform__complex_S'
./libcwrapper.so: undefined reference to `SACf_ArrayTransform__sum__f_S'

The problem occurs when linking the module to the c object. Compiling the module
with first sac2c and after that sac4c both work.

I tried to compile a similar program on a virtual machine using the ubuntu-sac-livecd.iso and 
it worked perfectly. 

Are the examples in the sac2c-1.00-17729-beta-linux-i386.tar.gz version supposed to build out of the box or did i 
make a mistake? Is the interface described in the /sac/demos/basics/sac_from_c demo the suggested way to use SAC-functions 
in C?

Thanks in advance

More information about the sac-user mailing list