File tree Expand file tree Collapse file tree 7 files changed +34
-6
lines changed
arpack/src/main/java/dev/ludovic/netlib/arpack
blas/src/main/java/dev/ludovic/netlib/blas
lapack/src/main/java/dev/ludovic/netlib/lapack Expand file tree Collapse file tree 7 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 1+ .idea /
12** /target
23** /.classpath
34** /.project
Original file line number Diff line number Diff line change 2727
2828public interface ARPACK {
2929
30+ public static final String ALLOW_NATIVE_ARPACK = "dev.ludovic.netlib.arpack.allowNative" ;
31+
3032 public static ARPACK getInstance () {
3133 return InstanceBuilder .arpack ();
3234 }
Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ final class InstanceBuilder {
3737 private static final JavaARPACK javaArpack ;
3838
3939 static {
40- nativeArpack = initializeNative ();
40+ String allowNativeArpack = System .getProperty (ARPACK .ALLOW_NATIVE_ARPACK , "true" );
41+ if (Boolean .parseBoolean (allowNativeArpack )) {
42+ nativeArpack = initializeNative ();
43+ } else {
44+ log .info ("Skip trying to load native BLAS implementation because system property " +
45+ ARPACK .ALLOW_NATIVE_ARPACK + " is " + allowNativeArpack );
46+ nativeArpack = null ;
47+ }
4148 javaArpack = initializeJava ();
4249 arpack = nativeArpack != null ? nativeArpack : javaArpack ;
4350
@@ -52,7 +59,7 @@ private static NativeARPACK initializeNative() {
5259 try {
5360 return JNIARPACK .getInstance ();
5461 } catch (Throwable t ) {
55- log .log (Level .FINE , "Failed to load implementation from:" + JNIARPACK .class .getName (), t );
62+ log .log (Level .FINE , "Failed to load implementation from: " + JNIARPACK .class .getName (), t );
5663 return null ;
5764 }
5865 }
Original file line number Diff line number Diff line change 2727
2828public interface BLAS {
2929
30+ public static final String ALLOW_NATIVE_BLAS = "dev.ludovic.netlib.blas.allowNative" ;
31+
3032 public static BLAS getInstance () {
3133 return InstanceBuilder .blas ();
3234 }
Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ final class InstanceBuilder {
3737 private static final JavaBLAS javaBlas ;
3838
3939 static {
40- nativeBlas = initializeNative ();
40+ String allowNativeBlas = System .getProperty (BLAS .ALLOW_NATIVE_BLAS , "true" );
41+ if (Boolean .parseBoolean (allowNativeBlas )) {
42+ nativeBlas = initializeNative ();
43+ } else {
44+ log .info ("Skip trying to load native BLAS implementation because system property " +
45+ BLAS .ALLOW_NATIVE_BLAS + " is " + allowNativeBlas );
46+ nativeBlas = null ;
47+ }
4148 javaBlas = initializeJava ();
4249 blas = nativeBlas != null ? nativeBlas : javaBlas ;
4350
@@ -52,7 +59,7 @@ private static NativeBLAS initializeNative() {
5259 try {
5360 return JNIBLAS .getInstance ();
5461 } catch (Throwable t ) {
55- log .log (Level .FINE , "Failed to load implementation from:" + JNIBLAS .class .getName (), t );
62+ log .log (Level .FINE , "Failed to load implementation from: " + JNIBLAS .class .getName (), t );
5663 return null ;
5764 }
5865 }
Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ final class InstanceBuilder {
3737 private static final JavaLAPACK javaLapack ;
3838
3939 static {
40- nativeLapack = initializeNative ();
40+ String allowNativeLapack = System .getProperty (LAPACK .ALLOW_NATIVE_LAPACK , "true" );
41+ if (Boolean .parseBoolean (allowNativeLapack )) {
42+ nativeLapack = initializeNative ();
43+ } else {
44+ log .info ("Skip trying to load native LAPACK implementation because system property " +
45+ LAPACK .ALLOW_NATIVE_LAPACK + " is " + allowNativeLapack );
46+ nativeLapack = null ;
47+ }
4148 javaLapack = initializeJava ();
4249 lapack = nativeLapack != null ? nativeLapack : javaLapack ;
4350
@@ -52,7 +59,7 @@ private static NativeLAPACK initializeNative() {
5259 try {
5360 return JNILAPACK .getInstance ();
5461 } catch (Throwable t ) {
55- log .log (Level .FINE , "Failed to load implementation from:" + JNILAPACK .class .getName (), t );
62+ log .log (Level .FINE , "Failed to load implementation from: " + JNILAPACK .class .getName (), t );
5663 return null ;
5764 }
5865 }
Original file line number Diff line number Diff line change 2727
2828public interface LAPACK {
2929
30+ public static final String ALLOW_NATIVE_LAPACK = "dev.ludovic.netlib.lapack.allowNative" ;
31+
3032 public static LAPACK getInstance () {
3133 return InstanceBuilder .lapack ();
3234 }
You can’t perform that action at this time.
0 commit comments