From 8bda95b0adeb97b6a2d064a0a3646905c7e327fe Mon Sep 17 00:00:00 2001 From: Spencer Wyant <17836774+swyant@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:47:54 -0500 Subject: [PATCH 1/2] update Julia version to 1.10, update CI correspondingly --- .github/workflows/CI.yml | 4 +--- Project.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 34ba84f..4717143 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,10 +14,8 @@ jobs: fail-fast: false matrix: version: - - "1.8" - - "1.9" - "1.10" - - "~1.11.0-0" + - "1.11" - "nightly" os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index eab7a96..cbda28f 100644 --- a/Project.toml +++ b/Project.toml @@ -15,4 +15,4 @@ CEnum = "0.4, 0.5" LAMMPS_jll = "2.6.0" Preferences = "1" MPI = "0.20" -julia = "1.8" +julia = "1.10" From 2317c39fb74f06b899778750a2396527dbd82882 Mon Sep 17 00:00:00 2001 From: Spencer Wyant <17836774+swyant@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:49:12 -0500 Subject: [PATCH 2/2] LAMMPS uses Int32, so need BLAS LP64 compatibility. Default to OpenBLAS32_jll if LP64 library not available --- Project.toml | 6 ++++-- src/LAMMPS.jl | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index cbda28f..28614a8 100644 --- a/Project.toml +++ b/Project.toml @@ -7,12 +7,14 @@ version = "0.7.2" CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" LAMMPS_jll = "5b3ab26d-9607-527c-88ea-8fe5ba57cafe" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" -Preferences = "21216c6a-2e73-6563-6e65-726566657250" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" +OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2" +Preferences = "21216c6a-2e73-6563-6e65-726566657250" [compat] CEnum = "0.4, 0.5" LAMMPS_jll = "2.6.0" -Preferences = "1" MPI = "0.20" +Preferences = "1" julia = "1.10" diff --git a/src/LAMMPS.jl b/src/LAMMPS.jl index 7516d9d..ea0c82d 100644 --- a/src/LAMMPS.jl +++ b/src/LAMMPS.jl @@ -1,5 +1,8 @@ module LAMMPS import MPI +import LinearAlgebra +import OpenBLAS32_jll + include("api.jl") export LMP, command, create_atoms, get_natoms, extract_atom, extract_compute, extract_global, @@ -84,6 +87,12 @@ const TAGINT = API.lammps_extract_setting(C_NULL, "tagint") == 4 ? Int32 : Int64 const IMAGEINT = API.lammps_extract_setting(C_NULL, "imageint") == 4 ? Int32 : Int64 function __init__() + # LAMMPS requires using LP64, default to OpenBLAS32 if not already available + config = LinearAlgebra.BLAS.lbt_get_config() + if !any(lib -> lib.interface == :lp64, config.loaded_libs) + LinearAlgebra.BLAS.lbt_forward(OpenBLAS32_jll.libopenblas_path) + end + BIGINT != (API.lammps_extract_setting(C_NULL, "bigint") == 4 ? Int32 : Int64) && error("The size of the LAMMPS integer type BIGINT has changed! To fix this, you need to manually invalidate the LAMMPS.jl cache.") TAGINT != (API.lammps_extract_setting(C_NULL, "tagint") == 4 ? Int32 : Int64) &&