Skip to content

Commit

Permalink
ncsa.jhdf5 MacOS ARM64 libs not loaded (until port Chombo/MB to io.jhdf)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Nov 4, 2024
1 parent f4fcbbb commit 3614ab5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,12 @@ private List<ExportOutput> exportPDEData(OutputContext outputContext, long jobID
GeometrySpecs geometrySpecs, ASCIISpecs asciiSpecs, String contextName, FileDataContainerManager fileDataContainerManager)
throws DataAccessException, IOException{

NativeLib.HDF5.load();
// skip loading legacy native HDF5 library if the system is a macos arm64
// will get runtime errors for Chombo and MovingBoundary until HDF5 is updated
boolean MacosArm64 = System.getProperty("os.arch").equals("aarch64") && System.getProperty("os.name").equals("Mac OS X");
if (!MacosArm64) {
NativeLib.HDF5.load();
}
ExportSpecs.SimNameSimDataID[] simNameSimDataIDs = asciiSpecs.getSimNameSimDataIDs();
Vector<ExportOutput[]> exportOutputV = new Vector<ExportOutput[]>();
double progressCounter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public VtkMeshGenerator(User owner, KeyValue simKey, int jobIndex) {
@Override
public int execute() {
try {
NativeLib.HDF5.load();
// skip loading legacy native HDF5 library if the system is a macos arm64
// will get runtime errors for Chombo and MovingBoundary until HDF5 is updated
boolean MacosArm64 = System.getProperty("os.arch").equals("aarch64") && System.getProperty("os.name").equals("Mac OS X");
if (!MacosArm64) {
NativeLib.HDF5.load();
}
KeyValue u = new KeyValue(userkey);
User owner = new User(username,u);
KeyValue simKey = new KeyValue(simkey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public void init( ) {
@Test
public void loadEm( ) {
for (NativeLib nl : NativeLib.values()) {
// skip if nl is HDF5 and system is a macos arm64
if (nl == NativeLib.HDF5 && System.getProperty("os.arch").equals("aarch64") && System.getProperty("os.name").equals("Mac OS X")) {
continue;
}
nl.load();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ public class MovingBoundaryH5FileStructureTest {
@BeforeAll
public static void setup() {
PropertyLoader.setProperty(PropertyLoader.installationRoot, new File("..").getAbsolutePath());
NativeLib.HDF5.load();
// skip loading legacy native HDF5 library if the system is a macos arm64
// will get runtime errors for Chombo and MovingBoundary until HDF5 is updated
boolean MacosArm64 = System.getProperty("os.arch").equals("aarch64") && System.getProperty("os.name").equals("Mac OS X");
if (!MacosArm64) {
NativeLib.HDF5.load();
}
}

//public static void main(String args[]) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ public class MovingBoundaryResultTest {
@BeforeAll
public static void setup() {
PropertyLoader.setProperty(PropertyLoader.installationRoot, new File("..").getAbsolutePath());
NativeLib.HDF5.load();
// skip loading legacy native HDF5 library if the system is a macos arm64
// will get runtime errors for Chombo and MovingBoundary until HDF5 is updated
boolean MacosArm64 = System.getProperty("os.arch").equals("aarch64") && System.getProperty("os.name").equals("Mac OS X");
if (!MacosArm64) {
NativeLib.HDF5.load();
}
}
public MovingBoundaryResultTest() {
Logger lg = LogManager.getLogger("ncsa");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ public class MovingBoundaryVH5PathTest {
@BeforeEach
public void setup( ) throws Exception {
PropertyLoader.setProperty(PropertyLoader.installationRoot, new File("..").getAbsolutePath());
NativeLib.HDF5.load();
// skip loading legacy native HDF5 library if the system is a macos arm64
// will get runtime errors for Chombo and MovingBoundary until HDF5 is updated
boolean MacosArm64 = System.getProperty("os.arch").equals("aarch64") && System.getProperty("os.name").equals("Mac OS X");
if (!MacosArm64) {
NativeLib.HDF5.load();
}


// retrieve an instance of H5File
Expand Down

0 comments on commit 3614ab5

Please sign in to comment.