Skip to content

Commit

Permalink
Julia v1.10 (#11)
Browse files Browse the repository at this point in the history
Update to be compatible with Julia v1.10 and CxxWrap v0.14.
  • Loading branch information
torrance authored Mar 6, 2024
1 parent e3ea3b2 commit 0595c37
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dev-nobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
version:
- '1.8'
- '1.9'
- '1.10'
os:
- ubuntu-latest
arch:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Dev
on:
pull_request:
push:
branches:
- main
branches: '*'
tags: '*'
jobs:
test:
Expand All @@ -15,6 +14,7 @@ jobs:
version:
- {name: '1.8', version: '1.8'}
- {name: '1.9', version: '1.9'}
- {name: '1.10', version: '1.10'}
os:
- ubuntu-latest
arch:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
version:
- '1.8'
- '1.9'
- '1.10'
os:
- ubuntu-latest
arch:
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
casacorecxx_jll = "689e2960-4160-5310-ae7f-2d2095288874"

[compat]
casacorecxx_jll = "0.2.1"
CEnum = "0.4"
CxxWrap = "0.12"
julia = "1.8, 1.9"
casacorecxx_jll = "0.3.0"
CEnum = "0.5"
CxxWrap = "0.14"
julia = "1.8, 1.9, 1.10"
Unitful = "1"

[extras]
Expand Down
8 changes: 4 additions & 4 deletions build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using BinaryBuilder, Pkg

name = "casacorecxx"
version = v"0.2.1"
version = v"0.3.0"

# Collection of sources required to complete build
sources = [DirectorySource("casacorecxx")]
Expand Down Expand Up @@ -32,11 +32,11 @@ platforms = expand_cxxstring_abis(platforms)
products = Product[LibraryProduct("libcasacorecxx", :libcasacorecxx),]

# Dependencies that must be installed before this package can be built
dependencies = [Dependency("libcxxwrap_julia_jll"),
Dependency("casacore_jll"),
dependencies = [Dependency("libcxxwrap_julia_jll", compat="0.11.2"),
Dependency("casacore_jll", compat="3.5.1"),
BuildDependency("libjulia_jll")]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.8",
preferred_gcc_version=v"12") # We need C++17 for CxxWrap
preferred_gcc_version=v"7") # We need C++17 for CxxWrap
10 changes: 6 additions & 4 deletions casacorecxx/src/casacorecxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class JuliaState: public AppState {
public:
JuliaState(std::string measuresDir) : _measuresDir(measuresDir) {}

std::string measuresDir() const {
std::string measuresDir() const override {
return _measuresDir;
}

bool initialized() const {
bool initialized() const override {
return true;
}

Expand Down Expand Up @@ -135,7 +135,9 @@ JLCXX_MODULE define_julia_module(jlcxx::Module &mod) {
.constructor<std::string>();

mod.add_type<AppStateSource>("AppStateSource")
.method("initialize", &AppStateSource::initialize);
.method("initialize", [](AppState& appstate) {
AppStateSource::initialize(&appstate);
});

/*
* UTILITIES
Expand Down Expand Up @@ -644,4 +646,4 @@ JLCXX_MODULE define_julia_module(jlcxx::Module &mod) {

mod.method("Observatories", &casacore::MeasTable::Observatories);
mod.method("Observatory", &casacore::MeasTable::Observatory);
}
}
6 changes: 3 additions & 3 deletions src/LibCasacore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ using casacorecxx_jll
using CxxWrap
using Pkg.Artifacts

@wrapmodule(libcasacorecxx)
@wrapmodule(casacorecxx_jll.get_libcasacorecxx_path)

function __init__()
@initcxx

# Configure Casacore data paths.
# Set juliastate as global since casacore holds the pointer and expects the object to remain alive.
global juliastate = JuliaState(artifact"measures")
initialize(CxxPtr(juliastate))
initialize(juliastate)
end

# Vector: implements iteration, indexing
Expand Down Expand Up @@ -144,4 +144,4 @@ function Slicer(is::Vararg{Union{Int, OrdinalRange}, N}) where N
)
end

end
end

0 comments on commit 0595c37

Please sign in to comment.