-
-
Notifications
You must be signed in to change notification settings - Fork 100
fix blis dynamic lib name, avoid bli_init output at runtime
#689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |||||||||||
| when defined(blis): | ||||||||||||
| static: echo "--USING BLIS--" | ||||||||||||
| include ./blis_api | ||||||||||||
| echo "Blis initialization status: " & $bli_init() | ||||||||||||
| discard bli_init() | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initialization error silently discarded in all build modes
Consider mirroring the same debug/release pattern already used for
Suggested change
|
||||||||||||
|
|
||||||||||||
| proc quit_blis() {.noconv.}= | ||||||||||||
| when defined(debug): | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,12 +121,19 @@ type | |
|
|
||
| ################################################# | ||
|
|
||
| when defined(windows): | ||
| const blisPrefix = "" | ||
| else: | ||
| const blisPrefix = "lib" | ||
|
|
||
| when defined(windows): | ||
| const blisSuffix = ".dll" | ||
| elif defined(macosx): | ||
| const blisSuffix = ".dylib" | ||
| else: | ||
| const blisSuffix = ".so" #MacOS & Linux | ||
| const blisSuffix = ".so" | ||
|
Comment on lines
+124
to
+134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two |
||
|
|
||
| const libblis = "libblis" & blisSuffix | ||
| const libblis = blisPrefix & "blis" & blisSuffix | ||
|
|
||
| proc bli_init(): BlisError {.importc: "bli_init", dynlib: libblis.} | ||
| proc bli_finalize(): BlisError {.importc: "bli_finalize", dynlib: libblis.} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By discarding the return value of
bli_init(), you are ignoring potential initialization errors. This could lead to silent failures at runtime if BLIS fails to initialize correctly. It's better to check the return code and raise an exception on failure to ensure the library is properly initialized before use.