Building QuantLib for Python on Win XP

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Building QuantLib for Python on Win XP

newbie73
I have compiled (in release mode) the QuantLib .8.1 library.  Now I am trying to run the Python installation with: python setup.py install in the Swig/Python directory.  I have set QL_DIR = C:\QuantLib, although the actual built files are in c:\QuantLib\bin\Release

Python tries to load the boost libraries but is unable to find them and throws the error:

Cannot open include file: 'boost/config.hpp'

Shouldn't the setup.py script be using the pre-compiled binaries instead of rebuilding the libraries from source?

Should I set QL_DIR = C:\QuantLib\bin\Release, or am I doing something else incorrectly?

Reply | Threaded
Open this post in threaded view
|

Re: Building QuantLib for Python on Win XP

Luigi Ballabio
On Fri, 2007-09-14 at 11:01 -0700, newbie73 wrote:

> I have compiled (in release mode) the QuantLib .8.1 library.  Now I am trying
> to run the Python installation with: python setup.py install in the
> Swig/Python directory.  I have set QL_DIR = C:\QuantLib, although the actual
> built files are in c:\QuantLib\bin\Release
>
> Python tries to load the boost libraries but is unable to find them and
> throws the error:
>
> Cannot open include file: 'boost/config.hpp'
>
> Shouldn't the setup.py script be using the pre-compiled binaries instead of
> rebuilding the libraries from source?

QL_DIR is ok. setup.py uses the compiled binaries, but it also has to
compile the Python wrappers (i.e., quantlib_wrap.cpp in the directory
QuantLib-SWIG\Python\QuantLib.) Since they include Boost headers, you
need to tell the compiler where to find them. One way to do it is to
define the environment variable CL to be the location of your Boost
installation, e.g., C:\Boost\boost_1_34_1).

Luigi


--

Glendower: I can call spirits from the vasty deep.
Hotspur: Why, so can I, or so can any man;
But will they come when you do call for them?
-- King Henry the Fourth Part I, Act III, Scene I



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Building QuantLib for Python on Win XP

newbie73
My boost installation dir is:

c:\boost (this is how I set it in my Visual Studio settings as well).

When I try:

set CL="c:\boost"

I still get an error:

cl : unrecognized source file type 'c:\boost', object file assumed
cl: source file 'c:\boost' ignored

Then the same error regarding unfound boost files shows up.

Any more suggestions?

Luigi Ballabio wrote
On Fri, 2007-09-14 at 11:01 -0700, newbie73 wrote:
> I have compiled (in release mode) the QuantLib .8.1 library.  Now I am trying
> to run the Python installation with: python setup.py install in the
> Swig/Python directory.  I have set QL_DIR = C:\QuantLib, although the actual
> built files are in c:\QuantLib\bin\Release
>
> Python tries to load the boost libraries but is unable to find them and
> throws the error:
>
> Cannot open include file: 'boost/config.hpp'
>
> Shouldn't the setup.py script be using the pre-compiled binaries instead of
> rebuilding the libraries from source?

QL_DIR is ok. setup.py uses the compiled binaries, but it also has to
compile the Python wrappers (i.e., quantlib_wrap.cpp in the directory
QuantLib-SWIG\Python\QuantLib.) Since they include Boost headers, you
need to tell the compiler where to find them. One way to do it is to
define the environment variable CL to be the location of your Boost
installation, e.g., C:\Boost\boost_1_34_1).

Luigi


--

Glendower: I can call spirits from the vasty deep.
Hotspur: Why, so can I, or so can any man;
But will they come when you do call for them?
-- King Henry the Fourth Part I, Act III, Scene I



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Building QuantLib for Python on Win XP

Luigi Ballabio
On Mon, 2007-09-17 at 08:19 -0700, newbie73 wrote:
> When I try:
>
> set CL="c:\boost"

Sorry---that would be

set CL="/Ic:\boost"

Luigi


--

I am extraordinarily patient, provided I get my own way in the end.
-- Margaret Thatcher



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Building QuantLib for Python on Win XP

newbie73
In reply to this post by newbie73
Just figured it out ... needed to use a \\ to avoid having an escape character used in the path string.

Thanks!

- Luis
newbie73 wrote
I have compiled (in release mode) the QuantLib .8.1 library.  Now I am trying to run the Python installation with: python setup.py install in the Swig/Python directory.  I have set QL_DIR = C:\QuantLib, although the actual built files are in c:\QuantLib\bin\Release

Python tries to load the boost libraries but is unable to find them and throws the error:

Cannot open include file: 'boost/config.hpp'

Shouldn't the setup.py script be using the pre-compiled binaries instead of rebuilding the libraries from source?

Should I set QL_DIR = C:\QuantLib\bin\Release, or am I doing something else incorrectly?