Spain. While doing that, I also asked Mathworks about the possibility of
getting a MATLAB license for the SWIG development. They said that they
would get back to me about that. If I don't hear back, I could try again.
Maybe contacting the Mathworks USA directly.
Post by Michael TeschHi, comments inline below....
On Mon, Dec 8, 2014 at 10:12 PM, Kris Thielemans <
Post by Kris ThielemansFrom: William S Fulton, Sent: 08 December 2014 20:22
Post by William S FultonPost by Michael TeschHello,
I'm working on the matlab module, and am wondering what would be the
best way to provide the travis-ci testing support.
The problem is that there doesn't seem to be a reasonable way to run
MATLAB from within travis-ci.
What is the problem here? Is there something different to all the other
languages?
I don't know travis-ci, so I have no idea what specifically is going wrong.
1. running MATLAB requires an expensive license, many of us probably
have access to this through institutional licenses
2. there is no PPA for MATLAB (as far as I can tell, and the reason is
likely related to 1. BUT I'm not a Ubuntu user, so maybe there's a better
way that I dont know about...?)
3. travis-ci seems to be -only- a framework to run builds on their
Ubuntu/MacOS server farm... it's not clear if it's possible to run it
locally and separately from their farm, I could find a few blog posts about
how to do it, but it all seemed a little hacky and unsupported if that even
works, and it wasn't clear to me if their home-grown results would be
posted to the travis-ci website.
4. It may be possible to get a MATLAB license, and create a travis-ci
script to install and activate MATLAB on the testing instance, but I think
at the moment we're a long way from that at this point (cost of license, if
it would be within the license terms, travis-ci issues, etc...).
This is what I envisage and urge you to pursue. It is one license that
is installed on a cloud setup. Hopefully their licensing has moved into the
21st century.
So, until we figure out the MATLAB issue, I'm proposing that what do is
to limit the travis-ci testing for swig-matlab to: create all the wrappers
for the test-suite, compile them, and link to a dummy library that emulates
the MATLAB interface.
That sounds like a lot of work and doesn't guarantee very much wrt
running tests. Clearly it is better than nothing, but my opinion is it
would be better to spend time on getting a license for the SWIG project
instead. Also, wouldn't it be better to use gnumex? Surely that would
provide an api to compile against and you wouldn't have to reinvent what
gnumex already do? The tests might even run if gnumex is advanced enough
and will be easily installed on the Travis environment.
Until we can run MATLAB on travis-ci, the actual test execution would
have to be done by people with MATLAB licenses.
- get travis-ci worker environment to run on a machine that has a MATLAB
license
- get a MATLAB license that we can run on travis-ci (directly from
Mathworks?), and figure out how to install MATLAB on travis-ci workers in
the 'before_install' phase (should be do-able, the matlab install script
can be run non-interactively)
Post by Kris ThielemansIf this testing is to work in Travis, MATLAB needs installing from
Post by William S Fultonsomewhere, most likely via a ppa? What did you have in mind?
I'm afraid this is impossible. MATLAB is commercial (and expensive). I think
the only thing that could be done is to let travis-ci run the MATLAB tests
by those people who happen to have a MATLAB installation.
Post by William S FultonPost by Michael TeschWould it be enough, as far as travis-ci is concerned, to simply
compile & link the wrapper files for the tests using the same flags
that MATLAB would?
The wrappers are usually compiled with the default compiler flags.
However, some language modules will compile with the flags that
extensions are expected to be compiled with. If you are going to use
non-default compiler flags, you'll need to pull the compile and link
flags out of the configuration for the target language. Usually this is
done via pkg-config or similar tools such as python-config and
php-config during configure time. Anything else will lead to a messy
configure.ac script which will need lots of platform and compiler
specific code.
Pkg-config etc have no idea about MATLAB.
I guess this will be a stupid question, as I haven't checked travis-ci, but
from your comment I suppose it runs completely independent from SWIG's
configure process? That would create complications as it'd be hard to
guarantee that the the travis-ci build will use the same options as the
configure (there could be 2 matlabs for instance). Possibly the configure
process could create the files necessary for travis-ci?
Currently, the test-suite in SWIG uses configure to find where MATLAB is,
and then compiles the wrappers with "mex", which is a script that comes with
MATLAB that calls the actual C++ compiler but with appropriate flags. Is
this not reusable?
Alternatively, you can find out (by running mex) what flags to use and then
just call the C++ compiler yourself. You might have seen the
CMakeFiles.txt
stuff that I sent round which does this. It's quite tricky to do this in
general (depends on MATLAB version etc etc).
So you are saying that you can use mex to obtain the flags for
passing to the compiler and linker? If so, the configure.ac should focus
on finding mex and then using it to extract the compile and link flags.
That is essentially all it needs to do. So sounds like you need to port the
CMake stuff to the autotools. Or even better, I just found
http://gnumex.sourceforge.net/autotools/. It already has the MATLAB
autoconf detection and sets the flags. I'd prefer we used and contributed
back to these m4 macros than maintain our own.
I really hope that mex is not anything like Scilab's builder. I'm against
using anything other than the SWIG build system for testing given the
experience over the years, so I doubt I'd be comfortable with mex compiling
the code.
This is key -- end users will almost always compile the SWIG wrapper
using 'mex' (actually just a shell script that sets some compile and link
flags- a poor man's make), but the mex compile flags are different for
every platform and version of matlab. The current SWIG configure.ac for
matlab looks for a matlab installation and uses that to compile the
wrapper. I started separating the wrapper generation from the matlab
detection here: (because actually you dont need matlab at all to generate a
SWIG wrapper...right?)
Correct, if you have to have MATLAB installed on the machine in order for
SWIG to generate everything required then there is something fundamentally
wrong. The output generated from SWIG must be independent of OS and
versions of everything else.
https://github.com/tesch1/swig/blob/d78648fa874ea7fdbd5197712464f4ccaa5ea4ec/configure.ac#L975
https://github.com/tesch1/swig/blob/matlab-travis-ci/Examples/Makefile.in#L471
the idea is that you could do ./configure --with-matlab=R2011b-glnxa64
instead of --with-matlab=/usr/local/MATLAB/R2011b
It's not yet at the point of working, it still needs a dummy library to
link the wrapper against, but the basic idea is there -- when running
configure, the travis-ci test script can specify a "matlab version to
target" instead of detecting the currently installed matlab.
That branch also has the start of travis-ci support for matlab, but it
https://travis-ci.org/tesch1/swig
Independently of whether a MATLAB license is obtained for Travis, it
is essential that the normal './configure && make && make-check' works on a
machine with matlab installed. Without this I won't consider any merging
anything into master.
Cheers,
Michael
Post by Kris ThielemansPost by William S FultonI'd like to help you get this set up correctly sooner rather than later.
Getting the build system correct is essential for me to consider merging
into master. Once you have it working, I'll take a look for you.
Thanks for your offer. Unfortunately, the commercial nature seems to make it
rather tricky to get this running on your system. Possibly we could ask
someone to sponsor a license for you as well...
What I was thinking is if the MATLAB licensing can be sorted out to
run on Travis, then I'd be able to help as would any other member of the
SWIG community. If that is not possible, then there isn't much I can do in
this area as I don't really need nor want my own private Matlab license.
William
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Swig-devel mailing list
https://lists.sourceforge.net/lists/listinfo/swig-devel