zyedidia / SFML.jl

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

cannot install SFML on Julia 0.4 #7

Closed mkborregaard closed 6 years ago

mkborregaard commented 8 years ago

Hi, I was curious about the SFML package. I have installed it by Pkg.add("SFML")in the most recent version of julia (pulled and built today from the github 'master' branch). I have then updated all packages.

I now get:

julia> using SFML
Something has gone wrong with the SFML installation.
ErrorException("could not load library \"libsfml-graphics\"\ndlopen(/Users/michael/.julia/SFML/deps/libsfml-graphics.dylib, 9): Library not loaded: @rpath/../Frameworks/freetype.framework/Versions/A/freetype\n  Referenced from: /Users/michael/.julia/SFML/deps/libsfml-graphics.dylib\n  Reason: image not found")

Do I just need to be patient for the release, or am I doing something wrong?

zyedidia commented 8 years ago

Something seems to be going wrong with where it is searching for the deps folder. I would expect it to be in .julia/v0.4/SFML/deps instead of .julia/SFML/deps. I'll try to solve your issue later when I have more time.

mkborregaard commented 8 years ago

The deps folder is at .julia/SFML/deps, and I do have a file with the full path /users/michael/.julia/SFML/deps/libsfml-graphics.dylib. Could there be something wrong with my setup? Perhaps because this is not a nigthly build? Then maybe this will be resolved when there is a 0.4 release to checkout. No rush, just whenever you have a bit of time, I am just playing around with it.

zyedidia commented 8 years ago

Does the file .julia/SFML/deps/freetype.framework/Versions/A/freetype exist? Also, what version of Mac OS X are you using?

One idea for a fix I have is in the file .julia/SFML/src/SFML.jl change lines 28 and 29 from

Libdl.dlopen("freetype.framework/freetype")
Libdl.dlopen("sndfile.framework/sndfile")

to

Libdl.dlopen("freetype.framework/freetype", Libdl.RTLD_GLOBAL)
Libdl.dlopen("sndfile.framework/sndfile", Libdl.RTLD_GLOBAL)

See if that changes anything

mkborregaard commented 8 years ago

That file exists, yes. I am using Mac OS X Yosemite Version 10.10.5. I have modified the lines as you suggested and restarted julia, but using SFML still gives the same error message.

zyedidia commented 8 years ago

If it is not a nightly build, which build of 0.4 is it?

zyedidia commented 8 years ago

Another idea is to make a new folder in .julia/SFML called Frameworks and copy deps/freetype.framework there.

mkborregaard commented 8 years ago

I cloned the julia github repo and built the master branch. The first I did when encountering the issue was to pull again and rebuild. I tried your idea, but it seems to throw the same error:

julia> using SFML
Something has gone wrong with the SFML installation.
ErrorException("could not load library \"libsfml-graphics\"\ndlopen(/Users/michael/.julia/SFML/deps/libsfml-graphics.dylib, 9): Library not loaded: @rpath/../Frameworks/freetype.framework/Versions/A/freetype\n  Referenced from: /Users/michael/.julia/SFML/deps/libsfml-graphics.dylib\n  Reason: image not found")
mkborregaard commented 8 years ago

Hi, I have just installed it successfully on my other laptop, that has the complete same setup - so I guess this is a local issue, and I have closed the issue. I may try uninstalling everything and reinstalling. Thanks a lot!

mkborregaard commented 8 years ago

Just to let you know that on the first machine, removing the SFML package with Pkg.rm("SFML"), then rebuilding julia from the release-0.4 branch, then Pkg.add("SFML"); Pkg.update() did nothing. The package is listed as - SFML 0.0.9 9d1febd0 (dirty) when running Pkg.status().

mkborregaard commented 8 years ago

I am reopening the issue, because there does seem to be a problem. It is interesting that it only happens on my 3-year old rMBP, not on my new one, though they are running the same version of OS X. I have tried (checking in between): 1) changing to release-0.4 and recompiling julia; 2) Doing a hard git reset in the SFML folder; 3) removing the SFML folder completely in Finder; 4) reinstalling SFML with Pkg.add(); 5) removing it with Pkg.rm(); 6) reinstalling it again; 7) running Pgk.update(). Nothing seems to cure the error message. Adding and using other new packages works like a charm. Pkg.status() shows no problems at the moment.

zyedidia commented 8 years ago

See if you keep getting this error if you brew install freetype.

mkborregaard commented 8 years ago

I did not have freetype installed, but installing it from my homebrew did not change the issue - even after removing SFML, quitting and restarting julia, and reinstalling SFML

mkborregaard commented 8 years ago

I do understand you may not be able to solve it from there - maybe just keep the issue open and see if others have the same issue

mweastwood commented 8 years ago

At some point the directory where packages are installed changed from ~/.julia/ to ~/.julia/v0.4. However it used to be that Pkg would seamlessly fall back to the old behavior. I believe this was broken with the transition to using libgit2 in Base.

I would suggest using the @__FILE__ macro instead of Pkg.dir while locating the deps/ directory. I think that would close this issue.

mkborregaard commented 6 years ago

Sorry, just found this issue again after almost three years. I guess it is safe to close :-) Incidentally, is this package still active and usable on julia 1.0?