|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcuda.LibUtils
public final class LibUtils
Utility class for detecting the operating system and architecture
types, and automatically loading the matching native library
as a resource or from a file.
The architecture and OS detection has been adapted from
http://javablog.co.uk/2007/05/19/making-jni-cross-platform/
and extended with http://lopica.sourceforge.net/os.html
Nested Class Summary | |
---|---|
static class |
LibUtils.ARCHType
Enumeration of common CPU architectures. |
static class |
LibUtils.OSType
Enumeration of common operating systems, independent of version or architecture. |
Method Summary | |
---|---|
static LibUtils.ARCHType |
calculateArch()
Calculates the current ARCHType |
static LibUtils.OSType |
calculateOS()
Calculates the current OSType |
static java.lang.String |
createLibName(java.lang.String baseName)
Creates the name for the native library with the given base name for the current operating system and architecture. |
static void |
loadLibrary(java.lang.String baseName)
Loads the specified library. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void loadLibrary(java.lang.String baseName)
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.
baseName
- The base name of the library
java.lang.UnsatisfiedLinkError
- if the native library
could not be loaded.public static java.lang.String createLibName(java.lang.String baseName)
baseName
- The base name of the library
public static LibUtils.OSType calculateOS()
public static LibUtils.ARCHType calculateArch()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |