Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 1.8 KB

Please follow following instructions to build nd4j on raspberry PI:

    1. {In build machine] compile libnd4j as follows:
        - $git clone
        - For cross compilation use this link:
        - make sure to use the 4.9 version of gcc (raspberrypi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)
    3.[In build machine]  build using "$./ -o linux-armhf"
    4. [In build machine] Install maven 3.3.9 (3.0.X does not work)
    5. [In build machine] followed instructions mentioned in :
            a. $export LIBND4J_HOME=<pathTond4JNI>

            b. Build and install nd4j to maven locally (using the forked nd4j specifically changed for raspberry pi)
                $git clone
                $cd nd4j
            c. Edit  nd4j-backends\nd4j-backend-impls\nd4j-native\src\main\resources\org\bytedeco\javacpp\properties to update the paths of native toolchains

            d. $mvn clean  install -Djavacpp.platform=linux-armhf  -DskipTests  -Dmaven.javadoc.skip=true  -pl '!:nd4j-cuda-8.0,!:nd4j-cuda-8.0-platform,!:nd4j-tests'

    7. [In build machine ] build the source of dependant appllication with above (step 7) dependencies.
    8. [In raspbian ]copy the generated jar of dependant application to raspberry
    9. [In raspbian ]download the libraries inside the folders of build machine nd4j-backends/nd4j-backend-impls/nd4j-native/target/classes/org/nd4j/nativeblas/linux-armhf/  to a permanent folder containing libs (if possible to a system folder)
    10.[In raspbian ] export the variable LD_LIBRARY_PATH to the path set in step 10: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<the path to libraryy>
    11. [In raspbian ]java -jar myjar.jar