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 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
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to