quantlib-swig

Quantlib-SWIG - how to do a clean rebuild on windows/msvc


I had Quantlib (1.4) and Quantlib-SWIG/Python successfully installed (compiled using MS Visual Studio Express 2013 for quantlib and as per the readme, using python setup.py build followed by python setup.py install. )

I then wanted to modify some of the SWIG files, and reinstall. I tried python setup.py clean --all to get the modified files to be picked up on a subsequent build, but that didn't work.

Under linux it is fine, I just do make clean and then reinstall using python setup, but under Windows (where I don't have make installed), I am drawing a blank.


Solution

  • If you modified the SWIG files, you need to run python setup.py wrap to regenerate the C++ and Python wrappers that you'll compile and install (note that you'll need the SWIG executable swig.exe in your PATH). After this, running python setup.py build and install again will give you the updated module.

    On linux, the Makefile knows about the additional step and does it for you (in fact, you shouldn't even need to run make clean; just running make should work, since make will notice that the SWIG files are newer than the wrappers).