@@ -25,7 +25,6 @@ def onnxPlatform := if System.Platform.isOSX then "osx-universal2" else "linux-x
25
25
def onnxFileStem := s! "onnxruntime-{ onnxPlatform} -{ onnxVersion} "
26
26
def onnxFilename := onnxFileStem ++ ".tgz"
27
27
def onnxURL := "https://github.com/microsoft/onnxruntime/releases/download/v1.15.1/" ++ onnxFilename
28
- -- TODO: Support more versions of ONNX Runtime
29
28
30
29
31
30
/- Only support 64-bit Linux or macOS -/
@@ -61,18 +60,21 @@ def getLibPath (name : String) : IO (Option FilePath) := do
61
60
return libPath
62
61
return none
63
62
63
+
64
64
def afterReleaseAsync (pkg : Package) (build : SchedulerM (Job α)) : IndexBuildM (Job α) := do
65
65
if pkg.preferReleaseBuild ∧ pkg.name ≠ (← getRootPackage).name then
66
66
(← pkg.release.fetch).bindAsync fun _ _ => build
67
67
else
68
68
build
69
69
70
+
70
71
def afterReleaseSync (pkg : Package) (build : BuildM α) : IndexBuildM (Job α) := do
71
72
if pkg.preferReleaseBuild ∧ pkg.name ≠ (← getRootPackage).name then
72
73
(← pkg.release.fetch).bindSync fun _ _ => build
73
74
else
74
75
Job.async build
75
76
77
+
76
78
def copyLibJob (pkg : Package) (libName : String) : IndexBuildM (BuildJob FilePath) :=
77
79
afterReleaseSync pkg do
78
80
if !Platform.isOSX then -- Only required for Linux
@@ -158,6 +160,7 @@ target libonnxruntime pkg : FilePath := do
158
160
else
159
161
return (dst, ← computeTrace dst)
160
162
163
+
161
164
def buildCpp (pkg : Package) (path : FilePath) (deps : List (BuildJob FilePath)) : SchedulerM (BuildJob FilePath) := do
162
165
let optLevel := if pkg.buildType == .release then "-O3" else "-O0"
163
166
let mut flags := #["-fPIC" , "-std=c++11" , "-stdlib=libc++" , optLevel]
0 commit comments