Skip to content

Commit

Permalink
Tweak python env
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloferz committed May 28, 2024
1 parent 899743b commit 1ba1344
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/setup_python_env.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ CondaPkg.add(CondaPkg.PkgREPL.parse_pkg.(python_deps))
@static if VERSION == v"1.6.7" && Sys.isapple()
lib = joinpath(CondaPkg.envdir(), "lib/libmkl_intel_thread.1.dylib")
run(`install_name_tool -change @rpath/libiomp5.dylib @loader_path/libiomp5.dylib $lib`)
elseif Sys.islinux()
# lib = joinpath(CondaPkg.envdir(), "lib") # "lib/libmkl_intel_lp64.so")
elseif VERSION > v"1.6.7" && Sys.islinux()
CondaPkg.withenv() do
python = CondaPkg.which("python")
script = "import sysconfig; print(sysconfig.get_paths()['purelib'])"
sitelib = readchomp(`$python -c "$script"`)
run(`patchelf --add-rpath '$ORIGIN/../../../..' $sitelib/torch/lib/libtorch.so`)
run(`patchelf --add-rpath '$ORIGIN/../../../..' $sitelib/torch/lib/libtorch_cpu.so`)
run(`ldd $sitelib/torch/lib/libtorch.so`)
run(`ldd $sitelib/torch/lib/libtorch_cpu.so`)
end
end

Expand Down

0 comments on commit 1ba1344

Please sign in to comment.