Cannot build quantlib-swig python library

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

Cannot build quantlib-swig python library

raphael-44
Hello,
I cannot build python.py. It cannot create quantlib_wrap_obj and thus gives the
following error message:

C:\QuantLib-SWIG-0.9.7\Python>python setup.py build
running build
running build_py
running build_ext
building 'QuantLib._QuantLib' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Python26
\include -IC:\Python26\PC -IC:\QuantLib-0.9.7 "-IC:\Program Files\Microsoft Visu
al Studio 9.0\VC\INCLUDE" "-IC:\Program Files\Microsoft SDKs\Windows\v6.0A\inclu
de" -I /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.6\Release\QuantLib/qu
antlib_wrap.obj /GR /FD /Zm250 /MD
cl : Ligne de commande error D8003 : nom de fichier de la source absent
error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
iled with exit status 2


Any idea?
Thanks a lot.

My config:

Windows XP Pro
Visual Studio 9.0(Express)
Quantlib 0.9.7 (built with VC++ 9)
Quantlib-SWIG 0.9.7
swigwin-1.3.39
python 2.6
boost 1.38 (built with VC++ 9)




------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build quantlib-swig python library

Bojan Nikolic

raphael <[hidden email]> writes:

> Hello,
> I cannot build python.py. It cannot create quantlib_wrap_obj and thus gives the
> following error message:
>
> C:\QuantLib-SWIG-0.9.7\Python>python setup.py build
> running build
> running build_py
> running build_ext
> building 'QuantLib._QuantLib' extension
> C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
> 3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Python26
> \include -IC:\Python26\PC -IC:\QuantLib-0.9.7 "-IC:\Program Files\Microsoft Visu
> al Studio 9.0\VC\INCLUDE" "-IC:\Program Files\Microsoft SDKs\Windows\v6.0A\inclu
> de" -I /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.6\Release\QuantLib/qu
> antlib_wrap.obj /GR /FD /Zm250 /MD
> cl : Ligne de commande error D8003 : nom de fichier de la source absent
> error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
> iled with exit status 2
>

I suspect that the empty include directory specification (-I by itself
without argument) is interfering with the file name to be compiled
argument (/TpQuantLib/quantlib_wrap.cpp).

You should adjust your compilation pre-processor search paths to make
sure this solitary -I doesn't appear and/or copy and paste the command
above removing the solitary -I.

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build quantlib-swig python library

Luigi Ballabio
In reply to this post by raphael-44
On Mon, 2009-05-04 at 16:58 +0000, raphael wrote:

> I cannot build python.py. It cannot create quantlib_wrap_obj and thus gives the
> following error message:
>
> C:\QuantLib-SWIG-0.9.7\Python>python setup.py build
> running build
> running build_py
> running build_ext
> building 'QuantLib._QuantLib' extension
> C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
> 3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Python26
> \include -IC:\Python26\PC -IC:\QuantLib-0.9.7 "-IC:\Program Files\Microsoft Visu
> al Studio 9.0\VC\INCLUDE" "-IC:\Program Files\Microsoft SDKs\Windows\v6.0A\inclu
> de" -I /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.6\Release\QuantLib/qu
> antlib_wrap.obj /GR /FD /Zm250 /MD
> cl : Ligne de commande error D8003 : nom de fichier de la source absent
> error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
> iled with exit status 2

Hi Raphael,
        Bojan's right---it's considering quantlib_wrap.cpp as an include path
and not as the source file to compile.  It's a problem in Python
distutils, and I've seen it happen on Windows when any of the include
directories contains spaces.  You can work around it by resetting your
INCLUDE variable; before running setup.py, run the command

set INCLUDE=

(with nothing after the = sign)

Luigi


--

Greenspun's Tenth Rule of Programming:
Any sufficiently complicated C or Fortran program contains an
ad-hoc, informally-specified bug-ridden slow implementation of
half of Common Lisp.



------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build quantlib-swig python library

raphael-44
In reply to this post by raphael-44
Luigi, I am not out of the woods yet.
I try to have a set-up where from Python, I can access both quantlib and data analysis software (R especially and some python modules like matplotlib).
But I face some deep issues about compatibility:
-the python  modules I need have not been yet ported to python2.6 (for windows)
-building a python module with a different version of VC (than the one having built Python) seems to be quite difficult (at least for me).
-I have only VC 9 and no proper VC 7 set-up.


