From holland at loser.net Sun Nov 5 13:56:05 2006 From: holland at loser.net (Shannon Holland) Date: Sun, 5 Nov 2006 10:56:05 -0800 Subject: [ruby-opengl-devel] Building on Mac OS X Message-ID: <3261712A-2A29-4A32-BC0A-C5B8F452951A@loser.net> I hope this doesn't wind up being too dumb of a question, being quite new to ruby and all, but I'm having difficulties on building ruby- opengl on a Mac OS X 10.4.8 (intel) system. When I run the build.sh script I get: ============================== compiling: ext/gl/gl.c --> ext/gl/gl.o cc -g -Os -pipe -fno-common -pipe -fno-common -pipe -fno-common -I/ usr/lib/ruby/1.8/universal-darwin8.0 F/System/Library/Frameworks -c - o ext/gl/gl.o ext/gl/gl.c ============================== linking ext/gl/gl.bundle cc -bundle -lruby -framework GLUT -framework OpenGL -o ext/gl/ gl.bundle ext/gl/gl.o ext/common/rbogl.o -lGL /usr/bin/ld: can't locate file for: -lGL collect2: ld returned 1 exit status rake aborted! Command failed with status (1): [cc -bundle -lruby -framework GLUT - framewo...] I'm assuming -lGL is referring to the OpenGL library, but won't that have already been handled via the "-framework OpenGL" option? I'm getting a few other build errors as well. The big one being on the link of the glut bundle: cc $(RC_CFLAGS) -bundle -L"/usr/lib/ruby/1.8" -o glut.bundle glut.o -lpthread -ldl -lobjc -framework GLUT is not included, RC_CLFAGS is undefined and -lruby is also not included. Should this all be working on OS X? Might there be something else I needed to have done? Thanks! Shannon From jmg3000 at gmail.com Sun Nov 5 17:38:18 2006 From: jmg3000 at gmail.com (John Gabriele) Date: Sun, 5 Nov 2006 17:38:18 -0500 Subject: [ruby-opengl-devel] Building on Mac OS X In-Reply-To: <3261712A-2A29-4A32-BC0A-C5B8F452951A@loser.net> References: <3261712A-2A29-4A32-BC0A-C5B8F452951A@loser.net> Message-ID: <65e0bb520611051438k653feb0dpebca6ffecf26282e@mail.gmail.com> On 11/5/06, Shannon Holland wrote: > I hope this doesn't wind up being too dumb of a question, being quite > new to ruby and all, but I'm having difficulties on building ruby- > opengl on a Mac OS X 10.4.8 (intel) system. Hi Shannon. > When I run the build.sh script I get: Actually, from the looks of that output, it looks more like your ran "rake" rather than the build.sh script. Note: that build.sh script is just a quick hack to use mkrf for each of the components of ruby-opengl. Incidentally, I believe that (unfortunately) the current *release* of mkrf is broken, so you'd need to grab and install mkrf from svn for it to work correctly with ruby-opengl. > ============================== compiling: ext/gl/gl.c --> ext/gl/gl.o > cc -g -Os -pipe -fno-common -pipe -fno-common -pipe -fno-common -I/ > usr/lib/ruby/1.8/universal-darwin8.0 F/System/Library/Frameworks -c - > o ext/gl/gl.o ext/gl/gl.c > > ============================== linking ext/gl/gl.bundle > cc -bundle -lruby -framework GLUT -framework OpenGL -o ext/gl/ > gl.bundle ext/gl/gl.o ext/common/rbogl.o -lGL > /usr/bin/ld: can't locate file for: -lGL > collect2: ld returned 1 exit status > rake aborted! > Command failed with status (1): [cc -bundle -lruby -framework GLUT - > framewo...] > Ouch. You know what Shannon? I think I broke the top-level Rakefile for Mac OS X a little while back without realizing it (I'm on Debian and Ubuntu GNU/Linux). Anyhow, writing those build commands ourself in that Rakefile is pretty fragile anyway. Keep reading. > I'm assuming -lGL is referring to the OpenGL library, but won't that > have already been handled via the "-framework OpenGL" option? Yes, you're right. > I'm getting a few other build errors as well. [snip] > > Should this all be working on OS X? Might there be something else I > needed to have done? Yeah, it should work for OS X one way or another, but not with the current top-level Rakefile. Please try installing mkrf (http://rubyforge.org/projects/mkrf/) from svn source, and then running the ruby-opengl build.sh script. If that works for you, I'll remove the compiling/linking commands from the top-level Rakefile, since they're currently broken anyway. If anyone else can let us know if the build.sh script + current mkrf (from svn) works on OS X, that would be helpful. Note, further development of ruby-opengl is pretty much stalled at the moment. If anyone wants to get involved either as a developer or admin for ruby-opengl, please let me know. Thanks, ---John From jmg3000 at gmail.com Sun Nov 5 23:30:37 2006 From: jmg3000 at gmail.com (John Gabriele) Date: Sun, 5 Nov 2006 23:30:37 -0500 Subject: [ruby-opengl-devel] Building on Mac OS X In-Reply-To: <1A6A4ACA-B4CC-47A6-9CC0-8F7F1F8C4AB2@loser.net> References: <3261712A-2A29-4A32-BC0A-C5B8F452951A@loser.net> <65e0bb520611051438k653feb0dpebca6ffecf26282e@mail.gmail.com> <1A6A4ACA-B4CC-47A6-9CC0-8F7F1F8C4AB2@loser.net> Message-ID: <65e0bb520611052030g27154277h2aeb61d0956cb216@mail.gmail.com> On 11/5/06, Shannon Holland wrote: > > On Nov 5, 2006, at 2:38 PM, John Gabriele wrote: > > > Yeah, it should work for OS X one way or another, but not with the > > current top-level Rakefile. > > > > Please try installing mkrf (http://rubyforge.org/projects/mkrf/) from > > svn source, and then running the ruby-opengl build.sh script. If that > > works for you, I'll remove the compiling/linking commands from the > > top-level Rakefile, since they're currently broken anyway. > > > [snip] > > "rake gem" got > me a mkrf gem which I could then install. > > But, I'm still failing in the build. running build.sh gets me a bunch > of errors, a top listing of which is: > > Cleaning up previous build products ... > Building common/rbogl.o ... > (in /Users/holland/Source/ruby/ruby-opengl/trunk/ext/common) > cc -c -g -Os -pipe -fno-common -pipe -fno-common -pipe -fno-common - > I/usr/lib/ruby/1.8/universal-darwin8.0 -F/System/Library/Frameworks - > o rbogl.o rbogl.c > > Making Rakefile for gl ... > Building gl ... > (in /Users/holland/Source/ruby/ruby-opengl/trunk/ext/gl) > gcc -fno-common -g -Os -pipe -fno-common -pipe -fno-common -pipe - > fno-common -I/usr/include -I/usr/lib/ruby/1.8/universal-darwin8.0 - > I/usr/lib/ruby/site_ruby/1.8 -I. -c -o gl.o gl.c > cc $(RC_CFLAGS) -bundle -L"/usr/lib/ruby/1.8" -o gl.bundle gl.o ../ > common/rbogl.o -lpthread -ldl -lobjc > sh: line 1: RC_CFLAGS: command not found > /usr/bin/ld: Undefined symbols: > _glAccum > _glAlphaFunc > > > Thanks for your help! Doing a quick search, I see that this has come up before on ruby-talk. It seems that the version of Ruby that comes with OS X has a broken rbconfig.rb. You'll be best off grabbing and installing the most current Ruby. I've got no experience with installing Ruby on OS X. I'm guessing you leave the older one in-place, install the fresh one with the usual incantations (such that it will end up in /usr/local I presume), and then make sure your $PATH is set up such that you always hit the Ruby that you just installed before Apple's. You may have to look around for Apple-specific Ruby install instructions on the net (I'm sure it's come up on ruby-talk in the past). You'll also want to change the shebang line in your scripts from /usr/bin/ruby (?) to wherever you install the current version. *Then* you can install the bleeding-edge mkrf, and then build ruby-opengl. ---John From holland at loser.net Mon Nov 6 13:30:50 2006 From: holland at loser.net (Shannon Holland) Date: Mon, 6 Nov 2006 10:30:50 -0800 Subject: [ruby-opengl-devel] Building on Mac OS X In-Reply-To: <65e0bb520611052030g27154277h2aeb61d0956cb216@mail.gmail.com> References: <3261712A-2A29-4A32-BC0A-C5B8F452951A@loser.net> <65e0bb520611051438k653feb0dpebca6ffecf26282e@mail.gmail.com> <1A6A4ACA-B4CC-47A6-9CC0-8F7F1F8C4AB2@loser.net> <65e0bb520611052030g27154277h2aeb61d0956cb216@mail.gmail.com> Message-ID: <2491EB91-F0C9-4AE0-8351-B16703D98E88@loser.net> On Nov 5, 2006, at 8:30 PM, John Gabriele wrote: > On 11/5/06, Shannon Holland wrote: >> >> On Nov 5, 2006, at 2:38 PM, John Gabriele wrote: >> >> "rake gem" got >> me a mkrf gem which I could then install. >> >> But, I'm still failing in the build. running build.sh gets me a bunch >> of errors, a top listing of which is: >> >> Cleaning up previous build products ... >> Building common/rbogl.o ... >> (in /Users/holland/Source/ruby/ruby-opengl/trunk/ext/common) >> cc -c -g -Os -pipe -fno-common -pipe -fno-common -pipe -fno-common - >> I/usr/lib/ruby/1.8/universal-darwin8.0 -F/System/Library/Frameworks - >> o rbogl.o rbogl.c >> >> Making Rakefile for gl ... >> Building gl ... >> (in /Users/holland/Source/ruby/ruby-opengl/trunk/ext/gl) >> gcc -fno-common -g -Os -pipe -fno-common -pipe -fno-common -pipe - >> fno-common -I/usr/include -I/usr/lib/ruby/1.8/universal-darwin8.0 - >> I/usr/lib/ruby/site_ruby/1.8 -I. -c -o gl.o gl.c >> cc $(RC_CFLAGS) -bundle -L"/usr/lib/ruby/1.8" -o gl.bundle gl.o ../ >> common/rbogl.o -lpthread -ldl -lobjc >> sh: line 1: RC_CFLAGS: command not found >> /usr/bin/ld: Undefined symbols: >> _glAccum >> _glAlphaFunc >> >> >> Thanks for your help! > > Doing a quick search, I see that this has come up before on ruby-talk. > It seems that the version of Ruby that comes with OS X has a broken > rbconfig.rb. You'll be best off grabbing and installing the most > current Ruby. > > I've got no experience with installing Ruby on OS X. I'm guessing you > leave the older one in-place, install the fresh one with the usual > incantations (such that it will end up in /usr/local I presume), and > then make sure your $PATH is set up such that you always hit the Ruby > that you just installed before Apple's. You may have to look around > for Apple-specific Ruby install instructions on the net (I'm sure it's > come up on ruby-talk in the past). > > You'll also want to change the shebang line in your scripts from > /usr/bin/ruby (?) to wherever you install the current version. > > *Then* you can install the bleeding-edge mkrf, and then build ruby- > opengl. OK, thanks for your help John - I will go ahead and try that. I have had to do that before to get rails working, just hadn't done so on this machine yet. Hopefully Apple will get around to fixing it soon! Shannon