Failure to build quantlib-python on Mandrake 9.1

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

Failure to build quantlib-python on Mandrake 9.1

"Thomas Plümpe"
Hi,

I have installed QuantLib-0.3.3 and swig-1.3.11 on a Mandrake 9.1
system. Unfortunately I encountered an error trying to build the
QuantLib-Python-0.3.3 wrappers:

running wrap
Generating Python bindings for QuantLib...
./QuantLib/SWIG/common.i:21. Unable to find 'stl.i'

I assume under these circumstance (i.e. without the wrappers) building
the project is out of question, but tried anyway with this g++
(gcc-3.2.2) failure:

running build
running build_py
creating build
creating build/lib.linux-i686-2.2
creating build/lib.linux-i686-2.2/QuantLib
copying QuantLib/__init__.py -> build/lib.linux-i686-2.2/QuantLib
not copying QuantLib/__init__.py (output up-to-date)
copying QuantLib/QuantLib.py -> build/lib.linux-i686-2.2/QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build/temp.linux-i686-2.2
g++ -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -fPIC -I/usr/local/include -I/usr/local/include -I/usr/include/python2.2 -c QuantLib/quantlib_wrap.cpp -o build/temp.linux-i686-2.2/quantlib_wrap.o
QuantLib/quantlib_wrap.cpp:945:6: #error using an old version of QuantLib, please update
QuantLib/quantlib_wrap.cpp: In function `std::string Array___str__(QuantLib::Array*)':
QuantLib/quantlib_wrap.cpp:1096: no matching function for call to `QuantLib::ArrayFormatter::toString(double*, double*)'
/usr/local/include/ql/dataformatters.hpp:53: candidates are: static std::string QuantLib::ArrayFormatter::toString(const QuantLib::Array&, int = 6, int = 0, unsigned int = std::numeric_limits<int>::max()())
QuantLib/quantlib_wrap.cpp: In function `int Period___cmp__(QuantLib::Period*, const QuantLib::Period&)':
QuantLib/quantlib_wrap.cpp:1646: no match for `QuantLib::Period& < const QuantLib::Period&' operator
[...]
QuantLib/quantlib_wrap.cpp:52648: parse error before `)' token
error: command 'g++' failed with exit status 1

Any ideas what I could do in order to get it compiled?

Thanks in advance,
Thomas




Reply | Threaded
Open this post in threaded view
|

Re: Failure to build quantlib-python on Mandrake 9.1

Dirk Eddelbuettel
On Wed, Sep 17, 2003 at 01:30:35AM +0200, Thomas Pl?mpe wrote:

> Hi,
>
> I have installed QuantLib-0.3.3 and swig-1.3.11 on a Mandrake 9.1
> system. Unfortunately I encountered an error trying to build the
> QuantLib-Python-0.3.3 wrappers:
>
> running wrap
> Generating Python bindings for QuantLib...
> ./QuantLib/SWIG/common.i:21. Unable to find 'stl.i'
>
> I assume under these circumstance (i.e. without the wrappers) building
> the project is out of question, but tried anyway with this g++
> (gcc-3.2.2) failure:
>
> running build
> running build_py
> creating build
> creating build/lib.linux-i686-2.2
> creating build/lib.linux-i686-2.2/QuantLib
> copying QuantLib/__init__.py -> build/lib.linux-i686-2.2/QuantLib
> not copying QuantLib/__init__.py (output up-to-date)
> copying QuantLib/QuantLib.py -> build/lib.linux-i686-2.2/QuantLib
> running build_ext
> building 'QuantLib._QuantLib' extension
> creating build/temp.linux-i686-2.2
> g++ -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -fPIC -I/usr/local/include -I/usr/local/include -I/usr/include/python2.2 -c QuantLib/quantlib_wrap.cpp -o build/temp.linux-i686-2.2/quantlib_wrap.o
> QuantLib/quantlib_wrap.cpp:945:6: #error using an old version of QuantLib, please update

Do you have an older version installed?

> QuantLib/quantlib_wrap.cpp: In function `std::string Array___str__(QuantLib::Array*)':
> QuantLib/quantlib_wrap.cpp:1096: no matching function for call to `QuantLib::ArrayFormatter::toString(double*, double*)'
> /usr/local/include/ql/dataformatters.hpp:53: candidates are: static std::string QuantLib::ArrayFormatter::toString(const QuantLib::Array&, int = 6, int = 0, unsigned int = std::numeric_limits<int>::max()())
> QuantLib/quantlib_wrap.cpp: In function `int Period___cmp__(QuantLib::Period*, const QuantLib::Period&)':
> QuantLib/quantlib_wrap.cpp:1646: no match for `QuantLib::Period& < const QuantLib::Period&' operator
> [...]
> QuantLib/quantlib_wrap.cpp:52648: parse error before `)' token
> error: command 'g++' failed with exit status 1
>
> Any ideas what I could do in order to get it compiled?

Works rather flawlessly for me with the Debian builds.

I just do

  CC="$(cxxcompiler)" \
  CXX="$(cxxcompiler)" \
  CFLAGS="$(compilerflags)" \
  CXXFLAGS="$(compilerflags)" \
  $(PYTHON) setup.py build

and

  $(PYTHON) setup.py install --prefix=$(debtmp)/usr
 
I used to use 2.2, and have now switched to 2.3.

Dirk

--
Those are my principles, and if you don't like them... well, I have others.
                                                -- Groucho Marx


Reply | Threaded
Open this post in threaded view
|

Re: Failure to build quantlib-python on Mandrake 9.1

Luigi Ballabio-2
In reply to this post by "Thomas Plümpe"
At 01:30 AM 9/17/03, Thomas Plümpe wrote:
>I have installed QuantLib-0.3.3 and swig-1.3.11 on a Mandrake 9.1
>system. Unfortunately I encountered an error trying to build the
>QuantLib-Python-0.3.3 wrappers:
>
>running wrap
>Generating Python bindings for QuantLib...
>./QuantLib/SWIG/common.i:21. Unable to find 'stl.i'

Thomas,
         SWIG 1.3.11 is too old---I don't remember which version you need
at least, but it's stated in the readme file for QuantLib-Python. However,
you shouldn't need to generate the wrappers yourself. They should be in the
released tarball already, so "python setup.py build" should just work.

Hope this helps,
                 Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Failure to build quantlib-python on Mandrake 9.1

"Thomas Plümpe"
In reply to this post by Dirk Eddelbuettel
Thanks Luigi, danke Dirk,

> > I have installed QuantLib-0.3.3 and swig-1.3.11
The README indeed says 1.3.18 at least, I wonder why I didn't see this
yesterday when I read and reread (and reread...) it. The newest version
packaged for Mandrake apparently is 1.3.11. But if I understand you
correctly I won't need it anyway.

> > g++ -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -fPIC -I/usr/local/include -I/usr/local/include -I/usr/include/python2.2 -c QuantLib/quantlib_wrap.cpp -o build/temp.linux-i686-2.2/quantlib_wrap.o
> > QuantLib/quantlib_wrap.cpp:945:6: #error using an old version of QuantLib, please update
>
> Do you have an older version installed?
$ rpm -qa | grep -i quantlib
QuantLib-0.3.3-1

I have compiled 0.3.1 quite some time ago and just found several
libQuantLib.* files in /usr/local/lib. I removed them and tried the
build again, but I am still getting the same output warning of an old
version and then after a huge number of parse errors:
> > error: command 'g++' failed with exit status 1

> Works rather flawlessly for me with the Debian builds.
>
> I just do
>
>   CC="$(cxxcompiler)" \
>   CXX="$(cxxcompiler)" \
>   CFLAGS="$(compilerflags)" \
>   CXXFLAGS="$(compilerflags)" \
>   $(PYTHON) setup.py build
>
> and
>
>   $(PYTHON) setup.py install --prefix=$(debtmp)/usr
>  
> I used to use 2.2, and have now switched to 2.3.
I'm using 2.2.1, not setting the CC, CXX, etc. variables (I wouldn't
know what values to set them to). Do you suspect that to cause the
error?

Thanks again,
Thomas




Reply | Threaded
Open this post in threaded view
|

Re: Failure to build quantlib-python on Mandrake 9.1

Luigi Ballabio-2
At 11:44 AM 9/17/03, Thomas Plümpe wrote:

> > > g++ -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586
> -mcpu=pentiumpro -fPIC -I/usr/local/include -I/usr/local/include
> -I/usr/include/python2.2 -c QuantLib/quantlib_wrap.cpp -o
> build/temp.linux-i686-2.2/quantlib_wrap.o
> > > QuantLib/quantlib_wrap.cpp:945:6: #error using an old version of
> QuantLib, please update
> >
> > Do you have an older version installed?
>$ rpm -qa | grep -i quantlib
>QuantLib-0.3.3-1

I don't know how the rpms are packaged---did the above also install the
include files? Wait, I'll check on the site... Nope. You should have
installed QuantLib-devel-0.3.3-1 as well.


>I have compiled 0.3.1 quite some time ago and just found several
>libQuantLib.* files in /usr/local/lib. I removed them and tried the
>build again, but I am still getting the same output warning of an old
>version and then after a huge number of parse errors:
> > > error: command 'g++' failed with exit status 1

Hmm, removing the libs might not be enough. You might have old header files
lying around in /usr/local/include or somewhere. Locate qldefines.hpp and
check the definition of QL_VERSION inside it. If it's earlier than 0.3.3,
remove the ql/ directory from your include path and install the
QuantLib-devel rpm instead.

Later,
         Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Failure to build quantlib-python on Mandrake 9.1

Liguo Song
Hi, Guys,

> I don't know how the rpms are packaged---did the above also install the
> include files? Wait, I'll check on the site... Nope. You should have
> installed QuantLib-devel-0.3.3-1 as well.
The QuantLib only includes the essential libraries. It is intend to be
the minimal package to support any future application that build on
QuantLib. QuantLib-devel is the package that you need if you want to
to program or build any package needs QuantLib.

There should also be some other packages coming, such as QuantLib-doc,
QuantLib-python and etc. I am still working my way through this right
now.

> Hmm, removing the libs might not be enough. You might have old header files
> lying around in /usr/local/include or somewhere. Locate qldefines.hpp and
> check the definition of QL_VERSION inside it. If it's earlier than 0.3.3,
> remove the ql/ directory from your include path and install the
> QuantLib-devel rpm instead.
It is a good idea to remove all the older version of QuantLib. But it
could be very time consuming if they are simply installed by tar
balls, and the building directory is already gone.

But, the headers in /usr/local/include shouldn't be too much trouble
as the rpms will install the new headers into /usr/include, which
should be searched before /usr/local/include in standard installation.
I am not 100% sure on this one. So, don't bet your job on it. :)

Have a nice day!


Liguo (Leo)



Reply | Threaded
Open this post in threaded view
|

Re: Failure to build quantlib-python on Mandrake 9.1

"Thomas Plümpe"
In reply to this post by Luigi Ballabio-2
> >$ rpm -qa | grep -i quantlib
> >QuantLib-0.3.3-1
>
> I don't know how the rpms are packaged---did the above also install the
> include files? Wait, I'll check on the site... Nope. You should have
> installed QuantLib-devel-0.3.3-1 as well.
Right, that's been one of the problems.

> Hmm, removing the libs might not be enough. You might have old header files
> lying around in /usr/local/include or somewhere. Locate qldefines.hpp and
> check the definition of QL_VERSION inside it. If it's earlier than 0.3.3,
> remove the ql/ directory from your include path and install the
> QuantLib-devel rpm instead.
And that was the second problem. After removing /usr/local/include/ql
(which obviously had the 0.3.1 headers) the compilation went fine.

So, Liguo, it seems /usr/local/include is searched first, but that's
what I would expect if I were to download cvs-current and compile that.

Thanks a lot, guys, on to using it then...

Thomas