[GRASS-dev] Re: [GRASS-user] Problems with OpenGL when compiling grass-6.4.0 on Mac OS X 10.5.4

Elvis,

You can compile GRASS 6.4 with TclTk for X11 for Mac with a bit of tweaking, but I now recommend that you compile it for TclTk 8.5 aqua. You can still have X11 if you need it (e.g., for old GRASS display commands). TclTk 8.5 has finally solved the issues that earlier versions of aqua TclTk had, and both works well and looks nice. All of GRASS, including NVIZ will now run in aqua this way. It uses the native Mac OpenGL instead of the X11 OpenGL. I've worked with William Kyngesbury over the past month or so to work out a formula for doing this. Here is the information.

First, you need TclTk 8.5 aqua. You can compile it from source, but I recently found out that the Active States TclTk binaries will work fine. If you want to compile it from source, however, here are abbreviated instructions.

1) download TclTk 8.5.3 source (or a later version if available)
2) cd into ../tcl8.5.3/unix
3) ./configure --enable-framework --enable-threads
4) make
5) sudo make install
6) cd into ../tk8.5.3/unix
7) ./configure --enable-framework --enable-threads --enable-aqua
8) make
9) sudo make install

Next set up your Mac environment (I'm assuming an intel chip)
1) open a terminal
2) set the following environmental variables (you can leave out -g if you don't want debug enabled)

export CFLAGS="-arch i386 -Os -g"
export LDFLAGS="-arch i386 -Os -g"
export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

Next, configure and make
1) cd into your GRASS source tree folder
2) Here is my configure string. Note: my configure string puts GRASS into /Applications/GRASS; you can change that with the --prefix setting. It also assumes that you have a current installation of MacPython from the python.org site and the most current version of wxPython installed. This is for the new GUI. If you don't want this, leave out the --with-python and --with-wxwidgets flags. Also note that with OS X 10.5 and wxPython 2.8.0 and above, you no longer need to install Python from the python.org site. You can just install wxPython and it will work fine (but you'll have to change the configure flags to reflect this; stuff will be in /usr/bin and /usr/lib instead of /usr/local/bin and /usr/local/lib).

./configure --with-freetype --with-freetype-includes="/Library/Frameworks/FreeType.framework/unix/include/freetype2 /Library/Frameworks/FreeType.framework/unix/include" --with-freetype-libs=/Library/Frameworks/FreeType.framework/unix/lib --with-gdal=/Library/Frameworks/GDAL.framework/Programs/gdal-config --with-proj --with-proj-includes=/Library/Frameworks/PROJ.framework/unix/include --with-proj-libs=/Library/Frameworks/PROJ.framework/unix/lib --with-proj-share=/Library/Frameworks/PROJ.framework/Resources/proj --with-jpeg-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-jpeg-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-png-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-png-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-tiff-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-tiff-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --without-postgres --without-mysql --with-odbc --with-sqlite --with-sqlite-libs=/Library/Frameworks/SQLite3.framework/unix/lib --with-sqlite-includes=/Library/Frameworks/SQLite3.framework/unix/include --with-fftw-includes=/Library/Frameworks/FFTW3.framework/unix/include --with-fftw-libs=/Library/Frameworks/FFTW3.framework/unix/lib --with-x --with-cxx --with-opengl=aqua --without-readline --prefix=/Applications/GRASS --enable-macosx-app --with-python=/usr/local/bin/python-config --with-wxwidgets=/usr/local/lib/wxPython-unicode-2.8.8.1/bin/wx-config --with-tcltk-includes="/Library/Frameworks/Tcl.framework/Headers /Library/Frameworks/Tk.framework/Headers /Library/Frameworks/Tk.framework/PrivateHeaders"

3) run make

Finally, make some final adjustments for aqua and install GRASS. Do this AFTER running make

1) In the GRASS source tree, edit the tcltklibs line in ../include/make/platform.make

It will read...

TCLTKLIBS = -Tcl -Tk

Change it to read...

TCLTKLIBS = -framework Tcl -framework Tk

2) run sudo make install

Let us know how it goes
Michael

On Sep 20, 2008, at 11:09 AM, <grass-user-request@lists.osgeo.org> wrote:

Message: 1
Date: Sat, 20 Sep 2008 21:08:34 +0400
From: Elvis Dowson <elvis.dowson@mac.com>
Subject: [GRASS-user] Problems with OpenGL when compiling grass-6.4.0
  on Mac OS X 10.5.4
To: GRASS User <grass-user@lists.osgeo.org>
Message-ID: <6B34E8FB-908F-4933-8D4C-5EE0D152545D@mac.com>
Content-Type: text/plain; charset="us-ascii"

Hi,
         I just downloaded the latest svn snapshot of grass-6.4.0,
installed all the required libraries
proj-4.6.0
gdal-1.5.2
libjpeg-6b
libtiff-3.8.2
libpng-1.2.31
fftw-2.1.5

and fixed the X11 OpenGL problem on Mac OS X 10.5.4 as outlined below:

X11 is broken on Leopard, it is impossible to compile programs against
it (more precisely whenever libGL is touched - directly or
indirectly). The easiest way to fix it is as follows:

cd /usr/X11/lib
sudo bash
# enter your password
mv libGL.dylib libGL.dylib.apple
ln -s /System/Library/Frameworks/OpenGL.framework/Libraries/
libGL.dylib .

This fixed the problem of ./configure being able to locate the OpenGL
libraries.

However, when I try to make the program, I get more errors related to
OpenGL.

On Sep 21, 2008, at 10:21 AM, John C. Tull wrote:

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
make: *** [/Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_ogsf.6.4.svn.dylib] Error 1

Thanks,
John

This is a problem with Xcode 3.0. You need to upgrade to Xcode 3.1.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole. Now what does that remind me of? Ah, yes - life."

- Marvin

On Sep 22, 2008, at 5:13 PM, John C. Tull wrote:

On Sep 21, 2008, at 8:29 AM, William Kyngesburye wrote:

