From: andrew cooke <andrew@...>

Date: Thu, 27 Aug 2015 19:53:03 -0300

I just wasted a few painful hours trying to install the Julia Cairo package. Hopefully the following will help others avoid the frustration. The Cairo package https://github.com/JuliaLang/Cairo.jl uses BinDeps https://github.com/JuliaLang/BinDeps.jl - an easy way to see this is to note that the Cairo package contains a deps directory, which itself contains a build.jl file https://github.com/JuliaLang/Cairo.jl/blob/master/deps/build.jl That build.jl file is the spec that BinDeps uses to decide whether (and how) it should build Cairo from source. Building Cairo from source currently fails. So we don't want to build Cairo from source. Unfortunately, Pkg.add("Cairo") did try to do so. So the question is - WHY DOESN'T IT USE THE CAIRO LIBRARY I HAVE ALREADY INSTALLED ON MY MACHINE? And here is the answer. If you look at the buuld.jl file linked above you'll see a neat, declarative section inside an array called "deps" that specifies what libraries are required. The frustrating thing is, as far as I can tell, ALL LIBRARIES MUST BE PRESENT. If only one is missing, then EVERYTING is built from source. Sorry for the CAPS but I AM FEELING KINDA SHOUTY RIGHT NOW. So, if you're wondering why a package is being built from source, a simple way to find out is to fire up julia: andrew@...:~/.julia/v0.4/Cairo> julia-trunk _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_) | Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.0-dev+6774 (2015-08-17 10:35 UTC) _/ |\__'_|_|_|\__'_| | Commit f3217a8 (10 days old master) |__/ | x86_64-suse-linux and load BinDeps julia> using BinDeps and start BinDeps julia> @BinDeps.setup() library_dependency (generic function with 1 method) and try testing different libraries. Just cut+paste the initial part of each description (ignoring the keyword arguments). This kind of thing is OK: julia> pango = library_dependency("pango", aliases = ["libpango-1.0-0", "libpango-1.0","libpango-1.0.so.0", "libpango-1_0-0"]) - Library "pango" - Satisfied by: - System Paths at /usr/lib64/libpango-1.0.so But this kind of thing is NOT: julia> library_dependency("gettext", aliases = ["libintl", "preloadable_l ibintl", "libgettextpo"]) - Library "gettext" When you get soemthing without a "Satisfied by" then you need to run to your package manager and install it, toot sweet. Note that (unless you are on Windows ha ha) you don't need to check a spec that looks like zlib = library_dependency("zlib", aliases = ["libzlib","zlib1"], os = :Windows, group = group) because the "os = :Windows" means it's only required there. And if you do all that, then clean things up: julia> Pkg.rm("Cairo") $ rm -fr ~/.julia/v0.4/Cairo julia> Pkg.add("Cairo") INFO: Installing Cairo v0.2.29 INFO: Building Cairo INFO: Package database updated everything works :o) Andrew