Skip to content

Commit 22c2eb9

Browse files
authored
Fix CxxWrap warning (#42)
The obejct passed to the `@wrapmodule` macro has now to be a function rather than a variable.
1 parent 853a85d commit 22c2eb9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/poplar.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using CxxWrap
33
using Scratch
44

55
const libpoplar_dir = joinpath(@get_scratch!("libpoplar"), "v$(Base.thispatch(VERSION))")
6-
const libpoplar = joinpath(libpoplar_dir, "libpoplar_julia.so")
6+
get_libpoplar_path() = joinpath(libpoplar_dir, "libpoplar_julia.so")
77

88
export @graph
99

@@ -74,11 +74,12 @@ struct VertexPerfEstimate
7474
new(UInt64(cycles), UInt64(flops))
7575
end
7676

77-
@wrapmodule(libpoplar)
77+
@wrapmodule(get_libpoplar_path)
7878

7979
const SDK_VERSION = VersionNumber(match(r"[\d.]+", String(Poplar.getVersionString())).match)
8080

8181
function __init__()
82+
libpoplar = get_libpoplar_path()
8283
if !isfile(libpoplar)
8384
error("""
8485
`$(basename(libpoplar))` expected to exist at path `$(libpoplar)`, but could not be found.

0 commit comments

Comments
 (0)