On Sep 21, 2008, at 10:21 AM, John C. Tull wrote:

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
make: *** [/Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_ogsf.6.4.svn.dylib] Error 1

Thanks,
John

This is a problem with Xcode 3.0. You need to upgrade to Xcode 3.1.

Thanks. I did not see that XCode was up to 3.1.1 as of a week and a half ago.

John

Xcode is one that doesn't show up at VersionTracker, and I don't check Apple's dev site very often. Did you have 3.1, then, or 3.0? 3.1 came out in July (and earlier as the iphone SDK beta).

Hmmm, the "what's new" isn't very helpful. I hope they fixed an annoying packagemaker bug...

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole. Now what does that remind me of? Ah, yes - life."

- Marvin

Hi Michael,
                  Thanks for the reply.

Could you please tell me what I should do to make it work with X11? I am not
planning to use TclTk. I am planning to use vtk-5.2.0 and Qt-4.4.1.

What I need to do is to link grass-6.4.0 or 7.0.0 with X11 and then get it
to work inside vtk-5.2.0. I will then try to use the QVTK plug in to create
a vtkRenderingContext using Qt.

So far, I have managed to get vtk-5.2.0 and qt-4.4.1 compiled and running.

I just have been stuck with getting any version of grass to compile on Mac
OS X 10.5.4 using Xcode-3.1.1.

Could you please help?

Thanks !

Best regards,

Elvis Dowson

Michael Barton wrote:

Elvis,

You can compile GRASS 6.4 with TclTk for X11 for Mac with a bit of
tweaking, but I now recommend that you compile it for TclTk 8.5 aqua.
You can still have X11 if you need it (e.g., for old GRASS display
commands).

--
View this message in context: http://www.nabble.com/Re%3A-Problems-with-OpenGL-when-compiling-grass-6.4.0-on-Mac OS-X-10.5.4-tp19588719p19591956.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Michael,
                 Here is a copy of the specific error message that I am
getting

  (cd /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.4.0/lib; ln -f -s
libgrass_nviz.6.4.svn.dylib
/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.dylib)
Undefined symbols:
  "_glXCreateGLXPixmap", referenced from:
      _Nviz_create_render_window in render.o
  "_XOpenDisplay", referenced from:
      _Nviz_create_render_window in render.o
  "_glXDestroyGLXPixmap", referenced from:
      _Nviz_destroy_render_window in render.o
  "_XFreePixmap", referenced from:
      _Nviz_destroy_render_window in render.o
  "_XCreatePixmap", referenced from:
      _Nviz_create_render_window in render.o
  "_glXGetCurrentContext", referenced from:
      _Nviz_make_current_render_window in render.o
  "_XFree", referenced from:
      _Nviz_create_render_window in render.o
  "_glXMakeCurrent", referenced from:
      _Nviz_make_current_render_window in render.o
  "_glXDestroyContext", referenced from:
      _Nviz_destroy_render_window in render.o
  "_glXChooseVisual", referenced from:
      _Nviz_create_render_window in render.o
  "_glXCreateContext", referenced from:
      _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: ***
[/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.6.4.svn.dylib]
Error 1

Best regards,

Elvis

Elvis Dowson wrote:

Could you please tell me what I should do to make it work with X11? I am
not planning to use TclTk. I am planning to use vtk-5.2.0 and Qt-4.4.1.

--
View this message in context: http://www.nabble.com/Re%3A-Problems-with-OpenGL-when-compiling-grass-6.4.0-on-Mac OS-X-10.5.4-tp19588719p19592064.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Michael,
                 I have three copies of libGL.dylib. They are in the
following folders:
/usr/X11/lib
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/System/Library/Frameworks/OpenGL.framework/Libraries/Libraries

Which is the correct one?

I suppose if I give the following ./configure commands, I can select a
specific one a link time?

./configure --with-cxx --prefix=/Applications --enable-macosx-appcd
--with-opengl-libs=/usr/X11/lib --with-opengl-includes=/usr/X11/include

./configure --with-cxx --prefix=/Applications --enable-macosx-appcd
--with-opengl-libs=/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
--with-opengl-includes=/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers

./configure --with-cxx --prefix=/Applications --enable-macosx-appcd
--with-opengl-libs=/System/Library/Frameworks/OpenGL.framework/Libraries/Libraries
--with-opengl-includes=/System/Library/Frameworks/OpenGL.framework/Libraries/Headers

Best regards,

Elvis Dowson
--
View this message in context: http://www.nabble.com/Re%3A-Problems-with-OpenGL-when-compiling-grass-6.4.0-on-Mac OS-X-10.5.4-tp19588719p19592217.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Sep 20, 2008, at 1:15 PM, Michael Barton wrote:

Elvis,

You can compile GRASS 6.4 with TclTk for X11 for Mac with a bit of tweaking, but I now recommend that you compile it for TclTk 8.5 aqua. You can still have X11 if you need it (e.g., for old GRASS display commands). TclTk 8.5 has finally solved the issues that earlier versions of aqua TclTk had, and both works well and looks nice. All of GRASS, including NVIZ will now run in aqua this way. It uses the native Mac OpenGL instead of the X11 OpenGL. I've worked with William Kyngesbury over the past month or so to work out a formula for doing this. Here is the information.

First, you need TclTk 8.5 aqua. You can compile it from source, but I recently found out that the Active States TclTk binaries will work fine. If you want to compile it from source, however, here are abbreviated instructions.

1) download TclTk 8.5.3 source (or a later version if available)
2) cd into ../tcl8.5.3/unix
3) ./configure --enable-framework --enable-threads
4) make
5) sudo make install
6) cd into ../tk8.5.3/unix
7) ./configure --enable-framework --enable-threads --enable-aqua
8) make
9) sudo make install

