installing openGL with /private/opt/local/bin

A

anne001

I got opengl to work in the opengl-0.32g folder using the 1.8.2 default
ruby.

Recently, I "removed" ruby 1.8.2 to avoid conflicts (mod-ruby did not
work with it...)
and now I get an error message and a reference to the /usr/lib/ruby
path in the gcc
in mkmf.log, instead of a reference to /private/opt/local/lib

mkmf.log
"gcc -o conftest -I/Users/anne/Desktop/opengl-0.32g
-I/usr/lib/ruby/1.8/univers\
al-darwin8.0 -arch i386 -arch ppc -g -Os -pipe -fno-common -arch i386
-arch pp\
c -pipe -pipe -fno-common -I.
-I/System/Library/Frameworks/OpenGL.framework/Hea\
ders -I/System/Library/Frameworks/GLUT.framework/Headers conftest.c
-L"/usr/li\
b" -lruby-static -llibGL -lpthread -ldl -lobjc -lruby"
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lruby-static
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lruby-static
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccfx7L7n.out (No such file or
directory)

how do I find what line in extconf.rb creates this gcc line, and change
it?
#---extconf.rb
require 'mkmf'

File.unlink('Makefile') if File.exist?('Makefile')
File.unlink('Makefile.ogl') if File.exist?('Makefile.ogl')
File.unlink('Makefile.glut') if File.exist?('Makefile.glut')

$CFLAGS = '-I. -I/System/Library/Frameworks/OpenGL.framework/Headers
-I/System/Library/Frameworks/GLUT.framework/Headers'
$LDFLAGS = '-L/System/Library/Frameworks/OpenGL.framework/Libraries
-framework GLUT -framework Foundation'
Dir.mkdir('GL') unless File.exist?('GL')
File.symlink('/System/Library/Frameworks/OpenGL.framework/Headers/
gl.h', 'GL/gl.h') unless File.exist?('GL/gl.h')
File.symlink('/System/Library/Frameworks/OpenGL.framework/Headers/
glu.h', 'GL/glu.h') unless File.exist?('GL/glu.h')
File.symlink('/System/Library/Frameworks/GLUT.framework/Headers/
glut.h', 'GL/glut.h') unless File.exist?('GL/glut.h')

$objs = ['glu.o', 'ogl.o', 'rbogl.o']
create_makefile("opengl")
File.rename('Makefile', 'Makefile.ogl')

$objs = ['glut.o']
create_makefile("glut")
File.rename('Makefile', 'Makefile.glut')

modules = "glut.#{CONFIG['DLEXT']} opengl.#{CONFIG['DLEXT']}"

open('Makefile', 'w') {|f|
v = $nmake ? '{$(srcdir)}' : ''
f.write <<"MAKEFILE"
SHELL = /bin/sh
srcdir = #{$srcdir}
VPATH = $(srcdir)

all: #{modules}

opengl.#{CONFIG['DLEXT']}: #{v}rbogl.c #{v}ogl.c #{v}glu.c #{v}rbogl.h
@echo Now Making opengl extend module
@$(MAKE) -f Makefile.ogl

glut.#{CONFIG['DLEXT']}: #{v}glut.c
@echo Now Making glut extend module
@$(MAKE) -f Makefile.glut

clean:
@$(MAKE) -f Makefile.ogl clean
@$(MAKE) -f Makefile.glut clean

distclean:
@$(MAKE) -f Makefile.ogl distclean
@$(MAKE) -f Makefile.glut distclean

install: #{modules}
@$(MAKE) -f Makefile.ogl install
@$(MAKE) -f Makefile.glut install

site-install: #{modules}
@$(MAKE) -f Makefile.ogl site-install
@$(MAKE) -f Makefile.glut site-install
MAKEFILE
}
 
A

anne001

I retraced my steps.
I used a fx extconf.rb provided by lazyatom which at the time was
available. I still have a copy.
I followed someone else's advice and copied the gl.h and glu.h from the
opengl framework
and the glut.h from the glut framework into a GL folder

I know I had done that in the succesful compilation, except I had not
copied the file, just linked them and the links are broken, so I can't
be sure I got the exact right file. There are a bunch of glut.h
files... I picked these
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/GLUT.framework/Versions/A/Headers/glut.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/glu.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h

This time make install only has warnings.
ruby sample/robot.rb
dyld: NSLinkModule() error
dyld: Symbol not found: _gluDeleteTess
Referenced from: ./opengl.bundle
Expected in: flat namespace

Trace/BPT trap

trying a different glu.h does not change the error. This is not an
error I met before, with 1.8.2.
Now what!
the glu.h does have such a fx
extern void gluDeleteTess (GLUtesselator* tess);

What do I do?
----------------------------------
alternative
I still have my old opengl folder which runs opengl. But I can only run
the code in the folder.
If the file is in the installation folder, robot.rb works
if the same file is on desktop,
robot2.rb:1:in `require': no such file to load -- opengl (LoadError)

this is what I got with rerunning make install
install -c -p -m 0755 opengl.bundle
/usr/lib/ruby/site_ruby/1.8/universal-darwin8.0
install -c -p -m 0755 glut.bundle
/usr/lib/ruby/site_ruby/1.8/universal-darwin8.0
what could be the problem that it does not find opengl?

I don't think I am very far, but what can I do?
 
A

anne001

I have not figured out how to install opengl with 1.8.4
If you have installed opengl on tiger with 1.8.4, please let me know
how
or if you know what the error message means.

I figured out how to install the one I had made with 1.8.2.
I copied the opengl.bundle and glut.bundle into the opt directory of
1.8.4
on the require path, and that seems to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top