Skip to content

Add allowNative system properties as switch#28

Merged
luhenry merged 3 commits intoluhenry:masterfrom
pan3793:allow-native
Jan 27, 2026
Merged

Add allowNative system properties as switch#28
luhenry merged 3 commits intoluhenry:masterfrom
pan3793:allow-native

Conversation

@pan3793
Copy link
Copy Markdown
Contributor

@pan3793 pan3793 commented Dec 15, 2025

This PR proposes to add the following 3 Java system properties as a switch so that the user can control whether ARPACK.getInstance(), BLAS.getInstance(), and LAPACK.getInstance() prefer to return the native implementation.

dev.ludovic.netlib.arpack.allowNative (default true)
dev.ludovic.netlib.blas.allowNative   (default true)
dev.ludovic.netlib.lapack.allowNative (default true)

Sometimes the shared cluster(e.g., Apache Hadoop YARN) host installs very old or bugly OpenBLAS/MKL libs, for Apache Spark jobs, it does not have a switch to disable using that for a single job. With this patch, it's able to pass those system properties so that the user can prefer using the Java implementation without touching the OS libs.

Comment thread blas/src/main/java/dev/ludovic/netlib/blas/InstanceBuilder.java

final class InstanceBuilder {

public static final String ALLOW_NATIVE_ARPACK = "dev.ludovic.netlib.arpack.allowNative";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after second thought, maybe it's better to define it at interface LAPACK instead of here, since it is kind of a public API, @luhenry what do you think?

@pan3793 pan3793 requested a review from luhenry December 17, 2025 07:05
@pan3793
Copy link
Copy Markdown
Contributor Author

pan3793 commented Dec 18, 2025

kindly ping @luhenry, could you please take another look?

@pan3793
Copy link
Copy Markdown
Contributor Author

pan3793 commented Jan 15, 2026

kindly ping @luhenry again ...

@luhenry luhenry merged commit c7d2a01 into luhenry:master Jan 27, 2026
5 checks passed
@pan3793
Copy link
Copy Markdown
Contributor Author

pan3793 commented Jan 28, 2026

@luhenry, thanks for merging! Could you please trigger a release, so I can use it on Spark?

@luhenry
Copy link
Copy Markdown
Owner

luhenry commented Jan 30, 2026

@luhenry, thanks for merging! Could you please trigger a release, so I can use it on Spark?

You're absolutely welcome, and thank you for your patience! I'll trigger a release in next few days.

@pan3793
Copy link
Copy Markdown
Contributor Author

pan3793 commented Feb 9, 2026

Kindly ping @luhenry, do you have an ETA for the next release? 👀

@luhenry
Copy link
Copy Markdown
Owner

luhenry commented Feb 12, 2026

Working on the release now, should be done by tomorrow. Good news it is that the release will also bring support for using Accelerate on macOS.

@luhenry
Copy link
Copy Markdown
Owner

luhenry commented Feb 12, 2026

@pan3793 https://github.com/luhenry/netlib/releases/tag/v3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants