Software > Programmieren, Kompilieren

OpenGL unter SunOS 4.x ?

(1/2) > >>

escimo:
Hallo zusammen,

Ich hätte Interesse daran ein bis zwei, klitze-kleine OpenGL-Programme in C auf meiner SPARCstation 2 GX mit SunOS 4.1.x zu zu erstellen (nichts fettes). Da ich aktuell in der SS2 keine 3D-beschleunigende Hardware installiert habe (GS oder GT) muss der GX-Framebuffer her, der mir außer beschleunigte Drahtgitter-Anzeige (Wireframe) keine HW-basierte Beschleunigung bietet. :)

Dazu habe ich von der URL http://www.opengl.org die folgenden Software-Komponenten bezogen:

* GLUT 3.6 Sources
* GLUT 3 Specification
* Examples (dir listing)
* Extra data files for more advanced examples
Nun einige Fragen:
1. Kann ich mit den Sources eine funktionsfähige OpenGL-Bibliothek für SunOS 4.x auf der SPARCstation 2 erzeugen?
2. Hat jemand die Mühe der Übersetzung  unter SunOS 4.x bereits unternommen und hätte Binaries vorliegen die er als Download zur Verfügung stellen könnte?

Ich möchte mir das anschauen und minimales Verständis für einige Möglichkeiten von OpenGL erlangen.

Grüße, escimo

escimo:
Das wird so wahrscheinlich doch net gehen. Nachdem ich das GLUT 3.6 entpackt habe sind folgende Bedingungen zu erfüllen:

README

--- Zitat ---This distribution should compile for:
...
  o  Template Graphics Software's OpenGL for Sun workstations.  (What's that ???)

  o  Mesa 2.x (and 1.x) for Unix workstations, including Linux PCs
     and SunOS 4.1.x.

--- Ende Zitat ---

README.mesa

--- Zitat ---If you want to use GLUT but your system lacks OpenGL, you an obtain the
"freeware" Mesa 3-D graphics library.
--- Ende Zitat ---
Mmmm. Dachte ich mir es doch. So einfach ist es dann auch wieder net. Einen ANSI C-Compiler (acc) hätte ich auf der SPARCstation 2 verfügbar.

http://www.mesa3d.org/install.html
--- Zitat ---Stand-alone/Xlib mode - Mesa will be compiled as a software renderer using Xlib to do all rendering. The libGL.so library will be a self-contained rendering library that will allow you to run OpenGL/GLX applications on any X server (regardless of whether it supports the GLX X server extension). You will not be able to use hardware 3D acceleration.
--- Ende Zitat ---
Akzeptabel!  :D

URL für Bezug der Mesa3D Quellen usw. unter ftp://ftp.freedesktop.org/pub/mesa/older-versions/Mesa-2.2.tar.gz
Es gibt zwar neuere Releases (aktuell: 7.10.3) aber vielleicht ist das mit OpenGL GLUT dann nicht kompatibel. Ich halte mich mit der Release-Auswahl vorerst an die OpenGL GLUT Dokumentation (README).

vab:
Vielleicht kannst Du auf irgendeiner schnellen Maschine unter NetBSD für SunOS 4 crosscompilieren?

Gruß -- Volker

escimo:

--- Zitat von: escimo am 22. September 2011, 22:28:24 ---
--- Zitat ---This distribution should compile for:
...
  o  Template Graphics Software's OpenGL for Sun workstations.  (What's that ???)

--- Ende Zitat ---
...

--- Ende Zitat ---

--- Zitat ---http://www.thefreelibrary.com/TGS+delivers+OpenGL+for+Sun+SPARC%2fSolaris+Systems%3b+demonstrates...-a017128169
LOS ANGELES--(BUSINESS WIRE)--Aug. 7, 1995--(SIGGRAPH) Template Graphics Software Inc. (TGS) Monday announced a one-year cooperative effort with Sun Microsystems Computer Co. (SMCC) that has resulted in OpenGL for Solaris, specially tuned for Sun SPARCstation ZX and TurboZX systems.

