Winston and the dependency of Cairo

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.0) pkg> rm Cairo
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [159f3aea] - Cairo v0.5.6+ #master (https://github.com/JuliaGraphics/Cairo.jl.
git)
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
 [no changes]

(v1.0) pkg> rm Winston
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [bd07be1c] - Winston v0.14.1+ #master (https://github.com/JuliaGraphics/Winsto
n.jl.git)
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
  [e1450e63] - BufferedStreams v1.0.0
  [159f3aea] - Cairo v0.5.6+ #master (https://github.com/JuliaGraphics/Cairo.jl.
git)
  [a2bd30eb] - Graphics v0.4.0
  [4c0ca9eb] - Gtk v0.16.4
  [0862f596] - HTTPClient v0.2.1
  [d9be37ee] - Homebrew v0.7.0
  [b27032c2] - LibCURL v0.4.1
  [522f3ed2] - LibExpat v0.5.0
  [2ec943e9] - Libz v1.0.0
  [c17dfb99] - WinRPM v0.4.2
  [bd07be1c] - Winston v0.14.1+ #master (https://github.com/JuliaGraphics/Winsto
n.jl.git)

(v1.0) pkg> up Pkg
  Updating registry at `C:\Users\hermesr\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
 * Pkg (44cfe95a-1eb2-52ea-b672-e2afdf69b78f in manifest but not in project)
Please specify by known `name=uuid`.

(v1.0) pkg> up
  Updating registry at `C:\Users\hermesr\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaDiffEq/DiffEqTutorials.jl.git`
  Updating git-repo `https://github.com/JuliaApproximation/ApproxFunExamples.git
`
  Updating git-repo `https://github.com/JuliaMatrices/BlockBandedMatrices.jl.git
`
  Updating git-repo `https://github.com/VMLS-book/VMLS.jl`
 Resolving package versions...
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
 [no changes]
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
 [no changes]

(v1.0) pkg> add https://github.com/JuliaGraphics/Winston.jl.git
  Updating git-repo `https://github.com/JuliaGraphics/Winston.jl.git`
 Resolving package versions...
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [bd07be1c] + Winston v0.14.1+ #master (https://github.com/JuliaGraphics/Winsto
n.jl.git)
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
  [e1450e63] + BufferedStreams v1.0.0
  [159f3aea] + Cairo v0.5.6
  [a2bd30eb] + Graphics v0.4.0
  [4c0ca9eb] + Gtk v0.16.4
  [0862f596] + HTTPClient v0.2.1
  [d9be37ee] + Homebrew v0.7.0
  [b27032c2] + LibCURL v0.4.1
  [522f3ed2] + LibExpat v0.5.0
  [2ec943e9] + Libz v1.0.0
  [c17dfb99] + WinRPM v0.4.2
  [bd07be1c] + Winston v0.14.1+ #master (https://github.com/JuliaGraphics/Winsto
n.jl.git)

(v1.0) pkg> update
  Updating registry at `C:\Users\hermesr\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaDiffEq/DiffEqTutorials.jl.git`
  Updating git-repo `https://github.com/JuliaApproximation/ApproxFunExamples.git
`
  Updating git-repo `https://github.com/JuliaMatrices/BlockBandedMatrices.jl.git
`
  Updating git-repo `https://github.com/VMLS-book/VMLS.jl`
  Updating git-repo `https://github.com/JuliaGraphics/Winston.jl.git`
 Resolving package versions...
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
 [no changes]
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
 [no changes]

(v1.0) pkg> using Winston
ERROR: expected command. instead got [using]

