Home »
Public Forums »
archive »
Re: Using GNU gcc to compile for CALL_EXTERNAL
Re: Using GNU gcc to compile for CALL_EXTERNAL [message #5534] |
Mon, 15 January 1996 00:00 |
James Tappin
Messages: 54 Registered: December 1995
|
Member |
|
|
David Foster <foster@bial6.ucsd.edu> wrote:
> We use CALL_EXTERNAL quite a bit to call modules coded in c.
> Previously, we've used Sun's SPARCompiler to compile the
> routines. We are using Solaris 2.3 (soon to be 2.5). My
> question is, has anyone already worked out the compile/link
> options to use with the GNU gcc compiler? Also, any success
> (or failure) stories?
>
> Here are example compilation commands, in case it's useful:
>
> cc -c -G -Kpic image_proc_idl.c
> cc -c -G -Kpic array_utils.c -lsunmath -lm
> cc -G -o image_proc_idl.so image_proc_idl.o array_utils.o \
> -lsunmath -lm
>
> Dave Foster
> UCSD Brain Image Analysis Lab
> foster@bial6.ucsd.edu
The line I use (solaris 2.4, but it's not been changed since 2.2) is:
gcc -fPIC -G -DSOLARIS -o hsioshr.so -I$(HSIO) $(HSIO)/hs.c
HSIO being set to the directory where the source code resides as its in a
different tree. I guess you'll need to experimet a bit with the libraries the
key things are the "-fPIC -G" options.
--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+----------------------------------------------------------- --+---------+
|
|
|
Current Time: Sat Oct 11 03:57:59 PDT 2025
Total time taken to generate the page: 0.56590 seconds