OpenGL, licensed by TGS from Silicon Graphics, is a software interface to 3-D graphics hardware. In order to port the product to SPARCstation 3-D graphics workstations, TGS needed access to Sun proprietary information about the ZX and TurboZX boards developed by SMCC. Through close cooperation over the past year between the two companies, TGS was able to successfully port OpenGL to these systems.

OpenGL for Solaris also supports the complete line of SPARCstation GX, GXplus, TGX, TGXplus and SX systems from Sun.

[...]

In the Sun booth (2031) at SIGGRAPH 95 in Los Angeles, SMCC is highlighting a Sun SPARCstation 20ZX, with the TGS OpenGL and Open Inventor products outperforming a Silicon Graphics Indigo2 XZ in a side-by-side demonstration. While performance comparisons are application specific, the demonstration shows that a SPARCstation system can compete in markets where OpenGL and Open Inventor are used.

[...]

"The fact that OpenGL and Open Inventor on a SPARCstation system running Solaris can perform competitively with a comparably priced SGI system clearly shows that Sun delivers more power per dollar for the users than SGI. TGS has done an exceptional job with OpenGL on the ZX family."

[...]
--- Ende Zitat ---
Die proprietäre Software von TGS (Master Suite 3D, OpenGL, OpenInventor) sind im "Ultra Pack Volume II, CD-ROM #6" für Solaris 2.x enthalten, exklusive Lizenz.

TGS (Template Graphics Systems, Inc.) wurde aufgekauft von VSG (Visualization Science Group), die wiederum von FEI (Aug, 2012) aufgekauft wurden.

Soviel dazu.

escimo:
Ich habe mich nun selbst an die Übersetzung von Mesa-2.2 unter SunOS 4.1.4 (Solaris 1.1.2) gewagt:

Verbindung über rlogin zur SS2 hestellen:

--- Code: ---aluma $ rlogin 192.168.60.2
Last login: Thu Dec 20 22:13:13 on console
SunOS Release 4.1.4 (GENERIC) #2: Fri Oct 14 11:08:06 PDT 1994
Type xterm-256color unknown
$ TERM=vt100
$ export TERM
$ echo $TERM
vt100
$ date
Fri Dec 21 01:57:46 MET 2012
$ showrev     
***************  showrev version 1.15  *****************
* Hostname: "toosy"
* Hostid: "554374fa"
* Kernel Arch: "sun4c"
* Application Arch: "sun4"
* Kernel Revision:
  4.1.4 (GENERIC) #2: Fri Oct 14 11:08:06 PDT 1994
* Release: 4.1.4

*******************************************************
$ uname -a
SunOS toosy 4.1.4 2 sun4c
$ echo $SHELL
/bin/sh
$ which acc
/usr/lang/acc
$ which cc
/bin/cc
$ echo $PATH
/bin:/usr/bin:/usr/lang:/usr/ucb:/etc:/usr/etc:/usr/openwin/bin:.
$ echo $LD_LIBRARY_PATH
/usr/lib:/usr/openwin/lib:.

--- Ende Code ---
Gut. Es geht los...

(i) INFO
cc ist der K&R C Compiler, welcher mit SunOS 1/2/3/4 i.d.R. unterhalb /bin mitgeliefert wird, z.B. Sun C 1.0/1.1 (K&R style)
acc ist der ANSI C Compiler (SPARCompiler C 1.x/2.x/3.x), welcher i.d.R. - ggf. mit SPARCworks zusammen - optional angeboten wurde und unterhalb /usr/lang installiert ist

1. Datei README lesen

--- Zitat ---Mesa works on most Unix workstations with ANSI C and X11.

[...]

Toolkits (X11 only):
   Mesa includes the glaux and gltk libraries from SGI.  Their only real
   use is for writing simple demo programs.  It is highly recommended that
   you do _not_ use these libraries for your own programs.  There are
   several alternatives:

      1. GLUT (OpenGL Utility Toolkit) was written by Mark Kilgard of SGI
      as a replacement for glaux and gltk.  It provides a simple, portable,
      window-system independent interface allowing you to write OpenGL
      applications quickly and easily.  GLUT isn't included with Mesa but
      you'll find instructions on how to get and build GLUT in the file
      README.GLUT.  The second edition of the OpenGL Programming Guide,
      published by Addison Wesley uses GLUT instead of the glaux library.

      2. Use an Xt/Motif widget.  Look in the widgets-old/ or widgets-sgi
      directories for more info.

      [...]