julia> using Winston
[ Info: Precompiling Winston [bd07be1c-e76f-5ff0-9c0b-f51ef45303c6]
ERROR: LoadError: Cairo not properly installed. Please run
Pkg.build("Cairo")
Stacktrace:
 [1] error(::String, ::String) at .\error.jl:42
 [2] top-level scope at none:0
 [3] include at .\boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at .\loading.jl:1044
 [5] include(::Module, ::String) at .\sysimg.jl:29
 [6] top-level scope at none:2
 [7] eval at .\boot.jl:319 [inlined]
 [8] eval(::Expr) at .\client.jl:393
 [9] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\Cairo\CXPG1\src\Cairo
.jl:9
ERROR: LoadError: Failed to precompile Cairo [159f3aea-2a34-519c-b102-8c37f98781
75] to C:\Users\hermesr\.julia\compiled\v1.0\Cairo\l6vnT.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] macro expansion at .\logging.jl:311 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
 [4] macro expansion at .\logging.jl:309 [inlined]
 [5] _require(::Base.PkgId) at .\loading.jl:947
 [6] require(::Base.PkgId) at .\loading.jl:858
 [7] macro expansion at .\logging.jl:309 [inlined]
 [8] require(::Module, ::Symbol) at .\loading.jl:840
 [9] include at .\boot.jl:317 [inlined]
 [10] include_relative(::Module, ::String) at .\loading.jl:1044
 [11] include(::Module, ::String) at .\sysimg.jl:29
 [12] top-level scope at none:2
 [13] eval at .\boot.jl:319 [inlined]
 [14] eval(::Expr) at .\client.jl:393
 [15] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\Winston\MTYrd\src\Win
ston.jl:3
ERROR: Failed to precompile Winston [bd07be1c-e76f-5ff0-9c0b-f51ef45303c6] to C:
\Users\hermesr\.julia\compiled\v1.0\Winston\TPedU.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] macro expansion at .\logging.jl:311 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
 [4] macro expansion at .\logging.jl:309 [inlined]
 [5] _require(::Base.PkgId) at .\loading.jl:947
 [6] require(::Base.PkgId) at .\loading.jl:858
 [7] macro expansion at .\logging.jl:309 [inlined]
 [8] require(::Module, ::Symbol) at .\loading.jl:840

julia>

Did you try the suggested Pkg.build("Cairo")?

1 Like

Yes I did it!

And was there an error?

repeat the same error, I must build a package Cairo!!!

Maybe manually delete the folder C:\Users\hermesr\.julia\packages\Cairo\CXPG1, then:



(v1.0) pkg> instantiate
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Installed Cairo ─ v0.5.6
  Building Cairo β†’ `~/.julia/packages/Cairo/CXPG1/deps/build.log`

(v1.0) pkg> ^C