Next set up your Mac environment (I'm assuming an intel chip)
1) open a terminal
2) set the following environmental variables (you can leave out -g if you don't want debug enabled)

export CFLAGS="-arch i386 -Os -g"
export LDFLAGS="-arch i386 -Os -g"
export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

Next, configure and make
1) cd into your GRASS source tree folder
2) Here is my configure string. Note: my configure string puts GRASS into /Applications/GRASS; you can change that with the --prefix setting. It also assumes that you have a current installation of MacPython from the python.org site and the most current version of wxPython installed. This is for the new GUI. If you don't want this, leave out the --with-python and --with-wxwidgets flags. Also note that with OS X 10.5 and wxPython 2.8.0 and above, you no longer need to install Python from the python.org site. You can just install wxPython and it will work fine (but you'll have to change the configure flags to reflect this; stuff will be in /usr/bin and /usr/lib instead of /usr/local/bin and /usr/local/lib).

./configure --with-freetype --with-freetype-includes="/Library/Frameworks/FreeType.framework/unix/include/freetype2 /Library/Frameworks/FreeType.framework/unix/include" --with-freetype-libs=/Library/Frameworks/FreeType.framework/unix/lib --with-gdal=/Library/Frameworks/GDAL.framework/Programs/gdal-config --with-proj --with-proj-includes=/Library/Frameworks/PROJ.framework/unix/include --with-proj-libs=/Library/Frameworks/PROJ.framework/unix/lib --with-proj-share=/Library/Frameworks/PROJ.framework/Resources/proj --with-jpeg-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-jpeg-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-png-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-png-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-tiff-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-tiff-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --without-postgres --without-mysql --with-odbc --with-sqlite --with-sqlite-libs=/Library/Frameworks/SQLite3.framework/unix/lib --with-sqlite-includes=/Library/Frameworks/SQLite3.framework/unix/include --with-fftw-includes=/Library/Frameworks/FFTW3.framework/unix/include --with-fftw-libs=/Library/Frameworks/FFTW3.framework/unix/lib --with-x --with-cxx --with-opengl=aqua --without-readline --prefix=/Applications/GRASS --enable-macosx-app --with-python=/usr/local/bin/python-config --with-wxwidgets=/usr/local/lib/wxPython-unicode-2.8.8.1/bin/wx-config --with-tcltk-includes="/Library/Frameworks/Tcl.framework/Headers /Library/Frameworks/Tk.framework/Headers /Library/Frameworks/Tk.framework/PrivateHeaders"

3) run make

Finally, make some final adjustments for aqua and install GRASS. Do this AFTER running make

1) In the GRASS source tree, edit the tcltklibs line in ../include/make/platform.make

It will read...

TCLTKLIBS = -Tcl -Tk

Change it to read...

TCLTKLIBS = -framework Tcl -framework Tk

2) run sudo make install

Let us know how it goes
Michael

This is a great set of instructions. Nonetheless, an opengl error does arise for me:

Started compilation: Sun Sep 21 08:04:55 PDT 2008
--
Errors in:
/Users/jctull/sources/grass6.4.0/lib/ogsf
/Users/jctull/sources/grass6.4.0/lib/nviz
/Users/jctull/sources/grass6.4.0/gui/wxpython/nviz
/Users/jctull/sources/grass6.4.0/imagery/i.atcorr
/Users/jctull/sources/grass6.4.0/visualization/nviz2/cmd
/Users/jctull/sources/grass6.4.0/visualization/nviz
--
In case of errors please change into the directory with error and run 'make'.
If you get multiple errors, you need to deal with them in the order they
appear in the error log. If you get an error building a library, you will
also get errors from anything which uses the library.
--
Finished compilation: Sun Sep 21 08:12:37 PDT 2008
make: *** [default] Error 1

And from the ogsf lib directory, running make shows:

cc -dynamiclib -compatibility_version 6.4 -current_version 6.4 -install_name /Applications/GRASS-6.4.app/Contents/MacOS/lib/libgrass_ogsf.dylib -o /Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_ogsf.6.4.svn.dylib -L/Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib -arch i386 -Os -g -arch i386 -Os -g -L/usr/local/pgsql/lib OBJ.i386-apple-darwin9.5.0/GK2.o OBJ.i386-apple-darwin9.5.0/GP2.o OBJ.i386-apple-darwin9.5.0/GS2.o OBJ.i386-apple-darwin9.5.0/GSX.o OBJ.i386-apple-darwin9.5.0/GS_util.o OBJ.i386-apple-darwin9.5.0/GV2.o OBJ.i386-apple-darwin9.5.0/GVL2.o OBJ.i386-apple-darwin9.5.0/Gp3.o OBJ.i386-apple-darwin9.5.0/Gs3.o OBJ.i386-apple-darwin9.5.0/Gv3.o OBJ.i386-apple-darwin9.5.0/Gvl3.o OBJ.i386-apple-darwin9.5.0/gk.o OBJ.i386-apple-darwin9.5.0/gp.o OBJ.i386-apple-darwin9.5.0/gpd.o OBJ.i386-apple-darwin9.5.0/gs.o OBJ.i386-apple-darwin9.5.0/gs_bm.o OBJ.i386-apple-darwin9.5.0/gs_norms.o OBJ.i386-apple-darwin9.5.0/gs_query.o OBJ.i386-apple-darwin9.5.0/gsd_cplane.o OBJ.i386-apple-darwin9.5.0/gsd_fonts.o OBJ.i386-apple-darwin9.5.0/gsd_fringe.o OBJ.i386-apple-darwin9.5.0/gsd_img_mpeg.o OBJ.i386-apple-darwin9.5.0/gsd_img_ppm.o OBJ.i386-apple-darwin9.5.0/gsd_img_tif.o OBJ.i386-apple-darwin9.5.0/gsd_label.o OBJ.i386-apple-darwin9.5.0/gsd_legend.o OBJ.i386-apple-darwin9.5.0/gsd_objs.o OBJ.i386-apple-darwin9.5.0/gsd_prim.o OBJ.i386-apple-darwin9.5.0/gsd_surf.o OBJ.i386-apple-darwin9.5.0/gsd_views.o OBJ.i386-apple-darwin9.5.0/gsd_wire.o OBJ.i386-apple-darwin9.5.0/gsdiff.o OBJ.i386-apple-darwin9.5.0/gsdrape.o OBJ.i386-apple-darwin9.5.0/gsds.o OBJ.i386-apple-darwin9.5.0/gsget.o OBJ.i386-apple-darwin9.5.0/gv.o OBJ.i386-apple-darwin9.5.0/gv_quick.o OBJ.i386-apple-darwin9.5.0/gvd.o OBJ.i386-apple-darwin9.5.0/gvl.o OBJ.i386-apple-darwin9.5.0/gvl_calc.o OBJ.i386-apple-darwin9.5.0/gvl_calc2.o OBJ.i386-apple-darwin9.5.0/gvl_file.o OBJ.i386-apple-darwin9.5.0/gvld.o OBJ.i386-apple-darwin9.5.0/trans.o -lgrass_gis -lgrass_datetime -lz -lgrass_bitmap -lgrass_linkm -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/Library/Frameworks/GDAL.framework/Versions/1.5/unix/lib -lgdal -L/usr/X11/lib -framework OpenGL -framework AGL -framework ApplicationServices -L/Library/Frameworks/UnixImageIO.framework/unix/lib -ltiff -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_g3d -lgrass_gis -lgrass_datetime -lz && \
  (cd /Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib; ln -f -s libgrass_ogsf.6.4.svn.dylib /Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_ogsf.dylib)
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
make: *** [/Users/jctull/sources/grass6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_ogsf.6.4.svn.dylib] Error 1