--- Ende Zitat ---

2. Datei Makefile auf zu bauende Targets prüfen

--- Zitat ---aix aix-sl amix bsdos debug dgux freebsd gcc hpux hpux-gcc hpux-sl \
irix4 irix5 irix5-dso irix6-32 irix6-n32 irix6-64 irix6-32-dso irix6-n32-dso \
irix6-64-dso linux linux-debug linux-elf linux-alpha machten-2.2 machten-4.0 \
mklinux netbsd next-x86-x11 next-x11 osf1 osf1-sl openbsd qnx sco \
solaris-x86 solaris-x86-gcc sunos4 sunos4-sl sunos4-gcc sunos4-gcc-sl \
sunos5 sunos5-sl sunos5-gcc sunos5-gcc-sl sunos5-x11r6-gcc-sl \
ultrix-gcc unicos unixware vistra:
        -mkdir lib
        touch src/depend
        touch src-glu/depend
        cd src ; $(MAKE) $@
        cd src-glu ; $(MAKE) $@
        cd src-tk ; $(MAKE) $@
        cd src-aux ; $(MAKE) $@
        cd demos ; $(MAKE) $@
        cd samples ; $(MAKE) $@
        cd book ; $(MAKE) $@

--- Ende Zitat ---


3. Datei Make-config auf Einstellungen für die Übersetzung prüfen

--- Zitat ---[...]
sunos4:
        $(MAKE) $(MFLAGS) targets \
        "GL_LIB = libMesaGL.a" \
        "GLU_LIB = libMesaGLU.a" \
        "TK_LIB = libMesatk.a" \
        "AUX_LIB = libMesaaux.a" \
        "CC = acc" \
        "CFLAGS = -O -DSHM -DSUNOS4" \
        "MAKELIB = ar ruv" \
        "RANLIB = ranlib" \
        "XLIBS = -lX11 -lXext"

sunos4-sl:
        $(MAKE) $(MFLAGS) targets \
        "GL_LIB = libMesaGL.so" \
        "GLU_LIB = libMesaGLU.so" \
        "TK_LIB = libMesatk.so" \
        "AUX_LIB = libMesaaux.so" \
        "CC = acc" \
        "CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
        "MAKELIB = ld -assert pure-text -o" \
        "RANLIB = true" \
        "XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"

sunos4-gcc:
[...]

--- Ende Zitat ---

Parameter für Target sunos4-sl prüfen:
"CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
-Kpic
   #PIC (Position Independed Code) with short offsets
   Sun C (SunOS 4.1)  not supported; use "-pic"
   ANSI C (SunOS 4.1) not supported; use "-pic"
   ANSI C (SunOS 5.0) supported => irrelevant für SunOS 4.x
-O
   #Generate optimized code
-I/usr/include/X11R5
   #(-Ix) Add x to include path
   => bei SunOS 4.1.4 unterhalb /usr/openwin/include
-DSHM
-DSUNOS4
   #-Dsymbol[=def] Define symbol to def
"MAKELIB = ld -assert pure-text -o" \
-assert pure-text
   #"-assert" Check an assertion about the link  editing  being  performed.
   #"pure-text" The resulting load has no relocation items remaining in its text.
-o
   #Set name of output file
"RANLIB = true" \
"XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"
-Lx
   #Add x to ld library path   
   $ for f in `find . -name "libX11*" -print` ; do file $f ; done
   ./libX11.sa:    symbolic link to libX11.sa.4.3
   ./libX11.sa.4.3:        archive random library
   ./libX11.so:    symbolic link to libX11.so.4.3
   ./libX11.so.4.3:        sparc demand paged shared library executable not stripped
   ./libX11.a:     archive random library
   ./libX11_p.a:   archive random library
   $ for f in `find . -name "libXext*" -print` ; do file $f ; done
   ./libXext.a:    archive random library
   ./libXext_p.a:  archive random library-lx
   #Read object library x (for ld)
   => bei SunOS 4.1.4 nur X11R4.3 - kein X11R5 dabei (?); X11-/-Extension-Lib liegen unterhalb /usr/openwin/lib


--- Code: ---$ diff Make-config.orig Make-config
638c638
<       "CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
---
>       "CFLAGS = -pic -O -I/usr/openwin/include/X11 -DSHM -DSUNOS4" \
641c641
<       "XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"
---
>       "XLIBS = -L/usr/openwin/lib -lX11 -lXext"

--- Ende Code ---

Welches Target nehmen: sunos4 oder sunos4-sl?

--- Code: ---$ cd Mesa-2.2
$ make | grep -i sun4
make sunos4           for Suns with SunOS 4.x
make sunos4-sl        for Suns with SunOS 4.x, make shared libs
make sunos4-gcc       for Suns with SunOS 4.x and GCC
make sunos4-gcc-sl    for Suns with SunOS 4.x, GCC, make shared libs

--- Ende Code ---

Ich habe mich für sunos4-sl entschieden...und werde nach ca. 5-7 Minuten prompt mit einer Fehlermeldungen über Syntaxfehler sowie eine fehlende X11-Extension überhäuft...

--- Code: ---$ cd src
$ time make sunos4-sl
make  targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -pic -O -I/usr/openwin/include -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext"
acc -c -I../include -pic -O -I/usr/openwin/include -DSHM -DSUNOS4 accum.c
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
[...]
ld -assert pure-text -o libMesaGL.so accum.o alpha.o alphabuf.o api.o attrib.o bitmap.o  blend.o bresenhm.o clip.o context.o copypix.o depth.o  dlist.o draw.o drawpix.o enable.o eval.o feedback.o fog.o  get.o interp.o image.o light.o lines.o logic.o  masking.o matrix.o misc.o pb.o pixel.o points.o pointers.o  polygon.o readpix.o scissor.o span.o stencil.o teximage.o  texobj.o texture.o triangle.o varray.o vb.o vertex.o winpos.o  xform.o cmesa.o glx.o osmesa.o svgamesa.o  xfonts.o xmesa1.o xmesa2.o xmesa3.o
ld: GLOBAL_OFFSET_TABLE overflown: need to use -PIC
*** Error code 4
make: Fatal error: Command failed for target `../lib/libMesaGL.so'
Current working directory /home/sx/opengl/Mesa-2.2/src
*** Error code 1
make: Fatal error: Command failed for target `sunos4-sl'
     1283.6 real      1164.7 user        92.4 sys

--- Ende Code ---

ld: GLOBAL_OFFSET_TABLE overflown: need to use -PIC
Datei Make-config anpassen:

--- Code: ---$ diff Make-config.orig Make-config
638c638
<       "CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
---
>       "CFLAGS = -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4" \
641c641
<       "XLIBS = -L/usr/lib/X11R5 -lX11 -lXext"
---
>       "XLIBS = -L/usr/openwin/lib -lX11 -lXext"
--- Ende Code ---

Übersetzungslauf wiederholen...

