source: core/c/README @ ecb28eb

Last change on this file since ecb28eb was d28f4bd2, checked in by zzz <zzz@…>, 9 years ago
  • JBigI:
    • Replace old non-PIC 62-bit linux libs (GMP 4.1.4 built in 2005) with PIC libs built with GMP 5.0.2. License is LGPLv3. Built by sponge with GCC 4.4.4, downloaded from http://sponge.i2p/files/jbigi/gmp-5.0.2/ For 64-bit processors, both performance testing and the GMP changelog led us to use 5.0.2 for both the 32- and 64-bit versions, even though the files are twice as big. See http://zzz.i2p/topics/306 for discussion and test results. libjbigi-linux-athlon64.so was a 64 bit file; by the new naming standard supported by NativeBigInteger?, it is now a 32-bit file and the 64-bit one is libjbigi-linux-athlon64_64.so. All new 64-bit libs will have _64 appended.
    • Update build docs
  • Property mode set to 100644
File size: 1.7 KB
Line 
1
2Dynamic library build
3=====================
4
5If you have a libgmp.so installed on your system already
6(check in /usr/lib), you can build a dynamically linked libjbigi.so as follows:
7        cd jbigi
8        build.sh dynamic
9You do, of course, need the gmp headers installed.
10On ubuntu, check for libgmp3 and libgmp3-dev packages.
11This is much easier and faster than building GMP from source.
12       
13
14Static library build
15=====================
16
17Otherwise, the build script build.sh will download the the GMP source,
18unpack and build it. The GMP version and download location are configured
19in jbigi/build.sh, please review it to ensure you download
20and build the desired version.
21
22To build the native jbigi and jcpuid libraries for the current host CPU,
23simply run sh build.sh and the results will be packaged up into jbigi.jar
24and the libjbigi.so library.
25
26To build the native jbigi libraries for all supported CPUs (on the current OS),
27go into jbigi/ and run build-all.sh (the results will be under jbigi/lib/)
28
29
30Installation and testing
31========================
32
33To test, copy jbigi/lib/libjbigi.so
34and jcpuid/lib/freenet/support/CPUInformation/libjcpuid-*.so
35to your i2p installation directory ($I2P). You may also copy jbigi.jar to the $I2P/lib/ directory;
36it will be used only if the router fails to load the native library
37from the I2P installation directory.
38
39The build.sh script runs two speed tests, one with your existing
40I2P installation and one with the new libjbigi.
41
42Alternatively, after copying the files to the i2p/ directory,
43to run a speed test comparing the native library to the java library,
44run the shell script below. Adjust the I2P= line as necessary.
45
46-----------------
47
48#!/bin/sh
49export I2P=~/i2p
50java -cp $I2P/lib/i2p.jar:$I2P/lib/jbigi.jar net.i2p.util.NativeBigInteger
Note: See TracBrowser for help on using the repository browser.