Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Julia 1.11 jl_array_data -> jl_array-data_; TODO investigate new API #53

Merged
merged 5 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ jobs:
- devel
os:
- ubuntu-latest
- macOS-latest
# - macOS-latest
julia:
- '1.10'
- '1.11'
- 'lts'

steps:
- uses: actions/checkout@v4
Expand All @@ -34,6 +38,8 @@ jobs:
uses: julia-actions/setup-julia@latest
with:
show-versioninfo: 'true'
arch: ${{ runner.arch }}
version: ${{ matrix.julia }}

- run: nimble install -y
env:
Expand Down
10 changes: 5 additions & 5 deletions nimjl/config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ when exitCode != 0:

const JuliaArrayVersion* = cmdOutput.split("\"")[1].split(".")

# For release : result has the form ["v", "1.6.0", ""] -> splitting [1] yiels ["1", "6, "0"]
# For dev: result has the form ["v", "1.7.0-DEV", "667"] -> splitting [1] yiels ["1", "7, "0-DEV", "667"]
const JuliaMajorVersion* = JuliaArrayVersion[0].parseInt
const JuliaMinorVersion* = JuliaArrayVersion[1].parseInt
const JuliaPatchVersion* = JuliaArrayVersion[2].parseInt
# For release : result has the form ["v", "1.6.0", ""] -> splitting [1] yields ["1", "6, "0"]
# For dev: result has the form ["v", "1.7.0-DEV", "667"] -> splitting [1] yields ["1", "7, "0-DEV", "667"]
const JuliaMajorVersion* = JuliaArrayVersion[0].parseInt()
const JuliaMinorVersion* = JuliaArrayVersion[1].parseInt()
const JuliaPatchVersion* = JuliaArrayVersion[2].parseInt()
const libPrefix = "lib"
const libSuffix = ".so"
const JuliaLibName* = JuliaLibPath / libPrefix & "julia" & libSuffix
Expand Down
7 changes: 6 additions & 1 deletion nimjl/private/jlarrays.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ template julia_type(arg: typedesc): ptr jl_datatype =

## Array bindings
{.push nodecl, header: JuliaHeader, dynlib: JuliaLibName.}
proc jl_array_data*(values: ptr jl_array): pointer {.importc.}

when (JuliaMajorVersion, JuliaMinorVersion) >= (1, 11):
proc jl_array_data*(values: ptr jl_array): pointer {.importc: "jl_array_data_".}
else:
proc jl_array_data*(values: ptr jl_array): pointer {.importc: "jl_array_data".}

proc jl_array_dim*(a: ptr jl_array, dim: cint): cint {.importc.}
proc jl_array_len*(a: ptr jl_array): cint {.importc.}
proc jl_array_rank*(a: ptr jl_value): cint {.importc.}
Expand Down