Posted by
Richard Gomes on
Sep 02, 2007; 8:42pm
URL: http://quantlib.414.s1.nabble.com/Help-newbie-question-autogen-tp9732p9738.html
Richard Gomes wrote:
> Dirk Eddelbuettel wrote:
>
>>
>> On 2 September 2007 at 15:40, Richard Gomes wrote:
>> | You are right... libtool was not installed. :(
>>
>> You can use Debian's meta-info for that, i.e.
>>
>> $ apt-get build-dep quantlib
>>
>> gets you all packages needed to build the main quantlib packages.
>> And
>>
>> $ apt-get source quantlib
>>
>> will get the source for you --- if you point to Debian unstable you'd
>> always get the latest.
>>
>> Hth, Dirk
>>
>
> Dirk, Thank you very much.
>
> In fact, I'm currently using Kubuntu 7.04 and Debian's unstable packages
> do not work well on it. Yesterday I had to use killall to kill thousands
> of apt-cache processes slowing down my box.
>
> I'm planning to switch to Debian4 in the future, but I'll need to have
> enough spare time and courage to do it.
>
> Kind Regards
>
Hi Chaps,
I managed to get everything running.
This is a quick procedure, specially intended to AMD64 addicted ones.
-----------------------------------------------------------------------
echo Setting JAVA_HOME to your JDK flavored for AMD64.
# To be on the safe side, I tested against Java5.
export JAVA_HOME=/opt/JavaIDE/jdk1.5.0_12-amd64
cd $HOME
mkdir svn_working-copy
cd svn_working-copy
echo Download QuantLib
svn checkout
https://quantlib.svn.sourceforge.net/svnroot/quantlib/trunk/QuantLibecho Download QuantLib-SWIG
svn checkout
https://quantlib.svn.sourceforge.net/svnroot/quantlib/trunk/QuantLib-SWIGecho Install required packages
sudo apt-get install binutils gcc make autoconf automake libtool swig
libboost-dev
cd $HOME/svn_working-copy
cd QuantLib
echo Configure QuantLib
sh autogen.sh
./configure
make
sudo make install
cd $HOME/svn_working-copy
cd QuantLib-SWIG
echo Configure QuantLib-SWIG for Java environment
sh autogen.sh
echo "================================"
echo "Setting CXXFLAGS=-fPIC for AMD64"
echo "================================"
export CXXFLAGS=-fPIC
echo
./configure \
--with-jdk-include=${JAVA_HOME}/include \
--with-jdk-system-include=${JAVA_HOME}/include/linux
make -C Java
sudo make -C Java install
echo Verify installed files
ls -ald /usr/local/lib/*QuantLib*
echo Verify file contents
file /usr/local/lib/*QuantLib*
You should see something similar to...
/usr/local/lib/libQuantLib-0.8.1.so: ELF 64-bit LSB shared object, x86-64,
version 1 (SYSV), not stripped
/usr/local/lib/libQuantLibJNI.so: ELF 64-bit LSB shared object, x86-64,
version 1 (SYSV), not stripped
/usr/local/lib/libQuantLib.so: symbolic link to `libQuantLib-0.8.1.so'
/usr/local/lib/libQuantLib-0.8.1.a: current ar archive
/usr/local/lib/libQuantLib.a: symbolic link to `libQuantLib-0.8.1.a'
/usr/local/lib/QuantLib.jar: Zip archive data, at least v2.0 to
extract
To be honest, I've build from released packages and not from the trunk SVN.
If you follow this procedure, probably some file names can be slightly
different.
Now, include /usr/local/lib/QuantLib.jar in the build path of your Java
projects.
Use this test program:
package org.quantlib.examples;
import org.quantlib.QuantLib;
import org.quantlib.Weekday;
public class Hello {
static {
try {
System.loadLibrary("QuantLibJNI");
} catch (RuntimeException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
QuantLib ql = new QuantLib();
double nd = QuantLib.nullDouble();
System.out.println("ql nullDouble is "+nd);
System.out.println("and sunday is "+Weekday.Sunday.toString());
}
}
Go to the command line and execute...
$ export LD_LIBRARY_PATH=/usr/local/lib
$ java -cp .:/usr/local/lib/QuantLib.jar org.quantlib.examples.Hello
-----------------------------------------------------------------------
Good Luck! :)
--
Richard Gomes
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>
http://get.splunk.com/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev