[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] building a shared object
From: |
SiTex Graphics |
Subject: |
Re: [Gm2] building a shared object |
Date: |
Mon, 10 May 2010 09:21:30 -0700 |
Hi Gaius,
Thanks for the FIO fix.
I sent a repro archive for a compile failure when trying to build a
shared object on April 23. Did you receive that?
I'm still trying to figure out the general workflow for building a
shared object:
1. How do I specify which symbols are exported?
2. What command line options are required? I've looked at the swig
example, but I don't know which steps are specific to swig and which
are required for any shared object. E.g., do I always have to use
-fmakelist and -fuselist?
Thanks,
Scott
On Wed, Apr 21, 2010 at 4:20 PM, Gaius Mulley <address@hidden> wrote:
> SiTex Graphics <address@hidden> writes:
>
>> Is there a simple example of how to build a shared object with gm2? I
>> assume I can just use -fshared to produce a .so, but how do I specify
>> which functions or symbols are exported?
>>
>> I failed to find any info in the manual but I may well have overlooked
>> something...
>>
>> Thanks,
>> Scott
>
> Hi Scott,
>
> there is a section: How to produce swig interface files
> in the documentation - which describes the process. I need to write
> another section just describing the shared library, rather than the
> combination of swig and shared libraries..
>
> Also there are a few examples under:
>
> gcc-4.1.2/gcc/gm2/examples/swig
>
> I've recently modified the examples so that most of them build from
> the build directory:
>
> so:
>
> $ cd build-4.1.2/gcc/gm2/examples/swig/tiny
> $ make pre-install
>
> should yield:
>
> rm -f -f *.o *.so a.out *.pyc *~ *_wrap* tiny.py *.i *.lst *_m2.cpp
> ../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fshared
> -fswig
> -I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny:../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs-iso
> -c -fPIC -g -fswig
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
> swig -c++ -python tiny.i
> ../../../../g++ -c -fPIC tiny_wrap.cxx -I/usr/include/python2.5
> ../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fshared -c
> -fPIC -g -fmakelist
> -I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny:../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/../../../gm2-libs-iso
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
> ../../../../xgm2 -B../../../.. -B../../../../stage1/gm2 -fuselist
> -fobject-path=.:../../../gm2-libs/SO:../../../gm2-libs-pim/SO:../../../gm2-libs-iso/SO
> -fPIC -g -shared -fshared
> -I../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/tiny.mod
> tiny_wrap.o -o _tiny.so
> PYTHONPATH=.:../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny
> python
> ../../../../../../gcc-4.1.2/gcc/gm2/examples/swig/tiny/testtiny.py
> starting Modula-2 tiny
> inside Python
> calling out
> finishing Python
> finishing Modula-2 tiny
>
> regards,
> Gaius
>
- Re: [Gm2] building a shared object,
SiTex Graphics <=