Skip to content

Commit 3140bb0

Browse files
committed
lib as string as opposed to handle
1 parent aee2d7d commit 3140bb0

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

Project.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name = "AppleAccelerate"
22
uuid = "13e28ba4-7ad8-5781-acae-3021b1ed3924"
33
version = "0.3.2"
44

5+
[deps]
6+
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
7+
58
[compat]
69
julia = "1.6"
710

@@ -13,4 +16,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1316
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1417

1518
[targets]
16-
test = [ "DSP", "Statistics", "LinearAlgebra", "Test", "Random"]
19+
test = ["DSP", "Statistics", "LinearAlgebra", "Test", "Random"]

src/AppleAccelerate.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ using Libdl
44

55
if Sys.isapple()
66

7-
try
8-
global const libacc = dlopen("/System/Library/Frameworks/Accelerate.framework/Accelerate")
9-
catch
10-
error("Accelerate framework not found.")
11-
end
7+
try
8+
global const libacc = "/System/Library/Frameworks/Accelerate.framework/Accelerate"
9+
let accel_lib = dlopen(libacc)
10+
dlclose(accel_lib)
11+
end
12+
catch
13+
error("Accelerate framework not found.")
14+
end
1215

13-
get_fptr(s) = dlsym(libacc, s)
1416

15-
include("Array.jl")
16-
include("DSP.jl")
17-
include("Util.jl")
17+
include("Array.jl")
18+
include("DSP.jl")
19+
include("Util.jl")
1820

1921
end
2022

0 commit comments

Comments
 (0)