julia> using Winston
[ Info: Precompiling Winston [bd07be1c-e76f-5ff0-9c0b-f51ef45303c6]

?

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.0) pkg> instantiate
  Updating registry at `C:\Users\hermesr\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Installed Cairo ─ v0.5.6
  Building Cairo β†’ `C:\Users\hermesr\.julia\packages\Cairo\CXPG1\deps\build.log`

β”Œ Error: Error building `Cairo`:
β”‚ [ Info: Updating WinRPM package list
β”‚ [ Info: Downloading https://cache.julialang.org/http://download.opensuse.org/r
epositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
β”‚ [ Info: Downloading https://cache.julialang.org/http://download.opensuse.org/r
epositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
β”‚ [ Info: Nothing to do
β”‚ ERROR: LoadError: Provider WinRPM.RPM failed to satisfy dependency cairo
β”‚ Stacktrace:
β”‚  [1] error(::String) at .\error.jl:33
β”‚  [2] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at C:\Users\he
rmesr\.julia\packages\BinDeps\ZEval\src\dependencies.jl:945
β”‚  [3] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at C:\Users\hermesr
\.julia\packages\BinDeps\ZEval\src\dependencies.jl:910
β”‚  [4] satisfy!(::BinDeps.LibraryGroup) at C:\Users\hermesr\.julia\packages\BinD
eps\ZEval\src\dependencies.jl:874
β”‚  [5] top-level scope at C:\Users\hermesr\.julia\packages\BinDeps\ZEval\src\dep
endencies.jl:977
β”‚  [6] include at .\boot.jl:317 [inlined]
β”‚  [7] include_relative(::Module, ::String) at .\loading.jl:1044
β”‚  [8] include(::Module, ::String) at .\sysimg.jl:29
β”‚  [9] include(::String) at .\client.jl:392
β”‚  [10] top-level scope at none:0
β”‚ in expression starting at C:\Users\hermesr\.julia\packages\Cairo\CXPG1\deps\bu
ild.jl:165
β”” @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win32\bu
ild\usr\share\julia\stdlib\v1.0\Pkg\src\Operations.jl:1097

(v1.0) pkg>

Once you get Cairo working (looks like WinRPM is your problem here), Winston looks like it works OK:

It’s always worth restarting your Julia session, in my experience.

Yep looks like WinRPM. Sorry, I can’t help with that.

julia> using WinRPM
ERROR: ArgumentError: Package WinRPM not found in current path:
- Run `import Pkg; Pkg.add("WinRPM")` to install the WinRPM package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:823

julia>

however in the packages directory there is a subdirector with that name

You have to do add WinRPM at the package prompt to make it accessible for using, even if WinRPM was installed automatically as a dependency of something else. The package system distinguishes between β€œinternal” packages installed as a dependency, which are invisible to the user, and packages you manually installed.

1 Like

Manually installed WinRPM:
(v1.0) pkg> add https://github.com/JuliaPackaging/WinRPM.jl.git

And I get the following error:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2 (2018-11-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.0) pkg> add Winston
  Updating registry at `C:\Users\hermesr\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed DiffEqBase ─ v4.31.1
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [bd07be1c] + Winston v0.14.1
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
  [159f3aea] + Cairo v0.5.6
  [2b5f629d] ↑ DiffEqBase v4.31.0 ? v4.31.1
  [a2bd30eb] + Graphics v0.4.0
  [4c0ca9eb] + Gtk v0.16.4
  [d9be37ee] + Homebrew v0.7.0
  [bd07be1c] + Winston v0.14.1
  Building DiffEqBase β†’ `C:\Users\hermesr\.julia\packages\DiffEqBase\HD6bO\deps\
build.log`

