2011-06-05 13:52:43 +00:00
|
|
|
|
|
|
|
Dynamic library build
|
|
|
|
=====================
|
|
|
|
|
2008-05-12 13:47:15 +00:00
|
|
|
If you have a libgmp.so installed on your system already
|
|
|
|
(check in /usr/lib), you can build a dynamically linked libjbigi.so as follows:
|
|
|
|
cd jbigi
|
|
|
|
build.sh dynamic
|
2011-06-05 13:52:43 +00:00
|
|
|
You do, of course, need the gmp headers installed.
|
|
|
|
On ubuntu, check for libgmp3 and libgmp3-dev packages.
|
|
|
|
This is much easier and faster than building GMP from source.
|
2008-05-12 13:47:15 +00:00
|
|
|
|
2004-08-21 07:56:53 +00:00
|
|
|
|
2011-06-05 13:52:43 +00:00
|
|
|
Static library build
|
|
|
|
=====================
|
|
|
|
|
|
|
|
Otherwise, the build script build.sh will download the the GMP source,
|
|
|
|
unpack and build it. The GMP version and download location are configured
|
|
|
|
in jbigi/build.sh, please review it to ensure you download
|
|
|
|
and build the desired version.
|
2008-02-27 15:18:32 +00:00
|
|
|
|
2004-08-21 07:56:53 +00:00
|
|
|
To build the native jbigi and jcpuid libraries for the current host CPU,
|
|
|
|
simply run sh build.sh and the results will be packaged up into jbigi.jar
|
2011-06-05 13:52:43 +00:00
|
|
|
and the libjbigi.so library.
|
2004-08-21 07:56:53 +00:00
|
|
|
|
|
|
|
To build the native jbigi libraries for all supported CPUs (on the current OS),
|
|
|
|
go into jbigi/ and run build-all.sh (the results will be under jbigi/lib/)
|
2008-02-27 15:18:32 +00:00
|
|
|
|
2011-06-05 13:52:43 +00:00
|
|
|
|
|
|
|
Installation and testing
|
|
|
|
========================
|
|
|
|
|
|
|
|
To test, copy jbigi/lib/libjbigi.so
|
|
|
|
and jcpuid/lib/freenet/support/CPUInformation/libjcpuid-*.so
|
|
|
|
to your i2p installation directory ($I2P). You may also copy jbigi.jar to the $I2P/lib/ directory;
|
|
|
|
it will be used only if the router fails to load the native library
|
|
|
|
from the I2P installation directory.
|
|
|
|
|
2008-05-12 13:47:15 +00:00
|
|
|
The build.sh script runs two speed tests, one with your existing
|
|
|
|
I2P installation and one with the new libjbigi.
|
|
|
|
|
|
|
|
Alternatively, after copying the files to the i2p/ directory,
|
2008-02-27 15:18:32 +00:00
|
|
|
to run a speed test comparing the native library to the java library,
|
2008-05-12 13:47:15 +00:00
|
|
|
run the shell script below. Adjust the I2P= line as necessary.
|
2008-02-27 15:18:32 +00:00
|
|
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
#!/bin/sh
|
|
|
|
export I2P=~/i2p
|
|
|
|
java -cp $I2P/lib/i2p.jar:$I2P/lib/jbigi.jar net.i2p.util.NativeBigInteger
|