Thanks,
John

On Sep 21, 2008, at 1:23 AM, Elvis Dowson wrote:

Hi Michael,
                 Thanks for the reply.

Could you please tell me what I should do to make it work with X11? I am not
planning to use TclTk. I am planning to use vtk-5.2.0 and Qt-4.4.1.

What I need to do is to link grass-6.4.0 or 7.0.0 with X11 and then get it
to work inside vtk-5.2.0. I will then try to use the QVTK plug in to create
a vtkRenderingContext using Qt.

Just a note: the TclTk GUI may be dropped in GRASS 7.

So far, I have managed to get vtk-5.2.0 and qt-4.4.1 compiled and running.

I just have been stuck with getting any version of grass to compile on Mac
OS X 10.5.4 using Xcode-3.1.1.

Hmm, it should work without any patching.

X11 is broken on Leopard, it is impossible to compile programs against it (more precisely whenever libGL is touched - directly or indirectly). The easiest way to fix it is as follows:

cd /usr/X11/lib
sudo bash
# enter your password
mv libGL.dylib libGL.dylib.apple
ln -s /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib .

This fixed the problem of ./configure being able to locate the OpenGL libraries.

I don't know where you came up with this - X11/OpenGL has always worked (with the exception of the broken linker in Xcode 3.0 which is fixed in 3.1).

