Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build on Julia 0.7, Windows 7 x64 #265

Closed
RodolfoFigueroa opened this issue Nov 14, 2018 · 17 comments · Fixed by #292
Closed

Failure to build on Julia 0.7, Windows 7 x64 #265

RodolfoFigueroa opened this issue Nov 14, 2018 · 17 comments · Fixed by #292

Comments

@RodolfoFigueroa
Copy link

Cairo refuses to build on julia 0.7.0, running on Windows 7 x86_64-w64-mingw32. This is the package manager output:

(v0.7) pkg> build Cairo
  Building LibCURL ─→ `C:\Users\Rodolfo\.julia\packages\LibCURL\OoXMv\deps\build.log`
  Building WinRPM ──→ `C:\Users\Rodolfo\.julia\packages\WinRPM\Y9QdZ\deps\build.log`
  Building Homebrew → `C:\Users\Rodolfo\.julia\packages\Homebrew\l8kUw\deps\build.log`
  Building Cairo ───→ `C:\Users\Rodolfo\.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/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
│ [ Info: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
│ [ Info: Nothing to do
│ ERROR: LoadError: Provider WinRPM.RPM failed to satisfy dependency pangocairo
│ Stacktrace:
│  [1] error(::String) at .\error.jl:33
│  [2] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at C:\Users\Rodolfo\.julia\packages\BinDeps\ZEval\src\dependencies.jl:945
│  [3] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at C:\Users\Rodolfo\.julia\packages\BinDeps\ZEval\src\dependencies.jl:910
│  [4] satisfy!(::BinDeps.LibraryGroup) at C:\Users\Rodolfo\.julia\packages\BinDeps\ZEval\src\dependencies.jl:874
│  [5] top-level scope at C:\Users\Rodolfo\.julia\packages\BinDeps\ZEval\src\dependencies.jl:977
│  [6] include at .\boot.jl:317 [inlined]
│  [7] include_relative(::Module, ::String) at .\loading.jl:1038
│  [8] include(::Module, ::String) at .\sysimg.jl:29
│  [9] include(::String) at .\client.jl:398
│  [10] top-level scope at none:0
│ in expression starting at C:\Users\Rodolfo\.julia\packages\Cairo\CXPG1\deps\build.jl:165
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:1068

Evaluating with BinDeps.debug() produces the following output:

julia> BinDeps.debug("Cairo")
The package declares 1 dependencies.
 - Library Group "cairo"
     - Library "png" (not applicable to this system)
     - Library "pixman" (not applicable to this system)
     - Library "ffi" (not applicable to this system)
     - Library "gettext" (not applicable to this system)
     - Library "gobject"
        - Satisfied by:
          - WinRPM.RPM package ["glib2", "libgobject-2_0-0"] at C:\Users\Rodolfo\.julia\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libgobject-2.0-0.dll
        - Providers:
          - WinRPM.RPM package ["glib2", "libgobject-2_0-0"]
          - AptGet package libglib2.0-0 (can't provide)
          - Yum package glib2 (can't provide)
          - Zypper package libglib-2_0 (can't provide)
          - Autotools Build
     - Library "freetype" (not applicable to this system)
     - Library "fontconfig" (not applicable to this system)
     - Library "cairo"
        - Satisfied by:
          - WinRPM.RPM package ["libcairo2", "libharfbuzz0"] at C:\Users\Rodolfo\.julia\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libcairo-2.DLL
        - Providers:
          - WinRPM.RPM package ["libcairo2", "libharfbuzz0"]
          - AptGet package libcairo2 (can't provide)
          - Yum package cairo (can't provide)
          - Zypper package libcairo2 (can't provide)
          - Autotools Build
     - Library "pango"
        - Satisfied by:
          - WinRPM.RPM package libpango-1_0-0 at C:\Users\Rodolfo\.julia\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libpango-1.0-0.dll
        - Providers:
          - WinRPM.RPM package libpango-1_0-0
          - AptGet package libpango1.0-0 (can't provide)
          - Yum package pango (can't provide)
          - Zypper package libpango-1_0 (can't provide)
          - Autotools Build
     - Library "pangocairo"
        - Providers:
          - WinRPM.RPM package libpango-1_0-0
          - AptGet package libpango1.0-0 (can't provide)
          - Yum package pango (can't provide)
          - Zypper package libpango-1_0 (can't provide)
          - Autotools Build
     - Library "zlib"
        - Satisfied by:
          - WinRPM.RPM package zlib-devel at C:\Users\Rodolfo\.julia\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\zlib1.DLL
          - System Paths at C:\Users\Rodolfo\AppData\Local\Julia-0.7.0\bin\zlib1.DLL
        - Providers:
          - WinRPM.RPM package zlib-devel
          - Simple Build Process

I am aware of similar issues like #261. However, there are no conflicting directories in the PATH environment variable.

@dawbarton
Copy link

I'm also getting this problem on Win 7 (I've checked the paths as well). Any suggestions as to a workaround?

@lobingera
Copy link
Contributor

Just by looking at this, i get the impression that libpangocairo isn't included in libpango-1_0-0 (anymore).

@lobingera
Copy link
Contributor

@RodolfoFigueroa @dawbarton I restarted yesterday the appveyor testing, and get success for julia 0.7 and latest. So i'm a little bit lost to recreate the failure (i don't have win7 computer available).
Could you please run and report the output.

using WinRPM
WinRPM.search("cairo", "mingw32")
WinRPM.search("pango", mingw32")

@dawbarton
Copy link

Unfortunately I get an error with the WinRPM.search function -

julia> WinRPM.search("cairo", "mingw32")                                                                      
ERROR: UndefVarError: search not defined                                                                      
Stacktrace:                                                                                                   
 [1] xpath_expr(::LibExpat.ETree, ::LibExpat.XPath{String,Array{LibExpat.ETree,1}}, ::Tuple{Symbol,Array{Tuple
{Symbol,Any},1}}, ::Int64, ::Int64, ::DataType) at C:\Julia\Packages\packages\LibExpat\6jLDP\src\xpath.jl:1028
                                                                                                              
 [2] xpath_expr(::LibExpat.ETree, ::LibExpat.XPath{String,Array{LibExpat.ETree,1}}, ::Tuple{Symbol,Tuple{Symbo
l,Tuple{Symbol,Array{Tuple{Symbol,Any},1}},Tuple{Symbol,Array{Tuple{Symbol,Any},1}}}}, ::Int64, ::Int64, ::Dat
aType) at C:\Julia\Packages\packages\LibExpat\6jLDP\src\xpath.jl:893 (repeats 2 times)                        
 [3] xpath(::LibExpat.ETree, ::Symbol, ::LibExpat.XPath{String,Array{LibExpat.ETree,1}}, ::Array{Tuple{Symbol,
Any},1}, ::Int64, ::Array{Int64,1}, ::Int64, ::LibExpat.XPath_Collector, ::Array{LibExpat.ETree,1}) at C:\Juli
a\Packages\packages\LibExpat\6jLDP\src\xpath.jl:1198                                                          
 [4] xpath(::LibExpat.ETree, ::Symbol, ::LibExpat.XPath{String,Array{LibExpat.ETree,1}}, ::Array{Tuple{Symbol,
Any},1}, ::Int64, ::Array{Int64,1}, ::Int64, ::LibExpat.XPath_Collector, ::Array{LibExpat.ETree,1}) at C:\Juli
a\Packages\packages\LibExpat\6jLDP\src\xpath.jl:1278                                                          
 [5] xpath_expr(::LibExpat.ETree, ::LibExpat.XPath{String,Array{LibExpat.ETree,1}}, ::Tuple{Symbol,Array{Tuple
{Symbol,Any},1}}, ::Int64, ::Int64, ::DataType) at C:\Julia\Packages\packages\LibExpat\6jLDP\src\xpath.jl:993 
 [6] xpath(::Array{LibExpat.ETree,1}, ::LibExpat.XPath{String,Array{LibExpat.ETree,1}}) at C:\Julia\Packages\p
ackages\LibExpat\6jLDP\src\xpath.jl:736                                                                       
 [7] getindex at C:\Julia\Packages\packages\LibExpat\6jLDP\src\xpath.jl:1362 [inlined]                        
 [8] Type at C:\Julia\Packages\packages\WinRPM\Y9QdZ\src\WinRPM.jl:209 [inlined]                              
 [9] search(::String, ::String) at C:\Julia\Packages\packages\WinRPM\Y9QdZ\src\WinRPM.jl:284                  
 [10] top-level scope at none:0                                                                               

@dawbarton
Copy link

dawbarton commented Nov 20, 2018

Some extra information (may or may not be useful); after deleting the contents of the WinRPM directory and re-installing I get

(v1.0) pkg> build Cairo
  Building LibCURL ─→ `C:\Julia\Packages\packages\LibCURL\OoXMv\deps\build.log`
  Building WinRPM ──→ `C:\Julia\Packages\packages\WinRPM\Y9QdZ\deps\build.log`
  Building Homebrew → `C:\Julia\Packages\packages\Homebrew\l8kUw\deps\build.log`
  Building Cairo ───→ `C:\Julia\Packages\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/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
