source: core/c/README @ d8a3cb0

Last change on this file since d8a3cb0 was 5be7ea1, checked in by zzz <zzz@…>, 12 years ago
  • libjbigi:
    • Add documentation on dynamic build option
    • Add two speed tests to the build script
    • Clean up the build script, make it easier to build dynamic
  • Property mode set to 100644
File size: 1.6 KB
Line 
1If 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
5The built library is jbigi/lib/libjbigi.so .
6       
7Otherwise, prior to building the jbigi library, you will need to fetch the GMP source
8from http://www.swox.com/gmp/, saving it to jbigi/gmp-4.2.2.tar.bz2 (it will
9be unpacked and built as necessary).
10
11Version 4.2.2 has not been extensively tested with I2P. If you would like
12to use a well-tested version, get gmp-4.1.4.tar.bz2, and edit jbigi/build.sh
13to change the version number.
14
15To build the native jbigi and jcpuid libraries for the current host CPU,
16simply run sh build.sh and the results will be packaged up into jbigi.jar
17and the libjbigi.so library. To test, copy jbigi/lib/libjbigi.so
18and jcpuid/lib/freenet/support/CPUInformation/libjcpuid-*.so
19to your i2p/ directory. You can also copy jbigi.jar to the i2p/lib/ directory;
20it will be used only if the router fails to load the native library.
21
22To build the native jbigi libraries for all supported CPUs (on the current OS),
23go into jbigi/ and run build-all.sh (the results will be under jbigi/lib/)
24
25The build.sh script runs two speed tests, one with your existing
26I2P installation and one with the new libjbigi.
27
28Alternatively, after copying the files to the i2p/ directory,
29to run a speed test comparing the native library to the java library,
30run the shell script below. Adjust the I2P= line as necessary.
31
32-----------------
33
34#!/bin/sh
35export I2P=~/i2p
36java -cp $I2P/lib/i2p.jar:$I2P/lib/jbigi.jar net.i2p.util.NativeBigInteger
Note: See TracBrowser for help on using the repository browser.