From 4c423df878020c8e91d98c4d376337f5a4f4e540 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Wed, 6 Sep 2017 15:46:58 +0800 Subject: [PATCH] build: more Libdl.dlext --- deps/build.jl | 8 +++++--- src/base.jl | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deps/build.jl b/deps/build.jl index aba540726..d8cbf7eab 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -139,7 +139,7 @@ if !libmxnet_detected _libdir = joinpath(_prefix, "lib") # We have do eagerly delete the installed libmxnet.so # Otherwise we won't rebuild on an update. - run(`rm -f $_libdir/libmxnet.so`) + run(`rm -f $_libdir/libmxnet.$(Libdl.dlext)`) provides(BuildProcess, (@build_steps begin CreateDirectory(_srcdir) @@ -183,8 +183,10 @@ if !libmxnet_detected `make -j$(get_cpucore())` end end - FileRule(joinpath(_libdir, "libmxnet.so"), @build_steps begin - `cp $_mxdir/lib/libmxnet.so $_libdir/` + FileRule(joinpath(_libdir, "libmxnet.$(Libdl.dlext)"), @build_steps begin + # the output file on macos is still in `.so` suffix + # so we rename it + `cp $_mxdir/lib/libmxnet.so $_libdir/libmxnet.$(Libdl.dlext)` end) end end), mxnet, installed_libpath=_libdir) diff --git a/src/base.jl b/src/base.jl index d236aa651..4f004f452 100644 --- a/src/base.jl +++ b/src/base.jl @@ -23,7 +23,7 @@ if isempty(MXNET_LIB) # touch this file, so that after the user properly build libmxnet, the precompiled # MXNet.ji will be re-compiled to get MXNET_LIB properly. touch(@__FILE__) - error("Cannot find or load libmxnet.$(Libdl.dlext)." * + error("Cannot find or load libmxnet.$(Libdl.dlext). " * "Please see the document on how to build it.") else include_dependency(MXNET_LIB)