Skip to content

Commit

Permalink
Merge pull request #70 from cesmix-mit/sw/lp64_compat
Browse files Browse the repository at this point in the history
Update to Julia 1.10 and ensure BLAS lp64 compatibility
  • Loading branch information
swyant authored Nov 22, 2024
2 parents 92691a2 + 2317c39 commit 75b2b29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
julia = "1.8"
Preferences = "1"
julia = "1.10"
9 changes: 9 additions & 0 deletions src/LAMMPS.jl
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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) &&
Expand Down

0 comments on commit 75b2b29

Please sign in to comment.