nd4j-buffer/src/main/java/org/nd4j/linalg/api/buffer/util/LibUtils.java
public static void loadLibrary(String baseName) {
        String libName = LibUtils.createLibName(baseName);

        Throwable throwable = null;
        try {
            loadLibraryResource(libName);
            return;
        } catch (Throwable t) {
            throwable = t;
        }

        try {
            System.loadLibrary(libName);
            return;
        } catch (Throwable t) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);

            pw.println("Error while loading native library \"" + libName + "\" with base name \"" + baseName + "\"");
            pw.println("Operating system name: " + System.getProperty("os.name"));
            pw.println("Architecture         : " + System.getProperty("os.arch"));
            pw.println("Architecture bit size: " + System.getProperty("sun.arch.data.model"));

            if (throwable != null) {
                pw.println("Stack trace from the attempt to " + "load the library as a resource:");
                throwable.printStackTrace(pw);
            }

            pw.println("Stack trace from the attempt to " + "load the library as a file:");
            t.printStackTrace(pw);

            pw.flush();
            pw.close();
            throw new UnsatisfiedLinkError("Could not load the native library.\n" + sw.toString());
        }
    }
public static void loadLibrary(String baseName) {
        String libName = LibUtils.createLibName(baseName);

        Throwable throwable = null;
        try {
            loadLibraryResource(libName);
            return;
        } catch (Throwable t) {
            throwable = t;
        }

        try {
            System.loadLibrary(libName);
            return;
        } catch (Throwable t) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);

            pw.println("Error while loading native library \"" + libName + "\" with base name \"" + baseName + "\"");
            pw.println("Operating system name: " + System.getProperty("os.name"));
            pw.println("Architecture         : " + System.getProperty("os.arch"));
            pw.println("Architecture bit size: " + System.getProperty("sun.arch.data.model"));

            if (throwable != null) {
                pw.println("Stack trace from the attempt to " + "load the library as a resource:");
                throwable.printStackTrace(pw);
            }

            pw.println("Stack trace from the attempt to " + "load the library as a file:");
            t.printStackTrace(pw);

            pw.flush();
            pw.close();
            throw new UnsatisfiedLinkError("Could not load the native library.\n" + sw.toString());
        }
    }
Loads the specified library. The full name of the library
is created by calling {@link LibUtils#createLibName(String)}
with the given argument. The method will attempt to load
the library as a as a resource (for usage within a JAR),
and, if this fails, using the usual System.loadLibrary
call.

@param baseName The base name of the library
@throws UnsatisfiedLinkError if the native library
could not be loaded.