Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/ci-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
run: |
julia -e 'using Pkg;Pkg.add(["SlimPlotting", "PythonPlot", "NLopt", "Flux", "JOLI", "Zygote", "IterativeSolvers", "SlimOptim", "HDF5", "SegyIO", "SetIntersectionProjection"])'
julia -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()))'
# https://discourse.julialang.org/t/problem-with-github-action-julia-docdeploy/128789
julia -e 'using Pkg; Pkg.add(name="OpenSSL_jll", version="3.0")'

- name: Run examples
run: julia -p 2 -t 1 ${{ matrix.example }}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JUDI"
uuid = "f3b833dc-6b2e-5b9c-b940-873ed6319979"
authors = ["Philipp Witte, Mathias Louboutin"]
version = "4.1.1"
version = "4.1.2"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
28 changes: 21 additions & 7 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,49 @@ else
exit()
end

cmd(x::String) = Cmd(convert(Vector{String}, split(x, " ")))

# Check if can call with '--user' flag
pip = try
run(Cmd(`$(pyexe) -m pip install --user --no-cache-dir --upgrade pip`))
"pip install --user --no-cache-dir"
catch e
"pip install --no-cache-dir"
end

pk = try
pyimport("pkg_resources")
catch e
run(Cmd(`$(pyexe) -m pip install -U --user --no-cache-dir setuptools`))
run(cmd("$(pyexe) -m $(pip) setuptools"))
pyimport("pkg_resources")
end

################## JOLI ##################
run(Cmd(`$(pyexe) -m pip install -U --user --no-cache-dir PyWavelets`))
try
pyimport("pywt")
catch e
run(cmd("$(pyexe) -m $(pip) PyWavelets"))
end

################## Devito ##################
# pip command
dvver = "4.8.14"
cmd = Cmd(`$(pyexe) -m pip install --user --no-cache-dir devito\[extras,tests\]\>\=$(dvver)`)
dv_cmd = "$(pyexe) -m $(pip) devito[extras,tests]>=$(dvver)"

try
dv_ver = VersionNumber(split(pk.get_distribution("devito").version, "+")[1])
if dv_ver < VersionNumber(dvver)
@info "Devito version too low, updating to >=$(dvver)"
run(cmd)
run(cmd(dv_cmd))
end
catch e
@info "Devito not installed, installing with PythonCall python"
run(cmd)
run(cmd(dv_cmd))
end

################## Matplotlib ##################
try
mpl = pyimport("matplotlib")
pyimport("matplotlib")
catch e
run(Cmd(`$(pyexe) -m pip install --user --no-cache-dir matplotlib`))
run(cmd("$(pyexe) -m $(pip) matplotlib"))
end
2 changes: 1 addition & 1 deletion src/JUDI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function __init__()
# Make sure there is no conflict for the cuda init thread with CUDA.jl
if get(ENV, "DEVITO_PLATFORM", "") == "nvidiaX"
@info "Initializing openacc/openmp offloading"
devito_model(Model((21, 21, 21), (10., 10., 10.), (0., 0., 0.), randn(Float32, 21, 21, 21)), Options())
devito_model(Model((21, 21, 21), (10., 10., 10.), (0., 0., 0.), ones(Float32, 21, 21, 21)), Options())
global _devices = parse.(Int, get(ENV, "CUDA_VISIBLE_DEVICES", "-1"))
end

Expand Down
Loading