Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Gosu on Debian 8 / Jessie
- - By BlueScope Date 2015-08-04 22:14
So, you may remember this thread I made a while ago... never got it to work, kept typing on Windows.

Now there's a new and shiny Debian 8, and all the libsdl packages one could ever want are available (libsdl stuff, as well as all the other listed requirements install just fine)!
I do, however, get a different error (complete output):

---

root@debian:/home/mike# gem install gosu
Building native extensions.  This could take a while...
ERROR:  Error installing gosu:
  ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.1 extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/usr/bin/ruby2.1
  --with-gl-config
  --without-gl-config
  --with-pkg-config
  --without-pkg-config
/usr/lib/ruby/2.1.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
  from /usr/lib/ruby/2.1.0/mkmf.rb:541:in
try_link0'
  from /usr/lib/ruby/2.1.0/mkmf.rb:556:in try_link'
  from /usr/lib/ruby/2.1.0/mkmf.rb:642:in
block in try_ldflags'
  from /usr/lib/ruby/2.1.0/mkmf.rb:635:in with_ldflags'
  from /usr/lib/ruby/2.1.0/mkmf.rb:641:in
try_ldflags'
  from /usr/lib/ruby/2.1.0/mkmf.rb:1762:in pkg_config'
  from extconf.rb:118:in
<main>'

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/gosu-0.9.2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/gosu-0.9.2/gem_make.out


---

Now, Jessie only comes with Ruby 2.1 (and Ruby2.1-dev respectively), and I assume that has something to do with it. I'm just wondering whether there are any configuration options I could use, as well as whether 2.1 is probably not supported at all (though I thought I read somewhere that it'll work with 2.x...)

Any help is, as always, apprechiated :)
Parent - - By jlnr (dev) Date 2015-08-04 23:42
Ruby 2.1 is a fine version :) Every version from 1.8.7 to 2.2.x should work with Gosu.

It sounds as if Ruby wasn't the problem: "The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first."

Have you installed a C++ compiler (usually g++ on the command line)? It should have been part of the build-essential package mentioned in the Getting Started on Linux wiki page.
Parent - - By BlueScope Date 2015-08-05 16:54
All dependencies listed installed fine, using the command provided for the Ubuntu installation (and therefore including build-essential):

# Gosu's dependencies for both C++ and Ruby
sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev


If it helps, here's the content of mkmf.log mentioned in the above post (that I can't do much with, maybe they mean something to you :) )

"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.1.0 -I/usr/include/ruby-2.1.0/ruby/backward -I/usr/include/ruby-2.1.0 -I. -I../.. -I../../src -D_FORTIFY_SOURCE=2   -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED= conftest.c  -L. -L/usr/lib/x86_64-linux-gnu -lGL     -lruby-2.1  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */
Parent - - By jlnr (dev) Date 2015-08-05 17:47
Oh, that sounds like a different error altogether :) The important part is "cannot find -lGL" (=OpenGL)

Can you please check if there is a libGL.so in /usr/lib/x86_64-linux-gnu, or maybe /usr/lib?
Parent - - By BlueScope Date 2015-08-05 19:02
There's a libGL.so in /usr/lib/, along with a few other, similarly named files (such as libGL.so.352.21, which sounds like it's got something to do with the proprietary GeForce drivers that I have installed)

I don't really see a package I could install to "get" OpenGL, and I thought that's what the Mesa package was for in the first place?

I hope you know where to go from here... thanks for the help so far, in any case! :D
Parent - - By jlnr (dev) Date 2015-08-05 19:15
Phew - not sure why it can't find this library?

Gosu is using a tool called pkg-config to find OpenGL, what is the output of pkg-config --libs gl on your machine?
Parent - By BlueScope Date 2015-08-05 19:40
Oh, I glanced over this one - the output is probably what it should be: -lGL
Parent - - By jlnr (dev) Date 2015-08-05 19:17
And another idea: Does gem install opengl work?
Parent - By BlueScope Date 2015-08-05 19:24
No dice - here's the console output:

root@debian:/home/mike# gem install opengl
Fetching: opengl-0.9.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing opengl:
  ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.1 extconf.rb
checking for OpenGL... no
checking for glVertex3d() in -lopengl32.lib... no
checking for main() in -lopengl32... no
checking for glVertex3d() in -lGL... no
checking for GL/glx.h... yes
checking for dlfcn.h... yes
checking for windows.h... no
checking for stdint.h... yes
checking for inttypes.h... yes
checking for wglGetProcAddress() in wingdi.h... no
checking for struct RFloat.float_value... yes
checking for int64_t in stdint.h... yes
checking for uint64_t in stdint.h... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/usr/bin/ruby2.1
  --with-opengl32.liblib
  --without-opengl32.liblib
  --with-opengl32lib
  --without-opengl32lib
  --with-GLlib
  --without-GLlib

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/opengl-0.9.2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/opengl-0.9.2/gem_make.out


And the gem_make.out starts like this (entire mkmf.log):

have_framework: checking for OpenGL... -------------------- no
Parent - - By BlueScope Date 2015-08-05 19:29
I believe this post has the answer to my problem... I believe I skipped that part of the driver installation because it failed for some reason I unfortunately cannot remember, and I figured I won't need it anyway ^^"

I'll have a look into the whole shenanigans... I'd like a solution without re-installing nvidia drivers, but we'll see about that...
Parent - - By BlueScope Date 2015-08-05 21:50 Edited 2015-08-05 23:51
Okay, it was indeed caused by nVidia drivers - I had manually installed the drivers from the webpage (352.21), and during the installation, I got the error that 32bit libraries won't be installed because there's no path given. While re-installing them now (unfortunately the manual way again, as the aptitude package isn't quite ready yet), I set the respective options, and everything installed just fine.

So yeah, Gosu is working, and I can start my games via the console :) Thanks for the help, you helped a great deal!
I also believe it should work right out of the box with nouveau drivers, but unfortunately I just discovered that my laptop's charger is broken, so I'll test that at a later time :/

If you can use it, I can hack a guide about what I did in it's entirety, but here's a quick step-by-step of what made everything nvidia work from a fresh install (note that I use su to log in as root, so no sudo commands):

* Install module-assistant and build-essential: aptitude install module-assistant build-essential
* m-a update, m-a prepare
* download driver from nvidia homepage
* reboot to recovery, login as root
* stop display manager, in my case gdm: /etc/init.d/gdm3 stop
* navigate to driver directory and install driver: sh NVIDIA-Linux-x86_64-352.21.run --compat32-prefix=/usr --compat32-libdir=lib32 --compat32-chroot=/usr/lib32
* reboot
* from here, follow the Getting-Started-on-Linux guide for Ubuntu on the wiki
Parent - By jlnr (dev) Date 2015-08-05 22:50
Great to hear that it works and thanks for the write-up! I've added a link to your posting to the Getting Started on Linux guide.
Up Topic Gosu / Gosu Exchange / Gosu on Debian 8 / Jessie

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill