symengine / SymEngine.jl

Julia wrappers of SymEngine
MIT License
192 stars 43 forks source link

Instalation of SymEngine fails under macOS #191

Closed rdguerrerom closed 4 years ago

rdguerrerom commented 4 years ago

As suggested by @Roger-luo I will report this issue here. Background information: I am using macOS Mojave Version 100.14. My version of julia is: (base) ruben@Rubens-MacBook-Pro-2:~$ brew cask info julia julia: 1.3.1 https://julialang.org/ /usr/local/Caskroom/julia/1.3.1 (123B) From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/julia.rb ==> Name Julia ==> Artifacts Julia-1.3.app (App) /Applications/Julia-1.3.app/Contents/Resources/julia/bin/julia (Binary)

In a pristine installation of julia, when I try to install SymEngine I got the following (perhaps compilation?) error message:

(base) ruben@Rubens-MacBook-Pro-2:~$ julia () | Documentation: https://docs.julialang.org () | () () | | | | Type "?" for help, "]?" for Pkg help. | | | | | | |/ ` | | | | || | | | (| | | Version 1.3.1 (2019-12-30) / |_'|||_'_| | Official https://julialang.org/ release |/ |

julia> using Pkg

julia> Pkg.add("SymEngine") Cloning default registries into ~/.julia Cloning registry from "https://github.com/JuliaRegistries/General.git" Added registry General to ~/.julia/registries/General Resolving package versions... Installed Compat ─────────── v3.2.0 Installed RecipesBase ────── v0.7.0 Installed OpenSpecFun_jll ── v0.5.3+1 Installed SymEngine ──────── v0.7.0 Installed BinaryProvider ─── v0.5.8 Installed SpecialFunctions ─ v0.10.0 Updating ~/.julia/environments/v1.3/Project.toml [123dc426] + SymEngine v0.7.0 Updating ~/.julia/environments/v1.3/Manifest.toml [b99e7846] + BinaryProvider v0.5.8 [34da2185] + Compat v3.2.0 [efe28fd5] + OpenSpecFun_jll v0.5.3+1 [3cdcf5f2] + RecipesBase v0.7.0 [276daf66] + SpecialFunctions v0.10.0 [123dc426] + SymEngine v0.7.0 [2a0f44e3] + Base64 [ade2ca70] + Dates [8bb1440f] + DelimitedFiles [8ba89e20] + Distributed [b77e0a4c] + InteractiveUtils [76f85450] + LibGit2 [8f399da3] + Libdl [37e2e46d] + LinearAlgebra [56ddb016] + Logging [d6f4376e] + Markdown [a63ad114] + Mmap [44cfe95a] + Pkg [de0858da] + Printf [3fa0cd96] + REPL [9a3f8284] + Random [ea8e919c] + SHA [9e88b42a] + Serialization [1a1011a3] + SharedArrays [6462fe0b] + Sockets [2f01184e] + SparseArrays [10745b16] + Statistics [8dfed614] + Test [cf7118a7] + UUIDs [4ec0a83e] + Unicode Building SymEngine → ~/.julia/packages/SymEngine/zSUGO/deps/build.log ┌ Error: Error building SymEngine: │ [ Info: Downloading https://github.com/JuliaPackaging/Yggdrasil/releases/download/GMP-v6.1.2-1/build_GMP.v6.1.2.jl to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/build_49205602a6121affc12e2c8039f21fd7fe079f328abaa9294d7cd804ac1769cb.jl... │ [ Info: Downloading https://github.com/JuliaPackaging/Yggdrasil/releases/download/GMP-v6.1.2-1/GMP.v6.1.2.x86_64-apple-darwin14.tar.gz to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/gmp-6.1.2/downloads/GMP.v6.1.2.x86_64-apple-darwin14.tar.gz... │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libgmp.10.dylib │ [ Info: Downloading https://github.com/JuliaPackaging/Yggdrasil/releases/download/MPFR-v4.0.2-0/build_MPFR.v4.0.2.jl to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/build_385b33639b808395e776832ab37708046f9fed2748ab283880371047768cb1d3.jl... │ [ Info: Downloading https://github.com/JuliaPackaging/Yggdrasil/releases/download/MPFR-v4.0.2-0/MPFR.v4.0.2.x86_64-apple-darwin14.tar.gz to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/mpfr-4.0.1/downloads/MPFR.v4.0.2.x86_64-apple-darwin14.tar.gz... │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpfr.6.dylib │ [ Info: Downloading https://github.com/isuruf/MPCBuilder/releases/download/v1.1.0-3/build_MPC.v1.1.0.jl to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/build_c4ab6da81bf9a54e44aa5b8d372979a14af81bde06589c1fcb90521af3a29d2f.jl... │ [ Info: Downloading https://github.com/isuruf/MPCBuilder/releases/download/v1.1.0-3/MPC.v1.1.0.x86_64-apple-darwin14.tar.gz to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/mpc-1.1.0/downloads/MPC.v1.1.0.x86_64-apple-darwin14.tar.gz... │ [ Info: nothing │ [ Info: Downloading https://github.com/symengine/SymEngineBuilder/releases/download/v0.4.0-3/build_SymEngine.v0.4.0.jl to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/build_97348aaf042e3c81b938ac665a0c81e02b5f4e5125d76cedcd2fc3c9dcb182df.jl... │ [ Info: Downloading https://github.com/symengine/SymEngineBuilder/releases/download/v0.4.0-3/SymEngine.v0.4.0.x86_64-apple-darwin14.tar.gz to /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/downloads/symengine-0.4.0/downloads/SymEngine.v0.4.0.x86_64-apple-darwin14.tar.gz... │ [ Info: nothing │ [ Info: Found a valid dl path libgmp.10.dylib while looking for libgmp │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libgmp.10.dylib matches our search criteria of libgmp │ [ Info: Found a valid dl path libgmp.10.dylib while looking for libmpfr │ [ Info: Found a valid dl path libgmp.dylib while looking for libmpfr │ [ Info: Found a valid dl path libgmpxx.4.dylib while looking for libmpfr │ [ Info: Found a valid dl path libgmpxx.dylib while looking for libmpfr │ [ Info: Found a valid dl path libmpc.3.dylib while looking for libmpfr │ [ Info: Found a valid dl path libmpc.dylib while looking for libmpfr │ [ Info: Found a valid dl path libmpfr.6.dylib while looking for libmpfr │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpfr.6.dylib matches our search criteria of libmpfr │ [ Info: Found a valid dl path libgmp.10.dylib while looking for libmpc │ [ Info: Found a valid dl path libgmp.dylib while looking for libmpc │ [ Info: Found a valid dl path libgmpxx.4.dylib while looking for libmpc │ [ Info: Found a valid dl path libgmpxx.dylib while looking for libmpc │ [ Info: Found a valid dl path libmpc.3.dylib while looking for libmpc │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.3.dylib matches our search criteria of libmpc │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.3.dylib cannot be dlopen'ed │ [ Info: Found a valid dl path libmpc.dylib while looking for libmpc │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.dylib matches our search criteria of libmpc │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.dylib cannot be dlopen'ed │ [ Info: Found a valid dl path libmpfr.6.dylib while looking for libmpc │ [ Info: Found a valid dl path libmpfr.dylib while looking for libmpc │ [ Info: Found a valid dl path libsymengine.0.4.0.dylib while looking for libmpc │ [ Info: Found a valid dl path libsymengine.0.4.dylib while looking for libmpc │ [ Info: Found a valid dl path libsymengine.dylib while looking for libmpc │ [ Info: Could not locate libmpc inside /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib │ [ Info: Found a valid dl path libgmp.10.dylib while looking for libsymengine │ [ Info: Found a valid dl path libgmp.dylib while looking for libsymengine │ [ Info: Found a valid dl path libgmpxx.4.dylib while looking for libsymengine │ [ Info: Found a valid dl path libgmpxx.dylib while looking for libsymengine │ [ Info: Found a valid dl path libmpc.3.dylib while looking for libsymengine │ [ Info: Found a valid dl path libmpc.dylib while looking for libsymengine │ [ Info: Found a valid dl path libmpfr.6.dylib while looking for libsymengine │ [ Info: Found a valid dl path libmpfr.dylib while looking for libsymengine │ [ Info: Found a valid dl path libsymengine.0.4.0.dylib while looking for libsymengine │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libsymengine.0.4.0.dylib matches our search criteria of libsymengine │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libsymengine.0.4.0.dylib cannot be dlopen'ed │ [ Info: Found a valid dl path libsymengine.0.4.dylib while looking for libsymengine │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libsymengine.0.4.dylib matches our search criteria of libsymengine │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libsymengine.0.4.dylib cannot be dlopen'ed │ [ Info: Found a valid dl path libsymengine.dylib while looking for libsymengine │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libsymengine.dylib matches our search criteria of libsymengine │ [ Info: /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libsymengine.dylib cannot be dlopen'ed │ [ Info: Could not locate libsymengine inside /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib │ ERROR: LoadError: LibraryProduct("/Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib", ["libmpc"], :libmpc, nothing) is not satisfied, cannot generate deps.jl! │ Stacktrace: │ [1] error(::String) at ./error.jl:33 │ [2] #write_deps_file#152(::Bool, ::typeof(write_deps_file), ::String, ::Array{LibraryProduct,1}) at /Users/ruben/.julia/packages/BinaryProvider/kcGxO/src/Products.jl:414 │ [3] write_deps_file(::String, ::Array{LibraryProduct,1}) at /Users/ruben/.julia/packages/BinaryProvider/kcGxO/src/Products.jl:395 │ [4] top-level scope at /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/build.jl:60 │ [5] include at ./boot.jl:328 [inlined] │ [6] include_relative(::Module, ::String) at ./loading.jl:1105 │ [7] include(::Module, ::String) at ./Base.jl:31 │ [8] include(::String) at ./client.jl:424 │ [9] top-level scope at none:5 │ in expression starting at /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/build.jl:60 [19:24:42] ######################################################################## 100.0% [19:24:45] ######################################################################## 100.0% [19:24:47] ######################################################################## 100.0% [19:24:49] ######################################################################## 100.0% [19:24:50] ######################################################################## 100.0% [19:24:51] ######################################################################## 100.0% [19:24:53] ######################################################################## 100.0% [19:24:56] ######################################################################## 100.0% └ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/backwards_compatibleisolation.jl:649

isuruf commented 4 years ago

Can you do Libdl.dlopen(" /Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.dylib") and see if that gives a better error message?

rdguerrerom commented 4 years ago

Thanks for answering.

Looking at this post Libdl.dlopen is not a command, from another post it seems to be rather a compilation error.

isuruf commented 4 years ago

@rdguerrerom can you send the output of,

using Libdl
Libdl.dlopen("/Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.dylib")
rdguerrerom commented 4 years ago

Yes, the output is:

julia> using Libdl

julia> Libdl.dlopen("/Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.dylib")

ERROR: could not load library "/Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine-0.4/lib/libmpc.dylib" dlopen(/Users/ruben/.julia/packages/SymEngine/zSUGO/deps/libsymengine- 0.4/lib/libmpc.dylib, 1): Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.4.dylib Referenced from: /usr/local/gcc-7.1/lib/libmpc.dylib Reason: image not found Stacktrace: [1] #dlopen#3(::Bool, ::typeof(dlopen), ::String, ::UInt32) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Libdl/src/Libdl.jl:109 [2] dlopen at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)

isuruf commented 4 years ago

Did you compile /usr/local/gcc-7.1/lib/libmpc.dylib yourself? Can you send the output of otool -L /usr/local/gcc-7.1/lib/libmpc.dylib?

rdguerrerom commented 4 years ago

The libmpc comes with gcc, and it was installed using brew. This is the output that you asked for:

(base) ruben@Rubens-MacBook-Pro-2:~$ otool -L /usr/local/gcc-7.1/lib/libmpc.dylib
/usr/local/gcc-7.1/lib/libmpc.dylib:
    /usr/local/gcc-7.1/lib/libmpc.3.dylib (compatibility version 4.0.0, current version 4.0.0)
    /usr/local/opt/mpfr/lib/libmpfr.4.dylib (compatibility version 6.0.0, current version 6.6.0)
    /usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 14.0.0, current version 14.2.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
rdguerrerom commented 4 years ago

Hi Fernando,

Upgrading to the last version of Xcode fix the issues with SymEngine! :)

rdguerrerom commented 4 years ago

Thanks a lot for taking care of this issue!