Skip to content

Commit

Permalink
Add ENV var name as a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato Azevedo committed Mar 14, 2024
1 parent 5a675d4 commit 89b9742
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public class LightGBMUtils {
*/
static final int BINARY_LGBM_NUM_CLASSES = 1;

/**
* Environment variable with the implementation of libc available on the system.
*/
static final String FDZ_OPENML_JAVA_LIBC = "FDZ_OPENML_JAVA_LIBC";

/**
* State variable to know if it loadLibs was ever called.
*/
Expand All @@ -60,7 +65,7 @@ static public void loadLibs() {

if (!libsLoaded) {
final CpuArchitecture cpuArchitecture = getCpuArchitecture(System.getProperty("os.arch"));
final LibcImplementation libcImpl = getLibcImplementation(System.getenv("FDZ_OPENML_JAVA_LIBC"));
final LibcImplementation libcImpl = getLibcImplementation(System.getenv(FDZ_OPENML_JAVA_LIBC));
final Infrastructure infrastructure = new Infrastructure(cpuArchitecture, libcImpl);

try {
Expand All @@ -87,7 +92,7 @@ static CpuArchitecture getCpuArchitecture(final String cpuArchName) {

static LibcImplementation getLibcImplementation(final String libcImpl) {
if (libcImpl == null || libcImpl.isEmpty()) {
logger.debug("FDZ_OPENML_JAVA_LIBC not set, assuming glibc as libc implementation.");
logger.debug("{} not set, assuming glibc as libc implementation.", FDZ_OPENML_JAVA_LIBC);
return LibcImplementation.GLIBC;
}

Expand Down

0 comments on commit 89b9742

Please sign in to comment.