3.7-7 "final" VM for Unix

mds reifiedmind at yahoo.co.uk
Mon Mar 21 17:12:34 UTC 2005


Dear Ian,

As requested, I've regenerated the source tree with the omission of B3D  
plugins and attempted a rebuild.... Indeed, this solved one of the  
problems - the long list of (undefined) OpenGL symbols generated by ld  
has disappeared. However, I am now closer to Todd's original problem  
(in fact, an identical error is generated). The output of make at the  
given point of error is as follows:

-- snip --
/bin/sh  
/Users/mds/squeak/VM/unix-3.7-7/build-21-03-2005-without-b3d/libtool  
--mode=compile gcc -g -O2 -O3 -mcpu=750 -funroll-loops -g -O2 -O3  
-mcpu=750 -funroll-loops -DHAVE_CONFIG_H   
-I/Users/mds/squeak/VM/unix-3.7-7/build-21-03-2005-without-b3d  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/build-21-03-2005-without-b3d  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/plugins/FilePlugin  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/plugins/ 
B3DAcceleratorPlugin  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/plugins/ 
B3DAcceleratorPlugin -I/usr/X11R6/include   -c -o sqUnixX11.lo  
/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm-display-X11/ 
sqUnixX11.c
gcc -g -O2 -O3 -mcpu=750 -funroll-loops -g -O2 -O3 -mcpu=750  
-funroll-loops -DHAVE_CONFIG_H  
-I/Users/mds/squeak/VM/unix-3.7-7/build-21-03-2005-without-b3d  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/build-21-03-2005-without-b3d  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/vm  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/plugins/FilePlugin  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/Cross/plugins/ 
B3DAcceleratorPlugin  
-I/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/plugins/ 
B3DAcceleratorPlugin -I/usr/X11R6/include -c  
/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm-display-X11/ 
sqUnixX11.c  -fno-common -DPIC -DPIC -o sqUnixX11.o
In file included from  
/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm/SqDisplay.h:13,
                  from  
/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/vm-display-X11/ 
sqUnixX11.c:74:
/Users/mds/squeak/VM/unix-3.7-7/platforms/unix/plugins/ 
B3DAcceleratorPlugin/sqUnixOpenGL.h:26:7: #error *** cannot find gl.h
make[1]: *** [sqUnixX11.lo] Error 1
make: *** [vm-display-X11.la] Error 2
-- snip --

So, one portion of the problem has been traced. Another remains.

Bert pointed out that I

> must not build the B3DAcceleratorPlugin internally - this is the one  
> that requires OpenGL (obviously).

I may be wrong here, but it seems that in the above printed error,  
OpenGL is being requested by X11, not just B3D (as in the previous  
post). That is, sqUnixX11.c includes SqDisplay.h:

-- snip --
#undef HAVE_OPENGL_GL_H         /* don't include Quartz OpenGL if  
configured */
#include "SqDisplay.h"
-- snip --

which in its turn calls on OpenGL:

-- snip --
#define SqDisplayVersion        ((SqDisplayVersionMajor << 16) |  
(SqDisplayVersionMinor))

#include "sqUnixOpenGL.h"
-- snip --

Therefore, reconfiguring again, this time including that original  
'--without-x' option, I find that compilation with make succeeds  
completely. To clarify: the VM now no longer includes B3D plugins, so  
one portion of OpenGL dependency is removed. This leaves Todd's  
original problem - that there is no automatic location of OpenGL  
headers for use by X11. When I configure the VM to omit X11 entirely,  
the problem is, naturally therefore, evaded (but not solved of  
course!).

Looking back at the X11 error supplied above, it seems that OpenGL  
headers are being sought in the X11R6/include tree itself, not in the  
GL/ subfolder. The reason for this I am not sure of. The following  
might be of interest:

--
unix-3.7-7/platforms/unix# find . -name "*OpenGL*"
./plugins/B3DAcceleratorPlugin/sqUnixOpenGL.c
./plugins/B3DAcceleratorPlugin/sqUnixOpenGL.h
./plugins/B3DAcceleratorPlugin/zzz/sqUnixOpenGL.OSX
./plugins/B3DAcceleratorPlugin/zzz/sqUnixOpenGL.X11
./vm-display-X11/sqUnixOpenGL.X11
--

B3DAcceleratorPlugin/sqUnixOpenGL.h containing the following preprop.  
logic:

--
# if defined(HAVE_GL_GL_H)
#   include <GL/gl.h>
# else
#   if defined(HAVE_OPENGL_GL_H)
#     include <OpenGL/gl.h>
#   else
#     error *** cannot find gl.h
#   endif
# endif
--

But note the above: HAVE_GL_GL_H has been undefined before the  
inclusion of sqUnixOpenGL.h - the comment being 'don't include Quartz  
OpenGL if configured'. This, however, appears to cause a roadblock for  
X11. Food for thought?


Coming back briefly to Bert's clarification, might I suggest that if  
this is the consensus opinion - that B3D not be built internally to  
avoid linker confusion - VMMakerTool should be updated accordingly,  
disallowing inclusion when 'make all internal' is requested. Since this  
is what I originally did (in order to generate a sort of 'all weather,  
don't bother me about missing plugins' swiss-army knife of a VM!), I'd  
like to think that my request for such an option shouldn't require  
subsequent manual intervention and rummaging for libraries. I doubt  
anyone disagrees with this last point! So here, it seems to be a case  
of removing the option for internal B3D, or ensuring that automation  
finds the requisite libraries? I'm not sure what the consensus is.


Anyway, hopefully some of this has proven useful - I'm not familiar  
enough with the tree to avoid getting lost I'm afraid ...!

Cheers for now,
Warm regards,
Marc


>>>>

On 21 Mar 2005, at 07:42, Ian Piumarta wrote (off list, personal  
correspondence):

> Hi Marc,
>
> Could you try regenerating the source, but this time generate the B3D  
> plugins as external?
>
> Thanks!
>
> Regards,
> Ian
>





More information about the Squeak-dev mailing list