I finally got SWIG+Scilab building on xubuntu and OSX, but cannot get anything, even the simple examples, to work. Here's where I stand:
On OSX I have a build script that looks something like (same thing on xubuntu, just apt-get instead of brew and different paths)
brew install autoconf automake pcre
./configure --with-scilab-inc=/Applications/scilab-5.4.1/Contents/MacOS/include --with-scilab=/Applications/scilab-5.4.1/Contents/MacOS/bin/scilab-cli --prefix=/Users/Ian/Desktop/swig-bin
Once I get swig+scilab built, if I do
cd Examples/scilab/simple, and I run make, I get a few errors about the
ilib_compile: An error occurred during the compilation:
In file included from example_wrap.c:759:0:
error: #error Using stack-c.h is deprecated. Please use api_scilab
instead (try 'help api_scilab'). Note the stack-c.h API will be removed
after Scilab 6.0. You can define __USE_DEPRECATED_STACK_FUNCTIONS__ to bypass this error.
#error Using stack-c.h is deprecated. Please use api_scilab instead
(try 'help api_scilab'). Note the stack-c.h API will be removed after
Scilab 6.0. You can define __USE_DEPRECATED_STACK_FUNCTIONS__ to bypass this error.
which I can resolve by doing something like swig -scilab -addcflag "-D__USE_DEPRECATED_STACK_FUNCTIONS__" *.i
which is not documented anywhere.
Running exec builder.sce
does appear to work, it makes the .so file, and when I run nm
libexamplelib.so I see all the necessary symbols. So far so good.
But then when I try to run the file runme.sci, I get
ian@ian-VirtualBox:~/Code/swig-scilab/Examples/scilab/simple$ ~/Desktop/scilab-5.4.1/bin/scilab-cli -f runme.sci
Scilab 5.4.1 (Mar 29 2013, 16:52:15)
addinter(libexamplelib_path + 'libexamplelib' + getdynlibext(), 'libexamplelib', list_functions);
addinter: The shared archive was not loaded: /home/ian/Code/swig-scilab/Examples/scilab/simple/libexamplelib.so: undefined symbol: Foo
at line 18 of exec file called by :
at line 3 of exec file called by :
which doesn't make sense because the symbol Foo is definitely exported in the .so. A snip from the nm libexamplelib.so:
00002b42 T example_Init
00002d34 T _fini
00005174 b fname
00002647 T Foo_get
000026f5 T Foo_set
00000dc0 t frame_dummy
00004eec t __frame_dummy_init_array_entry
00003960 r __FRAME_END__
think I am at the limits of my debugging abilities for the moment.
Once I get this working I really want to get it working on OSX and
windows. I'd be happy to contribute to the wiki my experiences if that
would be useful.