From 5a80bf361ed130cd7923735d2ad568154ae0e6dc Mon Sep 17 00:00:00 2001 From: Chiyuan Zhang Date: Mon, 26 Oct 2015 19:27:53 -0400 Subject: [PATCH] fix #8, more informative error when libmxnet not found --- src/base.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/base.jl b/src/base.jl index 5e547de727c1..0988400b9d31 100644 --- a/src/base.jl +++ b/src/base.jl @@ -19,6 +19,12 @@ typealias char_pp Ptr{char_p} const MXNET_LIB = Libdl.find_library(["libmxnet.so","libmxnet.dll"], [joinpath("$(get(ENV,"MXNET_HOME",""))","lib"), joinpath(Pkg.dir("MXNet"),"deps/usr/lib")]) +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.so. Please see the document on how to build it.") +end function __init__() _import_ndarray_functions()