mpy/CyLP — pull request #3 by tkralphs (2013-07-04 17:04:28+00:00)
Title: Changes to allow building across major platforms (including Windows)

This is my first time creating a pull request or even using github in any serious way, so please forgive me my transgressions, whatever they turn out to be :). I tried building on Windows with your new setup.py script (this was the idea from the beginning---to generalize things so that the code would build out of the box on all platforms). You made a few tweaks to my approach and some of these actually broke the Windows build, so I restored these and tested on both Linux and Mac OSX to be sure nothing breaks on either of these platforms. With the changes here, the extension builds on all three platforms using your method (requiring the directory to be named CyLP and building in the directory ../). The changes that I made consisted of

1. CoinMP is a red herring for you, actually. It is not needed as a dependency. You only need Cbc and all of its dependencies. On Windows, leaving CoinMP causes problems so I left it off.
2. You don't even really need to explicitly consider any dependency other than Cbc, since all others follow and I think it's cleaner to leave them off.
3. When you switch to trunk and the soon-to--appear CoinAll 1.7, you won't need the hack of adding Clp/src explicitly to the list of include directories.
4. There is one additional library directory needed for Windows to include the libraries for the Intel Fortran compiler.
5. There is some weird stuff going on in some of the I*.cpp files in the cpp subdirectory. The MSVC++ compiler chokes on things like this:

ICoinMpsIO::ICoinMpsIO():CoinMpsIO::CoinMpsIO(){

It doesn't look like legal C++ to me, although it builds in Linux. It looks as though it should be simply:

ICoinMpsIO::ICoinMpsIO(){

and this works across the board on all platforms.

6. With the new setup.py, you don't need to explicitly list additional libraries, such as lapack and blas. They will be pulled in automatically.

With all of these changes, the build now works fine, but I still haven't figured out the install (at least on Windows) and the fact that you can't just run setup.py out of the box (you need to do as indicated in your makefile seems a bit clunky to me. I am no expert, but I would think a setup something like what i have in Dip/Dippy would work a little more straightforwardly. Move the whole directory structure down one level inside a subdirectory and put the setup.py at the root so that it can just run out of the box without arguments. If you want. I can try to do it and create another pull request.

Hope these changes are useful. In any case, i can at least build in Windows now, which was my original goal in suggesting all of this to you. I will look at the installation issues and may be hack something there. I'm still learning git and the ins and outs of Python installations, though, so bear with me.
Cheers,
Ted