ND4J: Fix OpenBLAS loading for nd4j-native (#64)

* ND4J: Fix OpenBLAS loading for nd4j-native and remove bundling of OpenMP

Signed-off-by: Samuel Audet <samuel.audet@gmail.com>

* Bundle back libgomp.so.1 for Linux

Signed-off-by: Samuel Audet <samuel.audet@gmail.com>

* Readd preload directories for ARM

Signed-off-by: Samuel Audet <samuel.audet@gmail.com>

* Add back preloads for GCC on Windows

Signed-off-by: Samuel Audet <samuel.audet@gmail.com>

* Add explicit preloadpaths for ARM and POWER to bundle correct library

Signed-off-by: Samuel Audet <samuel.audet@gmail.com>
master
Samuel Audet 2019-11-21 21:54:41 +09:00 committed by raver119
parent 064a56ccf1
commit ff73e6da3f
2 changed files with 11 additions and 11 deletions

View File

@ -106,10 +106,11 @@ import org.bytedeco.javacpp.tools.InfoMapper;
},
compiler = {"cpp11", "nowarnings"},
library = "jnind4jcuda", link = "nd4jcuda", preload = "libnd4jcuda"),
@Platform(value = "linux", preload = "gomp@.1",
preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/",
"/usr/lib/powerpc64-linux-gnu/",
"/usr/lib/powerpc64le-linux-gnu/"})})
@Platform(value = "linux", preload = "gomp@.1", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/"}),
@Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}),
@Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}),
@Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", "/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}),
@Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "libnd4jcpu"}) })
public class Nd4jCudaPresets implements InfoMapper {
@Override
public void map(InfoMap infoMap) {

View File

@ -19,6 +19,7 @@ package org.nd4j.nativeblas;
import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.*;
import org.bytedeco.openblas.global.openblas;
import java.io.File;
import java.io.IOException;
@ -31,7 +32,7 @@ import java.util.Scanner;
*
* @author saudet
*/
@Properties(target = "org.nd4j.nativeblas.Nd4jCpu", helper = "org.nd4j.nativeblas.Nd4jCpuHelper",
@Properties(inherit = openblas.class, target = "org.nd4j.nativeblas.Nd4jCpu", helper = "org.nd4j.nativeblas.Nd4jCpuHelper",
value = {@Platform(define = "LIBND4J_ALL_OPS", include = {
"memory/MemoryType.h",
"array/DataType.h",
@ -127,15 +128,13 @@ import java.util.Scanner;
"ops/declarable/headers/third_party.h",
"cnpy/cnpy.h"
},
compiler = {"cpp11", "nowarnings"}, library = "jnind4jcpu", link = "nd4jcpu",
preloadresource = {"org/bytedeco/openblas/"},
preload = {"openblas", "openblas_nolapack", "libnd4jcpu"}),
@Platform(value = "linux", preload = {"gomp@.1"}, preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/"}),
@Platform(value = {"linux-arm", "linux-ppc"}, preload = {"gomp@.1", "gcc_s@.1", "quadmath@.0", "gfortran@.5", "gfortran@.4", "gfortran@.3", "openblas@.0", "libnd4jcpu"}),
compiler = {"cpp11", "nowarnings"},
library = "jnind4jcpu", link = "nd4jcpu", preload = "libnd4jcpu"),
@Platform(value = "linux", preload = "gomp@.1", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/"}),
@Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}),
@Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}),
@Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", "/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}),
@Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "msvcr120", "libnd4jcpu"}),
@Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "libnd4jcpu"}),
@Platform(extension = {"-avx512", "-avx2"}) })
public class Nd4jCpuPresets implements InfoMapper, BuildEnabled {