From: Simon M. <sim...@sc...> - 2014-08-26 08:03:53
|
I have been able to run the Swig Scilab test-suite without any problem on a fresh installation of xubuntu. If you look on your log : 00000000002052e0 b fname U Foo 00000000000032ab T Foo_get 0000000000003381 T Foo_set you see that the symbol Foo (static variable Foo) is undefined (U). The reason comes from the command line you typed: /home/ian/swig-scilab/bin/swig -scilab example.i With this, you don't build (and link with) the source code example.c, which is in the simple folder, and defines the static variable Foo : /* A global variable */ double Foo = 3.0; You need the Swig Scilab option -addsources to build and link with other sources. But I recommend you to use the makefiles that are provided with all examples and that do all this for you. In the simple folder, you just run make. Simon Le 19/08/2014 19:14, Ian Bell a écrit : > The simplest example still does not work on scilab 5.5 in xubuntu!! I > am getting incredibly frustrated with swig+scilab. I have a very > boring xubuntu virtual box on an OSX host - its quite fresh > installation - this is my testing server. > > I built swig with scilab support from the gsoc2012-scilab branch using > > ./configure > --with-scilab=/home/ian/Downloads/scilab-5.5.0/bin/scilab-cli > --with-scilab-inc=/home/ian/Downloads/scilab-5.5.0/include/ > --prefix=/home/ian/swig_scilab > > then make, make install. I then did a > > /home/ian/swig-scilab/bin/swig -scilab example.i > > in the Examples/scilab/simple folder of the swig source. It generates > builder.sce and example_wrap.c files. I start up scilab-cli. I run > exec builder.sce. It builds libexample.so. > > I try to load the module from scilab-cli using > > exec loader > > using scilab-cli as per the instructions, I get the following output: > > -->addinter(libexample_path + filesep() + 'libexample' + > getdynlibext(), 'libexample', list_functions); > nlibext(), 'libexample', list_functions) > !--error 236 > addinter: The shared archive was not loaded: > /home/ian/Code/swig-scilab/Examples/scilab/simple//libexample.so: > undefined symbol: Foo > at line 20 of exec file called by : > exec loader.sce > > The libexample.so generated clearly has the Foo symbol exported. A > snip from nm libexample.so: > > 00000000002052e0 b fname > U Foo > 00000000000032ab T Foo_get > 0000000000003381 T Foo_set > 00000000000014f0 t frame_dummy > > There's no way to debug anything as far as I can see. The shared > library has the symbol, it won't load it. I would so love to wrap my > library for scilab, but the current situation is not good. > > > On Tue, Aug 19, 2014 at 5:43 PM, Simon Marchetto > <sim...@sc... > <mailto:sim...@sc...>> wrote: > > Hello, > > I did some minor modifications on braces for coding style, and a few > fixes in documentation. > I think this branch is ready and won't have any other changes in this > summer :-), except if you ask. > > Regards, > > Simon > > > Le 11/08/2014 20:02, William S Fulton a écrit : > > On 08/08/14 17:13, Simon Marchetto wrote: > >> Hello, > >> > >> I have fixed all the remaining issues. > >> For most of them, I follow your indications, for a few I could'nt. > >> Below you can find the details. > > Thanks, I'll look over them in the next few days. > >> > >> I am having now a last look on the code and the documentation. > >> For example checking the coding style. About this : > documentation says > >> to apply K&R style on C/C++ module source code. But on > typemaps source > >> code ? > >> > > Use the same style as in the SWIG source code, but using spaces is > > better than tabs because you don't know what the tab setting for > users > > is set to. Can you let me know if you're going to make changes > in this > > area? > > > >> > >> - Can you add the Swig banner to all generated files please, > it is > >> missing in a few of them. > >> > >> > >> Which files ? There are files like loader.sce with no SWIG banner, > >> but they are generated by Scilab. > >> > > Okay, that makes sense then. > > > > William > > > ------------------------------------------------------------------------------ > _______________________________________________ > Swig-devel mailing list > Swi...@li... > <mailto:Swi...@li...> > https://lists.sourceforge.net/lists/listinfo/swig-devel > > |