3.7-7 "final" VM for Unix

mds reifiedmind at yahoo.co.uk
Mon Mar 21 07:19:55 UTC 2005


Dear Ian,

On 21 Mar 2005, at 02:32, Ian Piumarta wrote:

> Problem 1:
>
> Can you confirm that you are getting a compilation error after 
> 'configure --without-x'?

Yes, an ld error (that's "el-dee" for the sans serif prone like myself, 
writing this in Mail.app!). Output is as follows:

gcc -g -O2 -O3 -mcpu=750 -funroll-loops -o squeak disabledPlugins.o 
version.o -framework CoreFoundation  vm/vm.a 
ADPCMCodecPlugin/ADPCMCodecPlugin.a AsynchFilePlugin/AsynchFilePlugin.a 
B3DAcceleratorPlugin/B3DAcceleratorPlugin.a Squeak3D/Squeak3D.a 
BMPReadWriterPlugin/BMPReadWriterPlugin.a B2DPlugin/B2DPlugin.a 
BitBltPlugin/BitBltPlugin.a DSAPrims/DSAPrims.a ZipPlugin/ZipPlugin.a 
DropPlugin/DropPlugin.a SqueakFFIPrims/SqueakFFIPrims.a 
FFTPlugin/FFTPlugin.a FileCopyPlugin/FileCopyPlugin.a 
FilePlugin/FilePlugin.a FloatArrayPlugin/FloatArrayPlugin.a 
GeniePlugin/GeniePlugin.a JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.a 
JPEGReaderPlugin/JPEGReaderPlugin.a 
JoystickTabletPlugin/JoystickTabletPlugin.a Klatt/Klatt.a 
LargeIntegers/LargeIntegers.a MIDIPlugin/MIDIPlugin.a 
Matrix2x3Plugin/Matrix2x3Plugin.a 
MiscPrimitivePlugin/MiscPrimitivePlugin.a Mpeg3Plugin/Mpeg3Plugin.a 
RePlugin/RePlugin.a SecurityPlugin/SecurityPlugin.a 
SerialPlugin/SerialPlugin.a SocketPlugin/SocketPlugin.a 
SoundCodecPrims/SoundCodecPrims.a 
SoundGenerationPlugin/SoundGenerationPlugin.a SoundPlugin/SoundPlugin.a 
StarSqueakPlugin/StarSqueakPlugin.a SurfacePlugin/SurfacePlugin.a -lm 
vm/vm.a
ld: Undefined symbols:
_glBegin
_glBindTexture
_glBlendFunc
_glClear
_glClearColor
_glColor4d
_glColorMaterial
_glColorPointer
_glDeleteTextures
_glDepthMask
_glDisable
_glDisableClientState
_glDrawArrays
_glDrawElements
_glEnable
_glEnableClientState
_glEnd
_glFinish
_glFlush
_glFogf
_glFogfv
_glFogi
_glFrontFace
_glGenTextures
_glGetError
_glGetIntegerv
_glHint
_glIsEnabled
_glIsTexture
_glLightModeli
_glLightf
_glLightfv
_glLineWidth
_glLoadIdentity
_glLoadMatrixf
_glMaterialf
_glMaterialfv
_glMatrixMode
_glNormalPointer
_glPointSize
_glPolygonMode
_glPopAttrib
_glPopMatrix
_glPushAttrib
_glPushMatrix
_glScaled
_glShadeModel
_glTexCoord2d
_glTexCoordPointer
_glTexEnvi
_glTexImage2D
_glTexParameteri
_glTexSubImage2D
_glTranslated
_glVertex2i
_glVertexPointer
_glViewport
_glClearDepth
_glDepthFunc
_glLightModelfv
make: *** [squeak] Error 1

[more follows below ... keep scrolling ;-)]

> OpenGL should not be required anywhere while building the 'squeak' 
> executable.  The only place that OpenGL should be needed when linking 
> after '--without-x' is to build the Quartz display driver.  For me, 
> the link command to create 'squeak' does not mention X11 or OpenGL at 
> all; the link command to create vm-display-Quartz looks like this:
>
> 	gcc -dynamiclib  -flat_namespace -undefined suppress -o 
> .libs/vm-display-Quartz  sqUnixQuartz.lo  -Wl,-framework -Wl,Cocoa 
> -Wl,-framework -Wl,OpenGL -install_name  
> /usr/local/lib/squeak/3.7-7/vm-display-Quartz
>
> where the '-Wl,-framework -Wl,OpenGL' should be telling the dynamic 
> linker to look in the OpenGL framework for the OpenGL library at 
> runtime.  (The libGL in the X11 distribution is useless if you're 
> running in a Quartz window.)
>
> Problem 2:
>
> You should not have to go to so much trouble to build with X11 
> support.  Even if the auto-detection of your X11 installation is 
> failing (which is what I suspect) the following should be sufficient 
> for a clean compile:
>
> 	configure --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
>
> If you'd like to get to the bottom of this (you and Todd are the only 
> people reporting problems on OS X, and I suspect it's something in 
> your environments) then can you confirm a few things for me?

Sure thing ....

> First is the output while running 'configure'.  If you see a line near 
> the end which says
>
> 	Checking for X... libraries /usr/X11R6/lib, headers

Yes, that's in there.

> then the probable cause is either: (1) you do not have /usr/X11R6/bin 
> in your PATH; or: (2) xmkmf is not working, either because of 
> something in your environment or something in your X11R6 installation.

(1) I've reset that $PATH to include /usr/X11R6/bin, but with the same 
ld linking errors.

Before addressing (2), it's time for a slight tangent (below) ....

> [If] you do get exactly the above output from configure (if not, stop 
> now), and you do have X11R6 in your path (if not, clean up and try 
> again with it in your PATH), then the following steps will identify 
> whether xmkmf is the problem, and if so then what aspect of its 
> operation is not working.

I assume that X11 isn't required for the compilation of a VM utilising 
the Quartz framework (especially in my --without-x example discussed in 
my original post on this thread); therefore, X11's libraries shouldn't 
be required for compilation .

Since I gather from the linker output that my central problem, even 
without that '--without-x' configure request, is the inability of the 
Makefile to locate libGL, and as you mention X11 shouldn't be required 
for Quartz, it seems the problem is less to do with locating X11R6 than 
it is OpenGL. My example short-term hack-fix (quick-and-dirty if you 
like) simply uses the OpenGL libraries located in the X11 tree to 
enable linking. This is less to do with linking in X11 than it is 
OpenGL.

Recognising this, I did another system-wide search for "*GL*". The 
findings include:

/System/Library/Frameworks/OpenGL.framework/OpenGL
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL

Realising another possibility, I this time amended the build/Makefile 
by appending "-framework OpenGL" to the LIBS line. This therefore 
reads:

LIBS=           -lm  -framework CoreFoundation -framework OpenGL

Compilation succeeds without errors, the VM built correctly. Note that 
this is the same line that I amended in the previous post to use the 
X11R6 libGL* libraries. Here, I opt for the more sensible OSX 
frameworks, with the same result - compilation success due to resolved 
linking.

Therefore, I think that it would be more conducive to think of this 
problem without regard to X11 - this might be a bit of a red herring. 
The real 'problem' - or rather, oversight - is providing this framework 
link in the Makefile. Please pardon my temporary postponement of xmkmf 
tests as requested; if after the above you'd still like me to run them, 
I'll be happy to do so.

Hope some of the above helps,
Warm regards,
Marc





More information about the Squeak-dev mailing list