--- Code: ---$ date +'%D, %T' ; /usr/5bin/time make sunos4-sl ; date +'%D, %T'
12/22/;2, 02:53:51
mkdir lib
mkdir: lib: File exists
*** Error code 1 (ignored)
touch src/depend
touch src-glu/depend
cd src ; make sunos4-sl
make  targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext"
acc -c -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 accum.c
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
[...]
ld -assert pure-text -o libMesaGL.so accum.o alpha.o alphabuf.o api.o attrib.o bitmap.o  blend.o bresenhm.o clip.o context.o copypix.o depth.o  dlist.o draw.o drawpix.o enable.o eval.o feedback.o fog.o  get.o interp.o image.o light.o lines.o logic.o  masking.o matrix.o misc.o pb.o pixel.o points.o pointers.o  polygon.o readpix.o scissor.o span.o stencil.o teximage.o  texobj.o texture.o triangle.o varray.o vb.o vertex.o winpos.o  xform.o cmesa.o glx.o osmesa.o svgamesa.o  xfonts.o xmesa1.o xmesa2.o xmesa3.o
true libMesaGL.so
mv libMesaGL.so* ../lib
cd src-glu ; make sunos4-sl
[...]
ld -assert pure-text -o libMesaGLU.so glu.o mipmap.o nurbs.o nurbscrv.o nurbssrf.o nurbsutl.o  project.o quadric.o tess.o tesselat.o polytest.o
true libMesaGLU.so
mv libMesaGLU.so* ../lib
cd src-tk ; make sunos4-sl
[...]
ld -assert pure-text -o libMesatk.so cursor.o event.o font.o getset.o image.o shapes.o window.o
true libMesatk.so
mv libMesatk.so* ../lib
cd src-aux ; make sunos4-sl
[...]
ld -assert pure-text -o libMesaaux.so glaux.o font.o image.o shapes.o teapot.o vect3d.o xxform.o
true libMesaaux.so
mv libMesaaux.so* ../lib
cd demos ; make sunos4-sl
make  targets \
"GL_LIB = libMesaGL.so" \
"GLU_LIB = libMesaGLU.so" \
"TK_LIB = libMesatk.so" \
"AUX_LIB = libMesaaux.so" \
"CC = acc" \
"CFLAGS = -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"RANLIB = true" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext"
acc -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 bounce.c -L../lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lm -L/usr/openwin/lib -lX11 -lXext -o bounce
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
ld: -lMesaaux: No such file or directory
*** Error code 4
make: Fatal error: Command failed for target `bounce'
Current working directory /home/sx/opengl/Mesa-2.2/demos
*** Error code 1
make: Fatal error: Command failed for target `sunos4-sl'
Current working directory /home/sx/opengl/Mesa-2.2/demos
*** Error code 1
make: Fatal error: Command failed for target `sunos4-sl'

real    27:01.3
user    23:50.3
sys      2:07.8
12/22/;2, 03:20:53


--- Ende Code ---

acc -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 bounce.c -L../lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lm -L/usr/openwin/lib -lX11 -lXext -o bounce
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
ld: -lMesaaux: No such file or directory
*** Error code 4


--- Code: ---$ echo $LD_LIBRARY_PATH
/usr/lib:/usr/openwin/lib:/home/sx/opengl/Mesa-2.2/lib:.
$ pwd
/home/sx/opengl/Mesa-2.2/lib
$ ls -l
total 1274
lrwxrwxrwx  1 sx             12 Dec 22 03:49 libGL.so -> libMesaGL.so
lrwxrwxrwx  1 sx             13 Dec 22 03:49 libGLU.so -> libMesaGLU.so
-rwxr-xr-x  1 sx         942080 Dec 22 03:16 libMesaGL.so
-rwxr-xr-x  1 sx          98304 Dec 22 03:18 libMesaGLU.so
-rwxr-xr-x  1 sx          49152 Dec 22 03:20 libMesaaux.so
-rwxr-xr-x  1 sx         196608 Dec 22 03:19 libMesatk.so
$ pwd
/home/sx/opengl/Mesa-2.2/demos
$ acc -H -I../include -Xt -PIC -O -I/usr/openwin/include -DSHM -DSUNOS4 bounce.c -L../lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lm -L/usr/openwin/lib -lX11 -lXext -o bounce           
acc: Warning: OS level 4.1.4 not in table -- using 4.1.1 include path
/usr/lang/SC2.0.1/include/cc_411/math.h
        /usr/lang/SC2.0.1/include/cc_411/floatingpoint.h
                /usr/lang/SC2.0.1/include/cc_411/stdio.h
                        /usr/include/sys/stdtypes.h
                /usr/lang/SC2.0.1/include/cc_411/sys/ieeefp.h
        /usr/lang/SC2.0.1/include/cc_411/sunmath.h
                /usr/lang/SC2.0.1/include/cc_411/stdio.h
                /usr/lang/SC2.0.1/include/cc_411/floatingpoint.h
/usr/lang/SC2.0.1/include/cc_411/stdio.h
../include/gltk.h
        ../include/GL/gl.h
        ../include/GL/glu.h
                ../include/GL/gl.h
ld: -lMesaaux: No such file or directory
--- Ende Code ---


Hier komme ich jetzt nicht weiter. Warum findet er die Libs nicht?  ???

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln