[GRASS-dev] Difficulty compiling GRASS on Mac

Michael Barton Michael.Barton at asu.edu
Fri May 11 12:51:21 PDT 2018


Eric Hutton at the Community Surface Dynamics Modeling System has created a recipe for compiling GRASS using Anaconda. You can find it at: 

https://github.com/csdms-stack/grass-recipe

I'm using a variant of this to create the stand-alone binaries for the Mac. 

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 5/11/18, 2:55 AM, "grass-dev on behalf of grass-dev-request at lists.osgeo.org" <grass-dev-bounces at lists.osgeo.org on behalf of grass-dev-request at lists.osgeo.org> wrote:

    Date: Thu, 10 May 2018 12:09:43 -0700
    From: Seth Price <seth at planet.com>
    To: grass-dev at lists.osgeo.org
    Subject: [GRASS-dev] Difficulty compiling GRASS on Mac
    Message-ID:
    	<CAD69hT5=ucACX1f075a39=6yC2=wg0vp5uLnkELEZ3bpJJhzSA at mail.gmail.com>
    Content-Type: text/plain; charset="utf-8"
    
    Hey all, I'm trying to compile GRASS on Mac 10.13.4 so I can compile and
    link to the GRASS libraries. I don't need most of the GIS features, just
    enough to create and run my own C++ modules. I'm having some troubles with
    grass-7.4.0 and grass-7.4.1RC1. The first problem I'm having is an error
    linking libgrass_gis.7.4.1RC1.dylib. I get this error:
    
    
    Undefined symbols for architecture x86_64:
    
      "_libiconv", referenced from:
    
          _print_escaped_for_xml in parser_interface.o
    
      "_libiconv_close", referenced from:
    
          _print_escaped_for_xml in parser_interface.o
    
      "_libiconv_open", referenced from:
    
          _print_escaped_for_xml in parser_interface.o
    
    ld: symbol(s) not found for architecture x86_64
    
    
    I can rerun the command and manually add the correct linking path for
    iconv, and it works. I'm not sure why it wouldn't find iconv otherwise, but
    it is what it is. This is the initial configure command that I'm using:
    
    ./configure --with-opengl=aqua --with-prefix=/usr/local --enable-shared
    
    I've found that I can change the configure command and fix that problem:
    
    ./configure --with-opengl=aqua --with-libs=/usr/local/lib
    --with-prefix=/usr/local --enable-shared
    
    However, then it progresses and returns this error while compiling many
    modules:
    
    dyld: Library not loaded:
    /usr/local/grass-7.4.1RC1/lib/libgrass_gis.7.4.1RC1.dylib
    
      Referenced from:
    /usr/local/grass/grass-7.4.1RC1/dist.x86_64-apple-darwin17.5.0/bin/g.parser
    
      Reason: image not found
    
    make: *** [d.correlate.tmp.html] Error 1
    
    The dylib looks like it's been successfully compiled at
    dist.x86_64-apple-darwin17.5.0/lib/libgrass_gis.7.4.1RC1.dylib and just the
    linking path for the libraries is wrong. I can't seem to shake it with any
    of the online GRASS compiling instructions I've found. What might cause
    this? Are there any current instructions for getting the shared libraries
    compiled and installed?
    
    
    Also, I'm able to install via homebrew, but then I have this problem when
    compiling my modules against GRASS:
    
    *sources/CameraOptic.cpp:33:23: **error: **use of undeclared identifier
    'PACKAGE'*
    
        G_verbose_message(_("(%5d) Camera optical adjustment..."),
    
    *                      ^*
    
    */usr/local/opt/grass7/grass-base/include/grass/glocale.h:10:26: note:
    *expanded
    from macro '_'
    
    #define _(str) G_gettext(PACKAGE,(str))
    
    I've never seen it before and can only guess that it would be fixed by a
    fresh install of GRASS from source. Identical code compiles fine under
    Ubuntu. Does anyone know what might be causing this? Or what might I do to
    fix it?
    
    Thanks,
    Seth



More information about the grass-dev mailing list