What is your configure command? Some things are supposed to be automatically detected, but being explicit can help. See the macosx/readme in the source for an example (much like Michael's configure). Sometimes you may need to give the OpenGL or X11 configure options some help.

It's possible something is broken or misconfigured in your system. I hate to ask, but do you have Fink or MacPorts installed? These add to your shell PATH and may do other shell configurations that can silently cause trouble.

                I have three copies of libGL.dylib. They are in the
following folders:
/usr/X11/lib
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/System/Library/Frameworks/OpenGL.framework/Libraries/Libraries

Which is the correct one?

For X11, the X11 copy. The one in the SDK is just a duplicate of the system framework, and will be used automatically if you use the -isysroot flag. And in the end, X11 OpenGL gets much of its low-lewel functionality from the system framework. With disabling the X11 OpenGL and symlinking the framework, as you did at the start, you lose the X11-specific functions, like glX.

So, I'd say you should restore the original X11 OpenGL library, then figure out why configure can't find it. For configure errors, look in config.log for more detail why a test failed.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

Hi William,
                      Here is how my PATH looks like
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/qt-4.4.1/bin

that's it. It's a new installation. The only thing that I modified was to create that new symbolic link, but I just deleted it.

Do you know if glXCreatePbuffer(); is available or defined in Mac OS X 10.5.4?

Best regards,

Elvis

On Sep 21, 2008, at 7:58 PM, William Kyngesburye wrote:

On Sep 21, 2008, at 1:23 AM, Elvis Dowson wrote:

Hi Michael,
                Thanks for the reply.

Could you please tell me what I should do to make it work with X11? I am not
planning to use TclTk. I am planning to use vtk-5.2.0 and Qt-4.4.1.

What I need to do is to link grass-6.4.0 or 7.0.0 with X11 and then get it
to work inside vtk-5.2.0. I will then try to use the QVTK plug in to create
a vtkRenderingContext using Qt.

Just a note: the TclTk GUI may be dropped in GRASS 7.

So far, I have managed to get vtk-5.2.0 and qt-4.4.1 compiled and running.

I just have been stuck with getting any version of grass to compile on Mac
OS X 10.5.4 using Xcode-3.1.1.

Hmm, it should work without any patching.

X11 is broken on Leopard, it is impossible to compile programs against it (more precisely whenever libGL is touched - directly or indirectly). The easiest way to fix it is as follows:

cd /usr/X11/lib
sudo bash
# enter your password
mv libGL.dylib libGL.dylib.apple
ln -s /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib .

This fixed the problem of ./configure being able to locate the OpenGL libraries.

I don't know where you came up with this - X11/OpenGL has always worked (with the exception of the broken linker in Xcode 3.0 which is fixed in 3.1).

What is your configure command? Some things are supposed to be automatically detected, but being explicit can help. See the macosx/readme in the source for an example (much like Michael's configure). Sometimes you may need to give the OpenGL or X11 configure options some help.

It's possible something is broken or misconfigured in your system. I hate to ask, but do you have Fink or MacPorts installed? These add to your shell PATH and may do other shell configurations that can silently cause trouble.

               I have three copies of libGL.dylib. They are in the
following folders:
/usr/X11/lib
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/System/Library/Frameworks/OpenGL.framework/Libraries/Libraries

Which is the correct one?

For X11, the X11 copy. The one in the SDK is just a duplicate of the system framework, and will be used automatically if you use the -isysroot flag. And in the end, X11 OpenGL gets much of its low-lewel functionality from the system framework. With disabling the X11 OpenGL and symlinking the framework, as you did at the start, you lose the X11-specific functions, like glX.

So, I'd say you should restore the original X11 OpenGL library, then figure out why configure can't find it. For configure errors, look in config.log for more detail why a test failed.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

Hi William,
                        Upon looking more closely at the config.log

configure:11340: gcc -o conftest -g -O2 conftest.c -lGL 1>&5
ld: library not found for -lGL
collect2: ld returned 1 exit status
configure: failed program was:

I see that ld could not find the GL libraries for some reason.

However, I have put this in my .profile. The location I have put is usr/X11/lib . Is this the correct location?

# environment variables
export QTROOT=/usr/local/qt-4.4.1
export GRASS_TCLSH=/usr/X11R6/bin/tclsh
export GRASS_WISH=/usr/X11R6/bin/wish
export VTK_DIR=/Users/elvis/Tool/vtk-5.2.0/src
export VTK_LIB_DIR=/usr/local/lib/vtk-5.2
export X11_LIB_DIR=/usr/X11/lib
#export OPENGL_LIB_DIR=/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries

# the path is initially set to "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
export PATH=$PATH:$QTROOT/bin
export LD_LIBRARY_PATH=$VTK_LIB_DIR:$X11_LIB_DIR:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$VTK_LIB_DIR:$X11_LIB_DIR:$DYLD_LIBRARY_PATH

Best regards,

Elvis Dowson

On Sep 21, 2008, at 7:58 PM, William Kyngesburye wrote:

On Sep 21, 2008, at 1:23 AM, Elvis Dowson wrote:

Hi Michael,
                Thanks for the reply.

Could you please tell me what I should do to make it work with X11? I am not
planning to use TclTk. I am planning to use vtk-5.2.0 and Qt-4.4.1.

What I need to do is to link grass-6.4.0 or 7.0.0 with X11 and then get it
to work inside vtk-5.2.0. I will then try to use the QVTK plug in to create
a vtkRenderingContext using Qt.

Just a note: the TclTk GUI may be dropped in GRASS 7.

So far, I have managed to get vtk-5.2.0 and qt-4.4.1 compiled and running.

I just have been stuck with getting any version of grass to compile on Mac
OS X 10.5.4 using Xcode-3.1.1.

Hmm, it should work without any patching.

X11 is broken on Leopard, it is impossible to compile programs against it (more precisely whenever libGL is touched - directly or indirectly). The easiest way to fix it is as follows:

cd /usr/X11/lib
sudo bash
# enter your password
mv libGL.dylib libGL.dylib.apple
ln -s /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib .

This fixed the problem of ./configure being able to locate the OpenGL libraries.

I don't know where you came up with this - X11/OpenGL has always worked (with the exception of the broken linker in Xcode 3.0 which is fixed in 3.1).

What is your configure command? Some things are supposed to be automatically detected, but being explicit can help. See the macosx/readme in the source for an example (much like Michael's configure). Sometimes you may need to give the OpenGL or X11 configure options some help.

It's possible something is broken or misconfigured in your system. I hate to ask, but do you have Fink or MacPorts installed? These add to your shell PATH and may do other shell configurations that can silently cause trouble.

               I have three copies of libGL.dylib. They are in the
following folders:
/usr/X11/lib
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/System/Library/Frameworks/OpenGL.framework/Libraries/Libraries

Which is the correct one?

For X11, the X11 copy. The one in the SDK is just a duplicate of the system framework, and will be used automatically if you use the -isysroot flag. And in the end, X11 OpenGL gets much of its low-lewel functionality from the system framework. With disabling the X11 OpenGL and symlinking the framework, as you did at the start, you lose the X11-specific functions, like glX.

So, I'd say you should restore the original X11 OpenGL library, then figure out why configure can't find it. For configure errors, look in config.log for more detail why a test failed.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

On Sep 21, 2008, at 12:20 PM, Elvis Dowson wrote:

Hi William,
                      Upon looking more closely at the config.log

configure:11340: gcc -o conftest -g -O2 conftest.c -lGL 1>&5
ld: library not found for -lGL
collect2: ld returned 1 exit status
configure: failed program was:

I see that ld could not find the GL libraries for some reason.

One thing to watch out for is the -g flag. This causes configure errors with the latest Xcode. export CFLAGS and CXXFLAGS with -Os before configuring.

export CFLAGS=-Os
export CXXFLAGS=-Os

If you need debug symbols, add -g back into platform.make after configuration (to CFLAGS1 & CXXFLAGS1).

However, I have put this in my .profile. The location I have put is usr/X11/lib . Is this the correct location?

# environment variables
export QTROOT=/usr/local/qt-4.4.1
export GRASS_TCLSH=/usr/X11R6/bin/tclsh
export GRASS_WISH=/usr/X11R6/bin/wish
export VTK_DIR=/Users/elvis/Tool/vtk-5.2.0/src
export VTK_LIB_DIR=/usr/local/lib/vtk-5.2
export X11_LIB_DIR=/usr/X11/lib
#export OPENGL_LIB_DIR=/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries

# the path is initially set to "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
export PATH=$PATH:$QTROOT/bin
export LD_LIBRARY_PATH=$VTK_LIB_DIR:$X11_LIB_DIR:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$VTK_LIB_DIR:$X11_LIB_DIR:$DYLD_LIBRARY_PATH

Setting DYLD_LIBRARY_PATH is unnecessary on OSX. If you have to do it for VTK, then the VTK build is broken. LD_LIBRARY_PATH is the linux version of this and is not needed on OSX.

DYLD_LIBRARY_PATH only affects the finding of libraries at runtime, not linking as in configure tests. And properly built libraries on OSX should have the path built into them so they're found at runtime without DYLD_LIBRARY_PATH. Though GRASS does use this as a neat trick (as a side effect) to make the binaries relocatable.

Here is my configure command

./configure --with-cxx --prefix=/Applications/GRASS --enable-macosx-app --with-x --with-cxx --with-opengl=aqua --without-readline --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-opengl-includes=/usr/X11R6/include

This is probably what is confusing the build - you set --with-opengl=aqua, yet set the opengl includes and libs to X11. These options can't be used together. Configure should force the includes and libs based on the opengl value, but to be sure just use --with-opengl, which defaults to X11, and you probably won't need the includes/libs options.

Also note that you need to compile your own tcltk for X11, and set those options for the GRASS configure. See the grass source osx readme for details.

If I use the -with-opengl=x11 option, I get the following configuration error

checking for location of OpenGL library...
checking for glBegin in -lGL... yes
checking for gluBeginCurve in -lGLU... yes
checking for glXCreatePbuffer... no
configure: error: *** Unable to locate .

configure:10998: checking for location of OpenGL library
configure:11027: checking for glBegin in -lGL
configure:11044: gcc -o conftest -g -O2 conftest.c -lGL -L/usr/X11R6/lib -lSM -lICE -lX11 1>&5
configure:11214: checking for gluBeginCurve in -lGLU
configure:11231: gcc -o conftest -g -O2 conftest.c -lGLU -lGL -L/usr/X11R6/lib -lSM -lICE -lX11 1>&5
configure:11314: checking for glXCreatePbuffer
configure:11340: gcc -o conftest -g -O2 conftest.c -lGL 1>&5
ld: library not found for -lGL
collect2: ld returned 1 exit status

This is strange - configure is inserting the X11 lib path for the glBegin and gluBeginCurve tests, but not for the glXCreatePbuffer test. Oh, I'm getting that also, but it's not keeping compilation from working. This is just testing for the availability of pbuffers, and GRASS has a fallback if that's not available.

So, your make error log doesn't have the needed info. You need to look way back in the shell scrollback to see what the actual error is. You may need to change your Terminal window settings to unlimited scrollback.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy

Hi William,
Ok, I’ve taken your suggestions and tried it, but with identical results.

Here are my export option. I still get the same error without the -g option

export CFLAGS=“-arch i386 -Os”
export CXXFLAGS=“-arch i386 -Os”
export LDFLAGS=“-arch i386 -Os”
export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

./configure --with-cxx --prefix=/Applications/GRASS --enable-macosx-app --with-x --with-cxx --with-opengl

I still get the same error

checking for gluBeginCurve in -lGLU… yes
checking for glXCreatePbuffer… no
configure: error: *** Unable to locate .

I have attached the config.log file here. Please note that configure command did not complete successfully. So, I haven’t had a chance to run make, so the glXCreatePBuffer() error is in the config.log.

Any ideas on how I can resolve this or what might be causing this?

(attachments)

config.log (19.7 KB)

Hi William,
                        I tried all this with the latest grass-7.0.0 sources from svn, but I still get the same error. So this error exists for both grass-6.4.0 and grass-7.0.0.

Best regards,

Elvis Dowson

On Sep 21, 2008, at 10:20 PM, William Kyngesburye wrote:

On Sep 21, 2008, at 1:32 PM, Elvis Dowson wrote:

checking for gluBeginCurve in -lGLU... yes
checking for glXCreatePbuffer... no
configure: error: *** Unable to locate .

I have attached the config.log file here. Please note that configure command did not complete successfully. So, I haven't had a chance to run make, so the glXCreatePBuffer() error is in the config.log.

Any ideas on how I can resolve this or what might be causing this?

Strange, this should not cause configure to stop. Maybe your source got corrupted somehow, try a fresh checkout from SVN.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Hi William,
                         Here's what I've done. I downloaded the latest svn snapshot 20080920 and then

did the following.

Here are my environment variables

export CFLAGS="-arch i386 -Os"
export CXXFLAGS="-arch i386 -Os"
export LDFLAGS="-arch i386 -Os"
export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

For the configure command, this time I just did

./configure and it detected most of the libraries correctly and didn't complain.

After this I typed make and got the following errors:

Errors in:
/Users/elvis/Tool/grass-6.4.0/lib/nviz
/Users/elvis/Tool/grass-6.4.0/visualization/nviz
/Users/elvis/Tool/grass-6.4.0/visualization/nviz2/cmd

When I go into

I get the following errors: /Users/elvis/Tool/grass-6.4.0/lib/nviz

cc -dynamiclib -compatibility_version 6.4 -current_version 6.4 -install_name /usr/local/grass-6.4.svn/lib/libgrass_nviz.dylib -o /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.6.4.svn.dylib -L/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib -arch i386 -Os -arch i386 -Os OBJ.i386-apple-darwin9.5.0/change_view.o OBJ.i386-apple-darwin9.5.0/cplanes_obj.o OBJ.i386-apple-darwin9.5.0/draw.o OBJ.i386-apple-darwin9.5.0/exag.o OBJ.i386-apple-darwin9.5.0/lights.o OBJ.i386-apple-darwin9.5.0/map_obj.o OBJ.i386-apple-darwin9.5.0/nviz.o OBJ.i386-apple-darwin9.5.0/position.o OBJ.i386-apple-darwin9.5.0/render.o -lgrass_gis -lgrass_datetime -lz -lgrass_bitmap -lgrass_linkm -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/usr/local/lib -lgdal -L/usr/X11/lib -lGL -lGLU -ltiff -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_g3d -lgrass_gis -lgrass_datetime -lz -lgrass_ogsf -lgrass_bitmap -lgrass_linkm -lgrass_g3d -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree && \
  (cd /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib; ln -f -s libgrass_nviz.6.4.svn.dylib /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.dylib)
Undefined symbols:
   "_glXCreateGLXPixmap", referenced from:
       _Nviz_create_render_window in render.o
   "_XOpenDisplay", referenced from:
       _Nviz_create_render_window in render.o
   "_glXDestroyGLXPixmap", referenced from:
       _Nviz_destroy_render_window in render.o
   "_XFreePixmap", referenced from:
       _Nviz_destroy_render_window in render.o
   "_XCreatePixmap", referenced from:
       _Nviz_create_render_window in render.o
   "_glXGetCurrentContext", referenced from:
       _Nviz_make_current_render_window in render.o
   "_XFree", referenced from:
       _Nviz_create_render_window in render.o
   "_glXMakeCurrent", referenced from:
       _Nviz_make_current_render_window in render.o
   "_glXDestroyContext", referenced from:
       _Nviz_destroy_render_window in render.o
   "_glXChooseVisual", referenced from:
       _Nviz_create_render_window in render.o
   "_glXCreateContext", referenced from:
       _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.6.4.svn.dylib] Error 1

What should I do?

Best regards,

Elvis

On Sep 21, 2008, at 11:49 PM, William Kyngesburye wrote:

On Sep 21, 2008, at 1:32 PM, Elvis Dowson wrote:

checking for gluBeginCurve in -lGLU... yes
checking for glXCreatePbuffer... no
configure: error: *** Unable to locate .

I have attached the config.log file here. Please note that configure command did not complete successfully. So, I haven't had a chance to run make, so the glXCreatePBuffer() error is in the config.log.

Any ideas on how I can resolve this or what might be causing this?

Strange, this should not cause configure to stop. Maybe your source got corrupted somehow, try a fresh checkout from SVN.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Hi,
         I even tried changing the linker options to fix this, but no such luck

export LDFLAGS="-arch i386 -Os -L/usr/X11/lib -lXm -lGLU -lGL -lGLw -lX11 -lXext -lXt -lm"

What could be going wrong? Why can't the linked find the correct glX symbols?

Best regards,

Elvis Dowson

On Sep 22, 2008, at 12:34 AM, Elvis Dowson wrote:

Hi William,
                       Here's what I've done. I downloaded the latest svn snapshot 20080920 and then

did the following.

Here are my environment variables

export CFLAGS="-arch i386 -Os"
export CXXFLAGS="-arch i386 -Os"
export LDFLAGS="-arch i386 -Os"
export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

For the configure command, this time I just did

./configure and it detected most of the libraries correctly and didn't complain.

After this I typed make and got the following errors:

Errors in:
/Users/elvis/Tool/grass-6.4.0/lib/nviz
/Users/elvis/Tool/grass-6.4.0/visualization/nviz
/Users/elvis/Tool/grass-6.4.0/visualization/nviz2/cmd

When I go into

I get the following errors: /Users/elvis/Tool/grass-6.4.0/lib/nviz

cc -dynamiclib -compatibility_version 6.4 -current_version 6.4 -install_name /usr/local/grass-6.4.svn/lib/libgrass_nviz.dylib -o /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.6.4.svn.dylib -L/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib -arch i386 -Os -arch i386 -Os OBJ.i386-apple-darwin9.5.0/change_view.o OBJ.i386-apple-darwin9.5.0/cplanes_obj.o OBJ.i386-apple-darwin9.5.0/draw.o OBJ.i386-apple-darwin9.5.0/exag.o OBJ.i386-apple-darwin9.5.0/lights.o OBJ.i386-apple-darwin9.5.0/map_obj.o OBJ.i386-apple-darwin9.5.0/nviz.o OBJ.i386-apple-darwin9.5.0/position.o OBJ.i386-apple-darwin9.5.0/render.o -lgrass_gis -lgrass_datetime -lz -lgrass_bitmap -lgrass_linkm -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/usr/local/lib -lgdal -L/usr/X11/lib -lGL -lGLU -ltiff -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_g3d -lgrass_gis -lgrass_datetime -lz -lgrass_ogsf -lgrass_bitmap -lgrass_linkm -lgrass_g3d -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree && \
  (cd /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib; ln -f -s libgrass_nviz.6.4.svn.dylib /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.dylib)
Undefined symbols:
"_glXCreateGLXPixmap", referenced from:
     _Nviz_create_render_window in render.o
"_XOpenDisplay", referenced from:
     _Nviz_create_render_window in render.o
"_glXDestroyGLXPixmap", referenced from:
     _Nviz_destroy_render_window in render.o
"_XFreePixmap", referenced from:
     _Nviz_destroy_render_window in render.o
"_XCreatePixmap", referenced from:
     _Nviz_create_render_window in render.o
"_glXGetCurrentContext", referenced from:
     _Nviz_make_current_render_window in render.o
"_XFree", referenced from:
     _Nviz_create_render_window in render.o
"_glXMakeCurrent", referenced from:
     _Nviz_make_current_render_window in render.o
"_glXDestroyContext", referenced from:
     _Nviz_destroy_render_window in render.o
"_glXChooseVisual", referenced from:
     _Nviz_create_render_window in render.o
"_glXCreateContext", referenced from:
     _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.6.4.svn.dylib] Error 1

What should I do?

Best regards,

Elvis

On Sep 21, 2008, at 11:49 PM, William Kyngesburye wrote:

On Sep 21, 2008, at 1:32 PM, Elvis Dowson wrote:

checking for gluBeginCurve in -lGLU... yes
checking for glXCreatePbuffer... no
configure: error: *** Unable to locate .

I have attached the config.log file here. Please note that configure command did not complete successfully. So, I haven't had a chance to run make, so the glXCreatePBuffer() error is in the config.log.

Any ideas on how I can resolve this or what might be causing this?

Strange, this should not cause configure to stop. Maybe your source got corrupted somehow, try a fresh checkout from SVN.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Hi William,
I think I know the reason for the glX linker errors.

If I look at libGL.dylib in the /usr/X11/lib folder, it is actually a symbolic link to /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib whose size is only 568kb.

However, I can see that there is another file called libGL.1.dylib in the /usr/X11/lib folder whose size is 2.3MB. Perhaps this is the correct one?

How can I change the symbolic links so that libGL.dylib points to /usr/X11/lib/libGL.1.dylib instead of /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib

Am I doing the right thing? Is there another way of ensuring that it uses the larger 2.3MB version of libGL.dylib ?

Best regards,

Elvis Dowson

On Sep 22, 2008, at 12:53 AM, Elvis Dowson wrote:

Hi,
I even tried changing the linker options to fix this, but no such luck

export LDFLAGS=“-arch i386 -Os -L/usr/X11/lib -lXm -lGLU -lGL -lGLw -lX11 -lXext -lXt -lm”

What could be going wrong? Why can’t the linked find the correct glX symbols?

Best regards,

Elvis Dowson

On Sep 22, 2008, at 12:34 AM, Elvis Dowson wrote:

On Sep 21, 2008, at 3:34 PM, Elvis Dowson wrote:

I get the following errors: /Users/elvis/Tool/grass-6.4.0/lib/nviz

cc -dynamiclib -compatibility_version 6.4 -current_version 6.4 -install_name /usr/local/grass-6.4.svn/lib/libgrass_nviz.dylib -o /Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib/libgrass_nviz.6.4.svn.dylib -L/Users/elvis/Tool/grass-6.4.0/dist.i386-apple-darwin9.5.0/lib -arch i386 -Os -arch i386 -Os

...

    -L/usr/local/lib -lgdal -L/usr/X11/lib -lGL -lGLU

...

Undefined symbols:

Everything looks right - that's what my cc command looks like also.

If I look at libGL.dylib in the /usr/X11/lib folder, it is actually a symbolic link to /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib whose size is only 568kb.

However, I can see that there is another file called libGL.1.dylib in the /usr/X11/lib folder whose size is 2.3MB. Perhaps this is the correct one?

Ah, there's your problem. They should only be symlinks within the X11/lib dir:

lrwxr-xr-x 1 root wheel 13 Oct 27 2007 libGL.1.2.dylib -> libGL.1.dylib
-rwxr-xr-x 1 root wheel 2390592 Aug 21 23:45 libGL.1.dylib
lrwxr-xr-x 1 root wheel 13 Oct 27 2007 libGL.dylib -> libGL.1.dylib
lrwxr-xr-x 1 root wheel 14 Oct 27 2007 libGLU.1.3.dylib -> libGLU.1.dylib
-rwxr-xr-x 1 root wheel 3304064 Aug 21 23:45 libGLU.1.dylib
lrwxr-xr-x 1 root wheel 14 Oct 27 2007 libGLU.dylib -> libGLU.1.dylib

Try:

sudo ln -sf libGL.1.dylib /usr/X11/lib/libGL.dylib
sudo ln -sf libGL.1.dylib /usr/X11/lib/libGL.1.2.dylib

Use a similar ln for the GLU libs if they are also pointing to the system framework.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe

Hi William,
                      That solution worked. One step closer!!

Now when I try to run make within the nviz folder, I get the following errors

Undefined symbols:
   "_XOpenDisplay", referenced from:
       _Nviz_create_render_window in render.o
   "_XFreePixmap", referenced from:
       _Nviz_destroy_render_window in render.o
   "_XCreatePixmap", referenced from:
       _Nviz_create_render_window in render.o
   "_XFree", referenced from:
       _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

What should I do?

On Sep 22, 2008, at 1:14 AM, William Kyngesburye wrote:

Ah, there's your problem. They should only be symlinks within the X11/lib dir:

lrwxr-xr-x 1 root wheel 13 Oct 27 2007 libGL.1.2.dylib -> libGL.1.dylib
-rwxr-xr-x 1 root wheel 2390592 Aug 21 23:45 libGL.1.dylib
lrwxr-xr-x 1 root wheel 13 Oct 27 2007 libGL.dylib -> libGL.1.dylib
lrwxr-xr-x 1 root wheel 14 Oct 27 2007 libGLU.1.3.dylib -> libGLU.1.dylib
-rwxr-xr-x 1 root wheel 3304064 Aug 21 23:45 libGLU.1.dylib
lrwxr-xr-x 1 root wheel 14 Oct 27 2007 libGLU.dylib -> libGLU.1.dylib

Try:

sudo ln -sf libGL.1.dylib /usr/X11/lib/libGL.dylib
sudo ln -sf libGL.1.dylib /usr/X11/lib/libGL.1.2.dylib

Well, as Michael jsut pointed out, this whole excercise is academic. libnviz is meant for the new nviz in python, which on OSX is really only available in an Aqua form. You can ignore errors in lib/nviz. You need to focus on getting visualization/nviz working.

On Sep 21, 2008, at 4:31 PM, Elvis Dowson wrote:

Hi William,
                    That solution worked. One step closer!!

Now when I try to run make within the nviz folder, I get the following errors

Undefined symbols:
"_XOpenDisplay", referenced from:
     _Nviz_create_render_window in render.o
"_XFreePixmap", referenced from:
     _Nviz_destroy_render_window in render.o
"_XCreatePixmap", referenced from:
     _Nviz_create_render_window in render.o
"_XFree", referenced from:
     _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

What should I do?

On Sep 22, 2008, at 1:14 AM, William Kyngesburye wrote:

Ah, there's your problem. They should only be symlinks within the X11/lib dir:

lrwxr-xr-x 1 root wheel 13 Oct 27 2007 libGL.1.2.dylib -> libGL.1.dylib
-rwxr-xr-x 1 root wheel 2390592 Aug 21 23:45 libGL.1.dylib
lrwxr-xr-x 1 root wheel 13 Oct 27 2007 libGL.dylib -> libGL.1.dylib
lrwxr-xr-x 1 root wheel 14 Oct 27 2007 libGLU.1.3.dylib -> libGLU.1.dylib
-rwxr-xr-x 1 root wheel 3304064 Aug 21 23:45 libGLU.1.dylib
lrwxr-xr-x 1 root wheel 14 Oct 27 2007 libGLU.dylib -> libGLU.1.dylib

Try:

sudo ln -sf libGL.1.dylib /usr/X11/lib/libGL.dylib
sudo ln -sf libGL.1.dylib /usr/X11/lib/libGL.1.2.dylib

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe