diff --git a/docs/changelog.md b/docs/changelog.md index d819c8dc56d052da18b31921021068ce61845191..0d6d5b03d9ca354a2df6a785ac50b53b0c7e5a47 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,8 @@ # Change log +## v3.0.2 (06-7-2026) +- Fix installation issues for macOS users with a silicon chip. + ## v3.0.1 (06-7-2026) - Added pressureDifferenceGradient as property. - Implemented detailed SDE classes diff --git a/pyproject.toml b/pyproject.toml index 2fe726658ac1e08da002d01d53d1ff69cb794991..b91aa8678b22cf20cb252a9f09f16d577117fbe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pythermogis" -version = "3.0.1" +version = "3.0.2" description = "This repository is used as a python API for the ThermoGIS Doublet simulations" authors = [ { name = "Hen Brett", email = "hen.brett@tno.nl" }, diff --git a/pythermogis/constants.py b/pythermogis/constants.py index 3d92a6ffa0e13737e06d492d018c57099cdd2cee..f1507afd61667ed29149aad36b69692337cf5324 100644 --- a/pythermogis/constants.py +++ b/pythermogis/constants.py @@ -9,7 +9,7 @@ os_name = platform.system() if os_name == "Linux": JVM17_DLL_PATH = JVM17_PATH / "jdk17" / "lib" / "server" / "libjvm.so" elif os_name == "Darwin": # mac - JVM17_DLL_PATH = JVM17_PATH / "jdk17" / "lib" / "server" / "libjvm.dylib" + JVM17_DLL_PATH = JVM17_PATH / "jdk17" / "Contents" / "Home" / "lib" / "server" / "libjvm.dylib" elif os_name == "Windows": JVM17_DLL_PATH = JVM17_PATH / "jdk17" / "bin" / "server" / "jvm.dll" else: diff --git a/pythermogis/jvm.py b/pythermogis/jvm.py index 6000ab710cf3780f5cb3aa208d66c3a806b66751..f89c067948c3a3491f887d8eda6e22718fd129c4 100644 --- a/pythermogis/jvm.py +++ b/pythermogis/jvm.py @@ -1,8 +1,10 @@ import faulthandler +import platform import shutil import jdk import jpype +from jdk.enums import Architecture from pythermogis.constants import JVM17_DLL_PATH, JVM17_PATH, THERMOGIS_JAR_PATH @@ -26,8 +28,13 @@ def install_jvm(): # create path JVM17_PATH.mkdir(parents=True, exist_ok=True) - # Installs a Corretto build of Java 17 JDK - jdk.install("17", vendor="Corretto", path=JVM17_PATH) + # This arch line was added to fix an issue people with a mac with the new + # silicon chip had. The bug is actually an upstream bug in the jdk package, + # but this package is unmaintained. thats why we now added this injection of arch + # value in case of a macOS. For other os, it still works, as the package correctly + # handles those. + arch = Architecture.AARCH64 if platform.machine() == "arm64" else None + jdk.install("17", vendor="Corretto", arch=arch, path=JVM17_PATH) # search for the path of the installed JDK, it can be different depending on the # version number