Skip to content

Commit

Permalink
build: add libmxnet.so into lib search list. (#424)
Browse files Browse the repository at this point in the history
In case of macOS, if user build libmxnet from source set MXNET_HOME,
the output is still named as `libmxnet.so`.

Ref: #423
  • Loading branch information
iblislin authored Apr 3, 2018
1 parent 3df1214 commit 0ccf8b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ if haskey(ENV, "MXNET_HOME")
MXNET_HOME = ENV["MXNET_HOME"]
info("MXNET_HOME environment detected: $MXNET_HOME")
info("Trying to load existing libmxnet...")
lib = Libdl.find_library("libmxnet.$(Libdl.dlext)",
# In case of macOS, if user build libmxnet from source and set the MXNET_HOME,
# the output is still named as `libmxnet.so`.
lib = Libdl.find_library(["libmxnet.$(Libdl.dlext)", "libmxnet.so"],
[joinpath(MXNET_HOME, "lib"), MXNET_HOME])
if !isempty(lib)
info("Existing libmxnet detected at $lib, skip building...")
Expand Down
2 changes: 1 addition & 1 deletion src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const grad_req_map = Dict{Symbol,GRAD_REQ}(
################################################################################
# Initialization and library API entrance
################################################################################
const MXNET_LIB = Libdl.find_library("libmxnet.$(Libdl.dlext)",
const MXNET_LIB = Libdl.find_library(["libmxnet.$(Libdl.dlext)", "libmxnet.so"], # see build.jl
[joinpath(get(ENV, "MXNET_HOME", ""), "lib"),
get(ENV, "MXNET_HOME", ""),
Pkg.dir("MXNet", "deps", "usr", "lib")])
Expand Down

0 comments on commit 0ccf8b4

Please sign in to comment.