│ [ Info: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
│ ┌ Info: Packages to install:
│ └   join(names(todo), ", ") = "libintl8, libglib-2_0-0, glib2-lang, libffi6, libgobject-2_0-0, glib2"
│ ┌ Info: Downloading:
│ └   name = "libintl8"
│ ┌ Info: Extracting:
│ └   name = "libintl8"
│ ┌ Info: Downloading:
│ └   name = "libglib-2_0-0"
│ ┌ Info: Extracting:
│ └   name = "libglib-2_0-0"
│ ┌ Info: Downloading:
│ └   name = "glib2-lang"
│ ┌ Info: Extracting:
│ └   name = "glib2-lang"
│ ┌ Info: Downloading:
│ └   name = "libffi6"
│ ┌ Info: Extracting:
│ └   name = "libffi6"
│ ┌ Info: Downloading:
│ └   name = "libgobject-2_0-0"
│ ┌ Info: Extracting:
│ └   name = "libgobject-2_0-0"
│ ┌ Info: Downloading:
│ └   name = "glib2"
│ ┌ Info: Extracting:
│ └   name = "glib2"
│ [ Info: Complete
│ ┌ Info: Packages to install:
│ └   join(names(todo), ", ") = "libwinpthread1, libxml2-2, zlib1, fontconfig, libpng16-16, libfreetype6, libpixman-1-0, libgcc_s_seh1, libharfbuzz0, libcairo2"
│ ┌ Info: Downloading:
│ └   name = "libwinpthread1"
│ ┌ Info: Extracting:
│ └   name = "libwinpthread1"
│ ┌ Info: Downloading:
│ └   name = "libxml2-2"
│ ┌ Info: Extracting:
│ └   name = "libxml2-2"
│ ┌ Info: Downloading:
│ └   name = "zlib1"
│ ┌ Info: Extracting:
│ └   name = "zlib1"
│ ┌ Info: Downloading:
│ └   name = "fontconfig"
│ ┌ Info: Extracting:
│ └   name = "fontconfig"
│ ┌ Info: Downloading:
│ └   name = "libpng16-16"
│ ┌ Info: Extracting:
│ └   name = "libpng16-16"
│ ┌ Info: Downloading:
│ └   name = "libfreetype6"
│ ┌ Info: Extracting:
│ └   name = "libfreetype6"
│ ┌ Info: Downloading:
│ └   name = "libpixman-1-0"
│ ┌ Info: Extracting:
│ └   name = "libpixman-1-0"
│ ┌ Info: Downloading:
│ └   name = "libgcc_s_seh1"
│ ┌ Info: Extracting:
│ └   name = "libgcc_s_seh1"
│ ┌ Info: Downloading:
│ └   name = "libharfbuzz0"
│ ┌ Info: Extracting:
│ └   name = "libharfbuzz0"
│ ┌ Info: Downloading:
│ └   name = "libcairo2"
│ ┌ Info: Extracting:
│ └   name = "libcairo2"
│ [ Info: Complete
│ ┌ Info: Packages to install:
│ └   join(names(todo), ", ") = "libpango-1_0-0"
│ ┌ Info: Downloading:
│ └   name = "libpango-1_0-0"
│ ┌ Info: Extracting:
│ └   name = "libpango-1_0-0"
│ [ Info: Complete
│ [ Info: Nothing to do
│ ERROR: LoadError: Provider WinRPM.RPM failed to satisfy dependency pangocairo
│ Stacktrace:
│  [1] error(::String) at .\error.jl:33
│  [2] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at C:\Julia\Packages\packages\BinDeps\ZEval\src\dependencies.jl:945
│  [3] satisfy!(::BinDeps.LibraryGroup, ::Array{DataType,1}) at C:\Julia\Packages\packages\BinDeps\ZEval\src\dependencies.jl:910
│  [4] satisfy!(::BinDeps.LibraryGroup) at C:\Julia\Packages\packages\BinDeps\ZEval\src\dependencies.jl:874
│  [5] top-level scope at C:\Julia\Packages\packages\BinDeps\ZEval\src\dependencies.jl:977
│  [6] include at .\boot.jl:317 [inlined]
│  [7] include_relative(::Module, ::String) at .\loading.jl:1041
│  [8] include(::Module, ::String) at .\sysimg.jl:29
│  [9] include(::String) at .\client.jl:388
│  [10] top-level scope at none:0
│ in expression starting at C:\Julia\Packages\packages\Cairo\CXPG1\deps\build.jl:165
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Pkg\src\Operations.jl:1069

Afterwards, libpangocairo-1.0-0.dll appears in the deps/usr/x86_64-w64-mingw32/sys-root/mingw/bin/ directory despite the fact it claims the dependencies aren't satisfied.

@lobingera
Copy link
Contributor

It might make sense to file an issue to https://github.com/JuliaPackaging/WinRPM.jl about this and the non-working search.

If the .dll-s are in place you can still can create manually a deps/deps.jl

lobi@orange4:~/.julia/v0.6/Cairo/deps$ cat deps.jl 
# This is an auto-generated file; do not edit and do not check-in to version control

# Pre-hooks

if VERSION >= v"0.7.0-DEV.3382"
    using Libdl
end
# Macro to load a library
macro checked_lib(libname, path)
    if Libdl.dlopen_e(path) == C_NULL
        error("Unable to load \n\n$libname ($path)\n\nPlease ",
              "re-run Pkg.build(package), and restart Julia.")
    end
    quote
        const $(esc(libname)) = $path
    end
end

# Load dependencies
@checked_lib _jl_libgobject "/usr/lib/x86_64-linux-gnu/libgobject-2.0.so"
@checked_lib _jl_libcairo "/usr/lib/x86_64-linux-gnu/libcairo.so"
@checked_lib _jl_libpango "/usr/lib/x86_64-linux-gnu/libpango-1.0.so"
@checked_lib _jl_libpangocairo "/usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so"

# Load-hooks

@lobingera
Copy link
Contributor

@RodolfoFigueroa @dawbarton
Did you make progress on that?

@arjunae
Copy link

arjunae commented Nov 30, 2018

Hi @lobingera, thanks for that hint. Im a julia new user trying to build cairo. (but on Julia1.02/Win10)
Just tried the above approach with:
WinRPM.install("libpango-1_0-0") WinRPM.install("libcairo-gobject2") (libcairo2)

After that, i just copied the files from WinRPMs deps Folder into an easy to reach Destination:

D:\
Mode LastWriteTime Length Name
-a---- 27.10.2018 00:37 889699 libcairo-2.dll
-a---- 27.10.2018 00:37 30997 libcairo-gobject-2.dll
-a---- 27.10.2018 00:13 301040 libgobject-2.0-0.dll
-a---- 27.10.2018 00:41 260380 libpango-1.0-0.dll

using the following deps:

# Load dependencies
@checked_lib _jl_libgobject "D:\\libgobject-2.0-0.dll"
@checked_lib _jl_libcairo "D:\\libcairo-2.dll"
@checked_lib _jl_libpango "D:\\libpango-1.0-0.dll"
@checked_lib _jl_libpangocairo "D:\\libpangocairo-1.0-0.dll"

currently without success. test Cairo gives:

ERROR: LoadError: LoadError: LoadError: Unable to load _jl_libgobject (D:\libgobject-2.0-0.dll)

Update; Test with plain Libdl.dlopen (downloaded from WinRPM)
libintl-8.dll - OK.
julia> Libdl.dlopen("C:\\Users\\Tho\\Desktop\\libintl-8.dll")
Ptr{Nothing} @0x61ec0000

libcairo-2.dll - baZing-
julia> Libdl.dlopen("C:\\Users\\Tho\\Desktop\\libcairo-2.dll")
ERROR: could not load library "C:\Users\Tho\Desktop\libcairo-2.dll"

This even fails when using libcairo copied from a MSYS mingw32 Inst:
julia> Libdl.dlopen("C:\\Users\\Tho\\Desktop\\msys\\libcairo-2.dll")
ERROR: could not load library "C:\Users\Tho\Desktop\new\libcairo-2.dll"

Hm.. Im unsure where my mistake is at that point.
But it seems to me - we have some sort of Linking Problems here.
On a future rainy day ill trying to compile libcairo locally - but i dont think that will help much...
https://www.cairographics.org/end_to_end_build_for_win32/
Any Ideas are appreciated :)

regards, Thorsten

@lobingera
Copy link
Contributor

I'm not a windows user (somehow at work, but not a developer). The fail of dlopen on libcairo might mean that not all dependencies are fullfilled.

@arjunae
Copy link

arjunae commented Dec 8, 2018

Yo - confirmed - Current MinGW installations switched exception handling to SEH. The binaries found with WinRPM use SJLJ and such have unfilled dependencies.
https://www.gtk.org/download/windows.php recommends to use Binaries fetched via MSYS pacman.
strange - trying to use them with julia also failed -but i didnt search for the exact reason.
Instead i just searched for a prebuild set (gtk+-bundle_3.6.4-20130513_win32.zip) which finally worked for me.

so thanks for the hint - Tho

@saArbabi
Copy link

@arjunae could you please explain what you did with the prebuild set you mentioned? I am having the same issue (on Julia0.6/Windows7) when trying to build Cairo. Below is the error message:

LoadError: Provider WinRPM.RPM failed to satisfy dependency pangocairo
Thanks

@iuliancioarca
Copy link

Hi, @saArbabi! I had the same issue on Julia v1.0.2(JuliaPRO bundle)/Windows 7. I managed to make it work by downloading the "gtk+-bundle_3.6.4-20130513_win32.zip" as @arjunae said (first result on google search) and replacing the files in ".juliapro\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw".
Then I rebuilt everything and it worked.
I actually needed to use Gtk, so I still had some errors. I manually created the "deps/deps.jl" file that @lobingera suggested. Everything works now.
It is strange that I did not encounter any of these issues on a Windows10 machine.
Sorry for not being more specific about the steps, I am a beginner with Julia/programming and the replace-build-create files steps were trial and error.

Thanks again to @lobingera and @arjunae !

@kota-toku
Copy link

@iuliancioarca Hey Iulian, I am having exactly the same problem and am wondering what you mean by "rebuilt everything" at the end?

I download the GTK+ bundle, overwrite all the files in .juliapro\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw

(On my system it is just .julia\packages...), I guess I'm not using julia pro?

Then, I put the deps.jl file in the .julia/v0.6/Cairo/deps directory.

And run e.g. Pkg.build("Cairo"), it still fails with error

LoadError: Provider WinRPM.RPM failed to satisfy dependency pangocairo
while loading C:\Users\tokuoka\.julia\v0.6\Cairo\deps\build.jl, in expression st
arting on line 165

Any help would be appreciated (e.g. what commands you ran exactly...)
Thank you in advance!

@iuliancioarca
Copy link

Hi @kota-toku, I don't remember exactly the steps, but I remember I rebuilt WinRPM, Cairo and Gtk. Please let me know if this solves the problem. If not, I will try to retrace my steps.

@iuliancioarca
Copy link

In the meantime I was forced to reinstall JuliaPRO(v1.0.2) on Win7_64. The steps to fix Cairo/Gtk error are the following:

  • add Gtk -> this will fail building Cairo and Gtk
  • download gtk+-bundle_3.6.4-20130513_win64 (this time I downloaded the win64 version)
  • copy the contents of gtk+-bundle to .juliapro\packages\WinRPM\Y9QdZ\deps\usr\x86_64-w64-mingw32\sys-root\mingw
  • build Gtk
  • using Gtk -> should precompile with some warnings
    Cairo should work as well
  • It seems that deps.jl was not needed.

Best regards,

Iulian

@kota-toku
Copy link

Thanks for the details. I succeeded in building Cairo and Gtk on Julia1.1.0 (not PRO) / Win7.
Thanks again @iuliancioarca !

@rikhuijzer
Copy link

rikhuijzer commented Mar 22, 2019

This thread got ImageView working for me on Windows 10 64-bit with Julia 1.1.0.

I would like to add to this discussion that building takes a while. Building WinRPM and Cairo takes a few minutes (during this ...\deps\build.log is empty).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants