1 | If you have a libgmp.so installed on your system already |
---|
2 | (check in /usr/lib), you can build a dynamically linked libjbigi.so as follows: |
---|
3 | cd jbigi |
---|
4 | build.sh dynamic |
---|
5 | The built library is jbigi/lib/libjbigi.so . |
---|
6 | |
---|
7 | Otherwise, prior to building the jbigi library, you will need to fetch the GMP source |
---|
8 | from http://www.swox.com/gmp/, saving it to jbigi/gmp-4.2.2.tar.bz2 (it will |
---|
9 | be unpacked and built as necessary). |
---|
10 | |
---|
11 | Version 4.2.2 has not been extensively tested with I2P. If you would like |
---|
12 | to use a well-tested version, get gmp-4.1.4.tar.bz2, and edit jbigi/build.sh |
---|
13 | to change the version number. |
---|
14 | |
---|
15 | To build the native jbigi and jcpuid libraries for the current host CPU, |
---|
16 | simply run sh build.sh and the results will be packaged up into jbigi.jar |
---|
17 | and the libjbigi.so library. To test, copy jbigi/lib/libjbigi.so |
---|
18 | and jcpuid/lib/freenet/support/CPUInformation/libjcpuid-*.so |
---|
19 | to your i2p/ directory. You can also copy jbigi.jar to the i2p/lib/ directory; |
---|
20 | it will be used only if the router fails to load the native library. |
---|
21 | |
---|
22 | To build the native jbigi libraries for all supported CPUs (on the current OS), |
---|
23 | go into jbigi/ and run build-all.sh (the results will be under jbigi/lib/) |
---|
24 | |
---|
25 | The build.sh script runs two speed tests, one with your existing |
---|
26 | I2P installation and one with the new libjbigi. |
---|
27 | |
---|
28 | Alternatively, after copying the files to the i2p/ directory, |
---|
29 | to run a speed test comparing the native library to the java library, |
---|
30 | run the shell script below. Adjust the I2P= line as necessary. |
---|
31 | |
---|
32 | ----------------- |
---|
33 | |
---|
34 | #!/bin/sh |
---|
35 | export I2P=~/i2p |
---|
36 | java -cp $I2P/lib/i2p.jar:$I2P/lib/jbigi.jar net.i2p.util.NativeBigInteger |
---|