problems building on linux

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

problems building on linux

Tito Ingargiola

Hi,

I regret to ask what I'm sure will prove to be a stupid question, but...

I'm having difficulty building quantlib-0.8.1 on a redhat system.
I've built and installed boost-1.34 which the quantlib build seems to
find without difficulties during compilation.  But when it tries to
link, it seems to be using the wrong names for the libraries.
Specifically, the build looks for '-lboost_unit_test_framework'
whereas the libraries are actually named things like
'libboost_unit_test_framework-gcc34-*' Looking at the boost install
docs, this seems to be correct -
http://boost.org/more/getting_started/unix_variants.html#library_naming

I've never used boost before, but I was able to complete the
installation and build/link and run samples without issues.

Curiously, I was able to build both boost and quantlib on nt (under
mingw) without any such issues!  

I'm sure I'm missing something blatant, but I'm just not seeing
it... any help or pointers will be very much appreciated.  Thanks in
advance and regards,

     Tito.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problems building on linux

Dirk Eddelbuettel

On 30 June 2007 at 13:03, Tito Ingargiola wrote:
| I'm having difficulty building quantlib-0.8.1 on a redhat system.
| I've built and installed boost-1.34 which the quantlib build seems to
| find without difficulties during compilation.  But when it tries to
| link, it seems to be using the wrong names for the libraries.
| Specifically, the build looks for '-lboost_unit_test_framework'
| whereas the libraries are actually named things like
| 'libboost_unit_test_framework-gcc34-*' Looking at the boost install
| docs, this seems to be correct -
| http://boost.org/more/getting_started/unix_variants.html#library_naming

Seems to work for me on Debian just using the configure defaults. E.g. to
pick one of the binaries linked against the Boost libraries:

edd@basebud:~> ldd /usr/bin/quantlib-test-suite
        linux-gate.so.1 =>  (0xffffe000)
        libboost_unit_test_framework-gcc41-mt-1_34.so.1.34.0 => /usr/lib/libboost_unit_test_framework-gcc41-mt-1_34.so.1.34.0 (0xb7f82000)
        libQuantLib-0.8.1.so => /usr/lib/libQuantLib-0.8.1.so (0xb78de000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb77f3000)
        libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb77cc000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb77c1000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb767e000)
        librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb7674000)
        libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb765d000)
        /lib/ld-linux.so.2 (0xb7fde000)

The library does indeed have one of those absurdly boost names, but QL
figured all this out by itself. From the log created when the package was
built, I see that the linking was done via

g++ -g0 -O2 -D_REENTRANT -fpermissive -o .libs/quantlib-benchmark quantlibbenchmark.o americanoption.o asianoptions.o barrieroption.o basketoption.o batesmodel.o digitaloption.o dividendoption.o europeanoption.o hestonmodel.o jumpdiffusion.o libormarketmodel.o libormarketmodelprocess.o lowdiscrepancysequences.o quantooption.o riskstats.o shortratemodels.o old_pricers.o utilities.o  -lboost_unit_test_framework-mt ./.libs/libUnitMain.a ../ql/.libs/libQuantLib.so

i.e. the library is being made available via  -lboost_unit_test_framework-mt

You may need to see if you can build some standalone boost tests. Try to
avoid the bjam stuff which is just too confusing :)

Hth, Dirk

--
Hell, there are no rules here - we're trying to accomplish something.
                                                  -- Thomas A. Edison

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problems building on linux

Luigi Ballabio
In reply to this post by Tito Ingargiola
On Sat, 2007-06-30 at 13:03 -0700, Tito Ingargiola wrote:
> I'm having difficulty building quantlib-0.8.1 on a redhat system.
> I've built and installed boost-1.34 which the quantlib build seems to
> find without difficulties during compilation.  But when it tries to
> link, it seems to be using the wrong names for the libraries.

Hi Tito,
        did ./configure find the Boost libraries? Try looking into config.log.
It should have looked for a few library names, including that with
gcc34-*.

Later,
        Luigi


--

feature, n:
A surprising property of a program. Occasionally documented.
To call a property a feature sometimes means the author did not
consider that case, and the program makes an unexpected, though
not necessarily wrong response. See BUG. "That's not a bug,
it's a feature!" A bug can be changed to a feature by
documenting it.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problems building on linux

Luigi Ballabio
In reply to this post by Tito Ingargiola
On Sat, 2007-06-30 at 13:03 -0700, Tito Ingargiola wrote:
> I'm having difficulty building quantlib-0.8.1 on a redhat system.
> I've built and installed boost-1.34 which the quantlib build seems to
> find without difficulties during compilation.  But when it tries to
> link, it seems to be using the wrong names for the libraries.

Hi again,
        try applying the attached patch to configure.

Later,
        Luigi



--

Skinner's Constant (or Flannagan's Finagling Factor):
That quantity which, when multiplied by, divided by, added to,
or subtracted from the answer you got, gives you the answer you
should have gotten.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

configure.patch (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: problems building on linux

Tito Ingargiola

Luigi & Dirk - thank you very much for your generous help.  The patch which you supplied, Luigi, has worked perfectly!  I was able to build+install cleanly and am able to build and run sample programs - now comes the hard part...

Thank you!

Luigi Ballabio <[hidden email]> wrote:
On Sat, 2007-06-30 at 13:03 -0700, Tito Ingargiola wrote:
> I'm having difficulty building quantlib-0.8.1 on a redhat system.
> I've built and installed boost-1.34 which the quantlib build seems to
> find without difficulties during compilation. But when it tries to
> link, it seems to be using the wrong names for the libraries.

Hi again,
try applying the attached patch to configure.

Later,
Luigi



--

Skinner's Constant (or Flannagan's Finagling Factor):
That quantity which, when multiplied by, divided by, added to,
or subtracted from the answer you got, gives you the answer you
should have gotten.

*** configure.orig 2007-07-02 16:20:48.000000000 +0200
--- configure 2007-07-02 16:22:35.000000000 +0200
***************
*** 19716,19722 ****

ql_original_LIBS=$LIBS
ql_original_CXXFLAGS=$CXXFLAGS
! CC_VERSION=`$CC -dumpversion | sed -e "s|\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)|\1\2|"`
for boost_lib in boost_unit_test_framework-$CC$CC_VERSION \
boost_unit_test_framework-$CC \
boost_unit_test_framework \
--- 19716,19722 ----

ql_original_LIBS=$LIBS
ql_original_CXXFLAGS=$CXXFLAGS
! CC_VERSION=`echo "__GNUC__ __GNUC_MINOR__" | $CC -E -x c - | tail -n 1 | $SED -e "s/ //"`
for boost_lib in boost_unit_test_framework-$CC$CC_VERSION \
boost_unit_test_framework-$CC \
boost_unit_test_framework \


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users