After some efforts, I still cannot have all I need on the same Python version. The sole solution I see is to give up VC 9 and buy VC 7.

Any idea?
Thanks a lot.



 



----- Message d'origine -----
De : Luigi Ballabio [[hidden email]]
Envoyé : 08/05/2009 16:03 ZE2
À : Raphael SOBOTKA
Cc : [hidden email]
Objet : Re: [Quantlib-users] Cannot build quantlib-swig python library



On Mon, 2009-05-04 at 16:58 +0000, raphael wrote:

> I cannot build python.py. It cannot create quantlib_wrap_obj and thus gives the
> following error message:
>
> C:\QuantLib-SWIG-0.9.7\Python>python setup.py build
> running build
> running build_py
> running build_ext
> building 'QuantLib._QuantLib' extension
> C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W
> 3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Python26
> \include -IC:\Python26\PC -IC:\QuantLib-0.9.7 "-IC:\Program Files\Microsoft Visu
> al Studio 9.0\VC\INCLUDE" "-IC:\Program Files\Microsoft SDKs\Windows\v6.0A\inclu
> de" -I /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.6\Release\QuantLib/qu
> antlib_wrap.obj /GR /FD /Zm250 /MD
> cl : Ligne de commande error D8003 : nom de fichier de la source absent
> error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' fa
> iled with exit status 2

Hi Raphael,
        Bojan's right---it's considering quantlib_wrap.cpp as an include path
and not as the source file to compile.  It's a problem in Python
distutils, and I've seen it happen on Windows when any of the include
directories contains spaces.  You can work around it by resetting your
INCLUDE variable; before running setup.py, run the command

set INCLUDE=

(with nothing after the = sign)

Luigi


--

Greenspun's Tenth Rule of Programming:
Any sufficiently complicated C or Fortran program contains an
ad-hoc, informally-specified bug-ridden slow implementation of
half of Common Lisp.



Ensemble adoptons des gestes responsables : N'imprimez ce mail que
si necessaire.

Les informations contenues dans ce message et les pieces jointes
(ci-apres denomme le message) sont confidentielles et peuvent etre
couvertes par le secret professionnel. Si vous n'etes pas le
destinataire de ce message, il vous est interdit de le copier, de
le faire suivre, de le divulguer ou d'en utiliser tout ou partie.
Si vous avez recu ce message par erreur, nous vous remercions de le
supprimer de votre systeme, ainsi que toutes ses copies, et d'en
avertir immediatement l expediteur par message de retour. Il est
impossible de garantir que les communications par messagerie
electronique arrivent en temps utile, sont securisees ou denuees de
toute erreur, alteration, falsification ou virus. En consequence,
le Groupe decline toute responsabilite du fait des erreurs,
alterations, falsifications ou omissions qui pourraient en
resulter.

Consider the environment before printing this mail.

The information contained in this e-mail is confidential. It may
also be legally privileged. If you are not the addressee you may
not copy, forward, disclose or use any part of it. If you have
received this message by error, please delete it and all copies
from your system and notify the sender immediately by return
e-mail. E-mail communications cannot be guaranteed to be timely
secure, error or virus-free. The sender does not accept liability
for any errors or omissions which arise as a result.



------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Cannot build quantlib-swig python library

Luigi Ballabio
On Sat, 2009-05-09 at 11:45 +0200, [hidden email] wrote:
> -building a python module with a different version of VC (than the one
> having built Python) seems to be quite difficult (at least for me).
> -I have only VC 9 and no proper VC 7 set-up.
>
> After some efforts, I still cannot have all I need on the same Python
> version. The sole solution I see is to give up VC 9 and buy VC 7.
>
> Any idea?

It used to be possible to build modules with the gcc compiler included
into MinGW, but it's a long time since I tried it.  It was invoked with
something like

python setup.py build --compiler=mingw32

You can try and see whether it still works...

Luigi


--

There's no sense in being precise when you don't even know what you're
talking about.
-- John von Neumann



------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users