From be395be3a8e251e8cdd408ae98e07f1b0d788317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 27 Nov 2020 23:50:25 +0000 Subject: [PATCH] Use CRlibm_jll (#41) --- Project.toml | 7 ++++--- deps/build.jl | 27 --------------------------- src/CRlibm.jl | 18 +----------------- 3 files changed, 5 insertions(+), 47 deletions(-) delete mode 100644 deps/build.jl diff --git a/Project.toml b/Project.toml index e0a8c96..d82e354 100644 --- a/Project.toml +++ b/Project.toml @@ -1,12 +1,13 @@ name = "CRlibm" uuid = "96374032-68de-5a5b-8d9e-752f78720389" -version = "0.8.0" +version = "1.0.0" [deps] -Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +CRlibm_jll = "4e9b3aee-d8a1-5a3d-ad8b-7d824db253f0" [compat] -julia = "1" +CRlibm_jll = "1" +julia = "1.3" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index 265a270..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,27 +0,0 @@ -# build.jl modified from the Diercxk.jl package: -# https://github.com/kbarbary/Dierckx.jl/blob/master/deps/build.jl (3-clause BSD license) - -# do it by hand since problem with BinDeps - -if Sys.iswindows() - @warn "On Windows, CRlibm currently just wraps MPFR, and so is slow." - exit(0) -end - -lib_name = "crlibm-1.0beta4" -src_dir = "src" -cd(src_dir) - -run(`tar xzf $(lib_name).tar.gz`) - -#srcdir = "$(src_dir)/$(lib_name)" - -cd(lib_name) -println("Working in ", pwd()) - -suffix = Sys.isapple() ? "dylib" : "so" -run(`./configure --silent CFLAGS='-fpic -w'`) -println("Working in ", pwd()) - -run(`make -s V=0`) -run(`make -s -f ../shared.mk SUFFIX=$suffix V=0`) diff --git a/src/CRlibm.jl b/src/CRlibm.jl index f6e969f..e0befca 100644 --- a/src/CRlibm.jl +++ b/src/CRlibm.jl @@ -1,7 +1,6 @@ -__precompile__(true) module CRlibm -using Libdl +using CRlibm_jll """ setup(use_MPFR=false) @@ -18,16 +17,6 @@ Options: """ function setup(use_MPFR=false) - - # Ensure library is available: - if (Libdl.dlopen_e(libcrlibm) == C_NULL) - @warn("CRlibm is falling back to use MPFR; it will have - the same functionality, but with slower execution. - This is currently the only option on Windows.") - - use_MPFR = true - end - wrap_MPFR() if use_MPFR @@ -167,11 +156,6 @@ const MPFR_function_names = split("""exp expm1 log log1p log2 log10 const MPFR_functions = map(Symbol, MPFR_function_names) - - -unixpath = "../deps/src/crlibm-1.0beta4/libcrlibm" -const libcrlibm = joinpath(dirname(@__FILE__), unixpath) - use_MPFR = setup() end # module