zyedidia / SFML.jl

A binding of the game and multimedia library SFML for Julia
Other
93 stars 22 forks source link

Build Fails for Linux #38

Open MS07112 opened 7 years ago

MS07112 commented 7 years ago

Hello,

For some reason, the latest version of the SFML package fails to build for Julia v.0.6.0 under an Arch Linux based Manjaro (ver. 17.0.2) operating system on a x_64 bit architecture.

Here is the error output:

_ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_) | Documentation: https://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _ | |
| | || | | | (| | | Version 0.6.0 (2017-06-19 13:05 UTC)
/ |_'|||_'_| |
|__/ | x86_64-pc-linux-gnu

julia>
julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: Upgrading JSON: v0.12.0 => v0.13.0

julia> Pkg.add("SFML")
INFO: Cloning cache of SFML from https://github.com/zyedidia/SFML.jl.git
INFO: Installing SFML v0.2.0
INFO: Building SFML
==================================================================================================[ ERROR: SFML ]==================================================================================================

LoadError: UndefVarError: @windows_only not defined while loading /home/mike/.julia/v0.6/SFML/deps/build.jl, in expression starting on line 1

===================================================================================================================================================================================================================

=================================================================================================[ BUILD ERRORS ]==================================================================================================

WARNING: SFML had build errors.

=================================================================================================================================================================================================================== INFO: Package database updated

julia> `

MS07112 commented 7 years ago

It apparently has to do with the variable @windows_only , which should be neglected/ignored for a Linux operating system.

zyedidia commented 7 years ago

This seems quite related to #37. Unfortunately I haven't been following the changes to Julia in 0.6 so I'm not really sure how to fix this. If you or someone else who knows more about the current state of julia opens a pull request with a fix, I will gladly merge.

MS07112 commented 7 years ago

I have successfully installed the package by first removing the default SFML.jl package, and then using Pkg.clone("SFML") followed by Pkg.build("SFML") on Manjaro Linux. So the fixes to the Master Branch appear to do the trick. I have also successfully tested some of the included SFML examples after this.

It might have had to do with how the OS-specific blocks (like @windows_only) were structured, although that appears to have now been fixed along the master branch.

If things work for the Operating Systems: I'd definitely recommend updating the official Julia Repository for SFML.jl . Thanks!

awf commented 7 years ago

See https://github.com/dhoegh/BuildExecutable.jl/issues/33 I hope to get time to make a PR, but just in case I don't.

benjif commented 7 years ago

Following the same steps as MS07112, I've avoided the "@windows_only" error, but I still see this one:

=======================================[ ERROR: SFML ]=======================================

LoadError: UndefVarError: WORD_SIZE not defined
while loading /home/benji/.julia/v0.6/SFML/deps/build.jl, in expression starting on line 69

=============================================================================================

======================================[ BUILD ERRORS ]=======================================

WARNING: SFML had build errors.

 - packages with build errors remain installed in /home/benji/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("SFML")`
 - build a single package by running its `deps/build.jl` script

=============================================================================================

Running on 32-bit devuan (debian)

zyedidia commented 7 years ago

I'm not able to test because I don't have julia installed at the moment, but maybe replacing WORD_SIZE with Sys.WORD_SIZE would fix the problem (just from a quick look at the docs)?

nro-bot commented 6 years ago

based on https://github.com/zyedidia/sfml-binaries/tree/master/csfml just fix WORD_SIZE to be either 32 or 64.

$ vi /home/nrw/.julia/v0.6/SFML/deps/build.jl
# add near the top
WORD_SIZE=64

aka $ getconf LONG_BIT

however, now I'm stuck on

Could not resolve dependencies:
        libGLEW.so.1.10 => not found
        Something has gone wrong with the SFML installation.
        ErrorException("could not load library \"libsfml-graphics\"\nlibGLEW.so.1.10: cannot open shared object file: No such file or directory")
        ERROR: LoadError: error compiling main: could not load library "libjuliasfml"
        /home/nrw/.julia/v0.6/SFML/src/../deps/libjuliasfml.so: undefined symbol: sfTransform_Identity

UPDATE: well. after a symlink

sudo ln -s /usr/lib/x86_64-linux-gnu/libGLEW.so.1.13 /usr/lib/x86_64-linux-gnu/libGLEW.so.1.10

Now stuck at


ERROR: LoadError: error compiling main: could not load library "libjuliasfml"
/home/nrw/.julia/v0.6/SFML/src/../deps/libjuliasfml.so: undefined symbol: sfTransform_Identity```
scls19fr commented 6 years ago

On my side even after creating symlink I still get the same error

20:34 $ julia --check-bounds=yes -e 'Pkg.build("SFML"); Pkg.test("SFML"; coverage=true)'
INFO: Building SFML
Successfully built SFML.jl!
INFO: Testing SFML
WARNING: Method definition (::Type{SFML.FloatRect})(Float32, Float32, Float32, Float32) in module SFML at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:2 overwritten at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:2.
WARNING: Method definition (::Type{SFML.FloatRect})(Any, Any, Any, Any) in module SFML at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:2 overwritten at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:2.
WARNING: Method definition (::Type{SFML.IntRect})(Int32, Int32, Int32, Int32) in module SFML at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:9 overwritten at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:9.
WARNING: Method definition (::Type{SFML.IntRect})(Any, Any, Any, Any) in module SFML at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:9 overwritten at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:9.
WARNING: Method definition contains(SFML.IntRect, Int64, Int64) in module SFML at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:21 overwritten at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:21.
WARNING: Method definition contains(SFML.FloatRect, Real, Real) in module SFML at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:16 overwritten at /home/scls/.julia/v0.6/SFML/src/julia/Graphics/rect.jl:16.
Could not resolve dependencies:
        libGLEW.so.1.10 => not found
Something has gone wrong with the SFML installation.
ErrorException("could not load library \"libsfml-graphics\"\nlibGLEW.so.1.10: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type")
INFO: SFML tests passe

I wonder if it is not related to https://github.com/zyedidia/SFML.jl/issues/31