Debian package issues

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

Debian package issues

Matthew Nobes
Hello,

I'm new to quantlib (and quantitative finance in general).  I'm trying
to get an example program to compile using quantlib.  I have installed
the debian (ubuntu actually) quantlib packages, along with all the
libboost packages I could find.

I ran quantlib-test-suite from the command line, it ground away for a
while and informed me that all the tests had been passed.

I then cut and pasted americanoptions.cpp from the examples section of
the quantlib website and tried to compile it, using the flags
suggested by quantlib-config --libs --cflags

gcc -L/usr/lib -lQuantLib-0.3.8 -I/usr/include amop.cpp

I've tried this with gcc 3.3 and 3.4 neither work.  I get a long
string of errors, which I've pasted in below.  Am I missing something?
 Typically when you install a library in Debian it handles most of the
setup atuomatically.  The test suite works, so I know a program that
uses quantlib can be compiled and run.

Grateful for any help
                                Matt

amop.cpp: In function `int main(int, char**)':
amop.cpp:39: error: `io' undeclared (first use this function)
amop.cpp:39: error: (Each undeclared identifier is reported only once
for each
   function it appears in.)
amop.cpp:39: error: parse error before `::' token
amop.cpp:41: error: parse error before `::' token
amop.cpp:43: error: parse error before `::' token
amop.cpp:57: error: `setw' undeclared in namespace `std'
amop.cpp:58: error: `setw' undeclared in namespace `std'
amop.cpp:59: error: `setw' undeclared in namespace `std'
amop.cpp:60: error: `setw' undeclared in namespace `std'
amop.cpp:131: error: `setw' undeclared in namespace `std'
amop.cpp:133: error: `setw' undeclared in namespace `std'
amop.cpp:134: error: `setw' undeclared in namespace `std'
amop.cpp:135: error: `setw' undeclared in namespace `std'
amop.cpp:143: error: `setw' undeclared in namespace `std'
amop.cpp:145: error: `setw' undeclared in namespace `std'
amop.cpp:146: error: `setw' undeclared in namespace `std'
amop.cpp:147: error: `setw' undeclared in namespace `std'
amop.cpp:155: error: parse error before `(' token
amop.cpp:159: error: `setw' undeclared in namespace `std'
amop.cpp:161: error: `setw' undeclared in namespace `std'
amop.cpp:162: error: `setw' undeclared in namespace `std'
amop.cpp:164: error: `setw' undeclared in namespace `std'
amop.cpp:174: error: `setw' undeclared in namespace `std'
amop.cpp:176: error: `setw' undeclared in namespace `std'
amop.cpp:177: error: `setw' undeclared in namespace `std'
amop.cpp:179: error: `setw' undeclared in namespace `std'
amop.cpp:189: error: `setw' undeclared in namespace `std'
amop.cpp:191: error: `setw' undeclared in namespace `std'
amop.cpp:192: error: `setw' undeclared in namespace `std'
amop.cpp:194: error: `setw' undeclared in namespace `std'
amop.cpp:204: error: `setw' undeclared in namespace `std'
amop.cpp:206: error: `setw' undeclared in namespace `std'
amop.cpp:207: error: `setw' undeclared in namespace `std'
amop.cpp:209: error: `setw' undeclared in namespace `std'
amop.cpp:219: error: `setw' undeclared in namespace `std'
amop.cpp:221: error: `setw' undeclared in namespace `std'
amop.cpp:222: error: `setw' undeclared in namespace `std'
amop.cpp:224: error: `setw' undeclared in namespace `std'
amop.cpp:234: error: `setw' undeclared in namespace `std'
amop.cpp:236: error: `setw' undeclared in namespace `std'
amop.cpp:237: error: `setw' undeclared in namespace `std'
amop.cpp:239: error: `setw' undeclared in namespace `std'
amop.cpp:249: error: `setw' undeclared in namespace `std'
amop.cpp:251: error: `setw' undeclared in namespace `std'
amop.cpp:252: error: `setw' undeclared in namespace `std'
amop.cpp:254: error: `setw' undeclared in namespace `std'
amop.cpp:264: error: `setw' undeclared in namespace `std'
amop.cpp:266: error: `setw' undeclared in namespace `std'
amop.cpp:267: error: `setw' undeclared in namespace `std'
amop.cpp:269: error: `setw' undeclared in namespace `std'
amop.cpp:279: error: `setw' undeclared in namespace `std'
amop.cpp:281: error: `setw' undeclared in namespace `std'
amop.cpp:282: error: `setw' undeclared in namespace `std'
amop.cpp:284: error: `setw' undeclared in namespace `std'


Reply | Threaded
Open this post in threaded view
|

Re: Debian package issues

Luigi Ballabio
On 09/02/2005 05:06:11 PM, Matthew Nobes wrote:
> I then cut and pasted americanoptions.cpp from the examples section  
> of the quantlib website and tried to compile it, using the flags
> suggested by quantlib-config --libs --cflags
>
> gcc -L/usr/lib -lQuantLib-0.3.8 -I/usr/include amop.cpp

Matthew,
        according to what quantlib-config returns, you have QuantLib  
0.3.8 installed. The example on the website refers to the latest  
version, namely, 0.3.10. Ubuntu is probably a few months late. You can  
a) download the 0.3.8 sources from the QuantLib site (or check whether  
Ubuntu has a source package available) and use the examples you'll find  
in the distribution, or b) download the 0.3.10 sources and compile them  
yourself.

Later,
        Luigi

----------------------------------------

There is no likelihood man can ever tap the power of the atom.
-- Robert Millikan, Nobel Prize in Physics, 1923



Reply | Threaded
Open this post in threaded view
|

Re: Debian package issues

Dirk Eddelbuettel
In reply to this post by Matthew Nobes
Matthew Nobes <drnobes <at> gmail.com> writes:
> I then cut and pasted americanoptions.cpp from the examples section of
> the quantlib website and tried to compile it, using the flags
> suggested by quantlib-config --libs --cflags
>
> gcc -L/usr/lib -lQuantLib-0.3.8 -I/usr/include amop.cpp
>
> I've tried this with gcc 3.3 and 3.4 neither work.  I get a long
> string of errors, which I've pasted in below.  Am I missing something?

The C++ compiler is g++, not gcc. Try
$ g++ -L/usr/lib -lQuantLib-0.3.8 -I/usr/include amop.cpp

You also need to make sure you match the compiler release with the one the
package was built with, i.e. if Ubuntu rebuilt with gcc/g++ 3.3, then there is
no point in trying 3.4.

Lastly, one of the nicer things in Debian (and hence Ubuntu) is the (if you
want, almost fully automatic) way of rebuilding packages locally. That way you
could fetch the current 0.3.10 packages from Debian's unstable (and maybe even
Ubuntu's breezy) and rebuild them on your Ubuntu hoary box.

Hth, Dirk