From: Simon M. <sim...@sc...> - 2014-08-26 09:50:53
|
Yes, there is a specific behavior in the case of Scilab. Swig relies on Scilab to build and link. I would like to change this in the next version, and do as other target languages, for better integration purpose. I agree integrating makefiles is not a good solution for big projects. They are only here to run easily examples for each target language. About documentation I agree this one can be confusing. But I want this one consistent with the other language documentations: the first simplisitic example has to be the same. In fact, it is not the same now, I will fix this and remove any sentences related to the simple example, which is source of confusion. Howewer I can a remark about compiling the examples, and about the -addsources option which is very important. Thanks for your support ! I am expecting also a binary version to be released soon. Simon Le 26/08/2014 11:15, Ian Bell a écrit : > Ah I see. I think the issues come from the scilab wrapper having some > different behavior than all the wrappers I have so far worked with > (things like the -addsources for instance). This is also going to > cause problems for CMake integration I think as well. It's possible > to work around, but its very inconvenient. > > And a facepalm from me - I hadn't realized U stood for undefined, > which in hindsight does make a lot of sense. And had I realized that > I might have been able to make sense of the error. Its too bad that > it didn't die at the linking stage, which would have been much more > useful failure and might have suggested a linkage issue. A more > verbose output from the build chain overall would be extremely useful. > > Please(!) don't do what you did with the "simplistic" interface file > in the documentation. It is exactly due to this simplistic interface > file that I was unable to compile the simple example from the docs. > Now that I understand that issue, I think I am ok, hopefully I can get > everything compiling tonight. I've wasted many hours trying to get > the simple example to compile standalone. > > Running the make files is not really an option for larger, more > involved projects. In mine the build is all handled with CMake, so > everything needs to work standalone. > > Anyway, I think I am off to the races now. Thanks for your message. > > I look forward to a binary version of SWIG including Scilab support !! :) > > Ian > > > > On Tue, Aug 26, 2014 at 10:03 AM, Simon Marchetto > <sim...@sc... > <mailto:sim...@sc...>> wrote: > > 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 >> >> > > |