Anna,

Here are my compiling notes. This worked a couple weeks ago.

Michael

========================


1. In terminal, cd to source folder. e.g.,

cd /Users/cmbarton/grass_source/grass_trunk

2. Set up environment

# for PROJ
export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

# for C++
export CXX=g++

# for backward compatibility with earlier OS versions (requires 10.7 SDK)
export MACOSX_DEPLOYMENT_TARGET=10.7

# needed until we switch to 64 bit wxPython (requires script redirect to Python 
32)
export 
PATH="/Applications/python/bin32:/System/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH"

3. Run configure with configure string (TCLTK only needed for GRASS 6; includes 
optional lastools, nls, and OpenCL)

./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.7.sdk --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-geos=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config 
--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 
--with-cairo 
--with-cairo-includes="/Library/Frameworks/cairo.framework/unix/include/cairo 
/Library/Frameworks/cairo.framework/unix/include" 
--with-cairo-libs=/Library/Frameworks/cairo.framework/unix/lib 
--with-cairo-ldflags="-lcairo" --without-postgres --without-mysql --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 
--enable-macosx-app --with-python 
--with-wxwidgets=/usr/local/lib/wxPython-unicode-2.8.12.1/bin/wx-config 
--with-tcltk-includes="/Library/Frameworks/Tcl.framework/Headers 
/Library/Frameworks/Tk.framework/Headers 
/Library/Frameworks/Tk.framework/PrivateHeaders" 
--with-tcltk-libs="/usr/local/tcltk_active/lib" --with-macosx-archs="i386 
x86_64" --with-liblas="/usr/local/bin/liblas-config" --with-opencl --with-nls 
--with-libs=/usr/local/lib  --with-includes=/usr/local/include

4. Compile (gdal_dynamic needed for GRASS 7)

make GDAL_DYNAMIC=


The step 2 export PATH command refers to a shell script named “python” with the 
following contents:

#!/bin/sh
exec arch -i386 pythonw2.7 "$@“

This forces a 32 bit environment for compiling wxPython. While I was still 
getting errors on this up through last fall, changes in GRASS 7 seem to have 
made this work better now.




Michael



______________________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University
Tempe, AZ  85287-2402
USA

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax:          480-965-7671(SHESC), 480-727-0709 (CSDC)
www:  http://csdc.asu.edu, http://shesc.asu.edu
http://www.public.asu.edu/~cmbarton

On Mar 12, 2015, at 12:01 PM, 
grass-dev-requ...@lists.osgeo.org<mailto:grass-dev-requ...@lists.osgeo.org> 
wrote:

From: Anna Petrášová <kratocha...@gmail.com<mailto:kratocha...@gmail.com>>
To: GRASS-dev <grass-dev@lists.osgeo.org<mailto:grass-dev@lists.osgeo.org>>
Date: March 12, 2015 at 10:44:31 AM MST
Subject: [GRASS-dev] grass compilation problem on mac


Hi,

I am trying to compile grass on a fresh mac (yosemite) and the configure fails 
with

checking for gdal-config... 
/Library/Frameworks/GDAL.Framework/Versions/1.11/Programs/gdal-config

configure: error: *** Unable to locate GDAL library.


and this is the configure log:

configure:6036: checking whether to use GDAL
configure:6054: checking for gdal-config
configure:6116: gcc -o conftest -g -O2   -arch i386 -arch x86_64 
-I/Library/Frameworks/GDAL.framework/Versions/1.11/Headers    -arch i386 -arch 
x86_64  conftest.c  -framework GDAL 1>&5
configure:6112:1: warning: ignoring return value of function declared with 
warn_unused_result attribute [-Wunused-result]
GDALOpen("foo", GA_ReadOnly);
^~~~~~~~ ~~~~~~~~~~~~~~~~~~
1 warning generated.
ld: framework not found GDAL
configure:6112:1: warning: ignoring return value of function declared with 
warn_unused_result attribute [-Wunused-result]
GDALOpen("foo", GA_ReadOnly);
^~~~~~~~ ~~~~~~~~~~~~~~~~~~
1 warning generated.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure: failed program was:
#line 6109 "configure"
#include "confdefs.h"
#include <gdal.h>
int main() {
GDALOpen("foo", GA_ReadOnly);
; return 0; }
configure:6132: gcc -o conftest -g -O2   -arch i386 -arch x86_64 
-I/Library/Frameworks/GDAL.framework/Versions/1.11/Headers    -arch i386 -arch 
x86_64  conftest.c  -framework GDAL  1>&5
configure:6128:1: warning: ignoring return value of function declared with 
warn_unused_result attribute [-Wunused-result]
GDALOpen("foo", GA_ReadOnly);
^~~~~~~~ ~~~~~~~~~~~~~~~~~~
1 warning generated.
ld: framework not found GDAL
configure:6128:1: warning: ignoring return value of function declared with 
warn_unused_result attribute [-Wunused-result]
GDALOpen("foo", GA_ReadOnly);
^~~~~~~~ ~~~~~~~~~~~~~~~~~~
1 warning generated.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure: failed program was:
#line 6125 "configure"
#include "confdefs.h"
#include <gdal.h>
int main() {
GDALOpen("foo", GA_ReadOnly);
; return 0; }


I installed the GDAL framework from Michael's page and then from William's too. 
Nothing really helped.

Any idea? I was able to compile grass couple of months ago without problem on a 
different computer so I don't know why it doesn't work now.

Thanks,

Anna


_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to