TNO Intern

Commit 1c76d792 authored by Florian Knappers's avatar Florian Knappers
Browse files

Resolve "fix mac jvm installation bug"

parent 3a741b1f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
# 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
+1 −1
Original line number Diff line number Diff line
@@ -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" },
+1 −1
Original line number Diff line number Diff line
@@ -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:
+9 −2
Original line number Diff line number Diff line
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