(v1.0) pkg> st
    Status `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [28f2ccd6] ApproxFun v0.10.2+ [`C:\Users\hermesr\.julia\dev\ApproxFun`]
  [d9fa014c] ApproxFunExamples v0.1.0 #master (https://github.com/JuliaApproxima
tion/ApproxFunExamples.git)
  [c52e3926] Atom v0.7.10
  [ffab5731] BlockBandedMatrices v0.3.0+ #master (https://github.com/JuliaMatric
es/BlockBandedMatrices.jl.git)
  [717857b8] DSP v0.5.1
  [a93c6f00] DataFrames v0.14.1
  [225cb15b] DiffEqTutorials v0.0.0 #master (https://github.com/JuliaDiffEq/Diff
EqTutorials.jl.git)
  [0c46a032] DifferentialEquations v5.3.1
  [7073ff75] IJulia v1.14.1
  [e5e0dc1b] Juno v0.5.3
  [1902f260] Knet v1.1.1
  [b964fa9f] LaTeXStrings v1.0.3
  [ff71e718] MixedModels v1.1.1
  [5fb14364] OhMyREPL v0.4.0
  [1dea7af3] OrdinaryDiffEq v4.17.2
  [91a5bcdd] Plots v0.21.0
  [438e738f] PyCall v1.18.5
  [d330b81b] PyPlot v2.6.3
  [6f49c342] RCall v0.13.0
  [df47a6cb] RData v0.5.0
  [ce6b1742] RDatasets v0.6.1
  [276daf66] SpecialFunctions v0.7.2
  [44dac47c] VMLS v0.2.0 #master (https://github.com/VMLS-book/VMLS.jl)
  [c17dfb99] WinRPM v0.4.2+ #master (https://github.com/JuliaPackaging/WinRPM.jl
.git)
  [bd07be1c] Winston v0.14.1
  [37e2e46d] LinearAlgebra
  [9a3f8284] Random
  [2f01184e] SparseArrays

julia> using Winston
[ Info: Precompiling Winston [bd07be1c-e76f-5ff0-9c0b-f51ef45303c6]
ERROR: LoadError: Cairo not properly installed. Please run
Pkg.build("Cairo")
Stacktrace:
 [1] error(::String, ::String) at .\error.jl:42
 [2] top-level scope at none:0
 [3] include at .\boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at .\loading.jl:1044
 [5] include(::Module, ::String) at .\sysimg.jl:29
 [6] top-level scope at none:2
 [7] eval at .\boot.jl:319 [inlined]
 [8] eval(::Expr) at .\client.jl:393
 [9] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\Cairo\CXPG1\src\Cairo
.jl:9
ERROR: LoadError: Failed to precompile Cairo [159f3aea-2a34-519c-b102-8c37f98781
75] to C:\Users\hermesr\.julia\compiled\v1.0\Cairo\l6vnT.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] macro expansion at .\logging.jl:311 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
 [4] macro expansion at .\logging.jl:309 [inlined]
 [5] _require(::Base.PkgId) at .\loading.jl:947
 [6] require(::Base.PkgId) at .\loading.jl:858
 [7] macro expansion at .\logging.jl:309 [inlined]
 [8] require(::Module, ::Symbol) at .\loading.jl:840
 [9] include at .\boot.jl:317 [inlined]
 [10] include_relative(::Module, ::String) at .\loading.jl:1044
 [11] include(::Module, ::String) at .\sysimg.jl:29
 [12] top-level scope at none:2
 [13] eval at .\boot.jl:319 [inlined]
 [14] eval(::Expr) at .\client.jl:393
 [15] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\Winston\Nh0fV\src\Win
ston.jl:3
ERROR: Failed to precompile Winston [bd07be1c-e76f-5ff0-9c0b-f51ef45303c6] to C:
\Users\hermesr\.julia\compiled\v1.0\Winston\TPedU.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] macro expansion at .\logging.jl:311 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
 [4] macro expansion at .\logging.jl:309 [inlined]
 [5] _require(::Base.PkgId) at .\loading.jl:947
 [6] require(::Base.PkgId) at .\loading.jl:858
 [7] macro expansion at .\logging.jl:309 [inlined]
 [8] require(::Module, ::Symbol) at .\loading.jl:840

julia>

Hello HerAdri,
Did you ever reach resolution with this problem? I too am stuck building Cairo to get Winston working.

Cairo has been broken for a long while.

The basic problem is that libcairo is a giant and complicated binary dependency, and getting that installed reliably is hard. The ideal would be to use the new BinaryBuilder infrastructure to do this, but that turns out to be tricky because of how Cairo needs to interact with Gtk:

If you are on macOS Mojave, you could try this.

Since that issue was last updated, it did get fixed, I think, but early in March this year it broke again, due to what looks like new dlopen errors for pango and glib (?) and there are some possible workrounds listed in more recent issues on Cairo.jl…

1 Like

Thanks a lot! The approach over at https://github.com/JuliaGraphics/Cairo.jl/issues/271#issuecomment-476827465 seems to be making progress.

Another question, I’m not sure where to ask, but maybe you could provide leads:

Back in the pre-Julia-0.7 era, there was a problem with the Gtk version that Julia used on macOS: Gtk would not open an X-Window on a remote terminal (it only opened it on the desktop terminal). This was a problem for me because I like to used julia remotely via a β€œssh -Y” to get to the command line (and this worked fine in Linux).

I worked around this by modifying the Gtk build to link against my macports Gtk library.

I have not been able to understand how make a similar changes under Julia-1.0.x. Can you point me to the right place to post a query about this, which might get the attention of someone knowledgeable?

SOLVED: Building Cairo (and Winston) with macOS mojave (10.14.4):

(1) Installed Julia-1.1.0 using the dmg from Julialang.org downloads.

(2) using Pkg
Pkg.add(β€œHomebrew”)
using Homebrew
Homebrew.brew(unlink glib)
Homebrew.brew(install --verbose --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/05871cb0394f78ef25a5c1c071456d0f1e4be4fe/Formula/glib.rb)
Pkg.add(β€œCairo”) or Pkg.build(β€œCairo”)
Pkg.add(β€œWinston”)

(3) Success! Simple plots working from Winston displayed in X-Window on the desktop.

2 Likes