[GRASS-dev] New attempt to update GRASS for Mac

Michael Barton Michael.Barton at asu.edu
Sun Aug 6 13:02:48 PDT 2017


I have built both GRASS 7.3 and 7.2svn without errors using Anaconda dependencies if I configure --without-cairo and --without-freetype.

When I install GRASS and launch it, first it hangs and time outs at

Rebuilding Addon HTML manual pages index...
Rebuilding Addon menu...

Then the GUI crashes badly (with most GRASS functions unavailable from the command line also). However, I discovered that if I manually set

export LD_LIBRARY_PATH="/Applications/anaconda/lib:$LD_LIBRARY_PATH"

in the GRASS terminal, and relaunch the GUI, it works--although without Cairo and Freetype. Also, 3D crashes with the following message:

/Applications/anaconda/bin/pythonw: line 3: 13209 Segmentation fault: 11  /Applications/anaconda/python.app/Contents/MacOS/python "$@"


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

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















On Aug 5, 2017, at 8:25 PM, Michael Barton <michael.barton at asu.edu<mailto:michael.barton at asu.edu>> wrote:

To GRASS devs:

When I configure with paths to anaconda cairo and freetype dependencies, I get no errors (see below).


But when I check the configure.log, I see the same error I'm getting at the end of a failed build:

Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _main in conftest-6b4e8e.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure: failed program was:
#line 4775 "configure"


It seems that configure output is not correct?

Indeed the checking for iconv begins at line 4775. Unfortunately, I cannot decipher what it is doing or which version of iconv it is checking (the Mac system one in /usr/lib or the one in anaconda).

Additionally, AFAICT, both versions of iconv that I have are 64bit. How can I "use -v to see invocation"?

Thanks
Michael


======== configure output to shell ======

checking host system type... x86_64-apple-darwin16.7.0
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for executable suffix... no
checking for full floating-point support... yes
checking for pwd... /bin/pwd
checking for source directory... /Users/cmbarton/grass_source/trunk
checking for build directory... /Users/cmbarton/grass_source/trunk
checking for svnversion... /opt/subversion/bin/svnversion
checking for MacOSX App... yes
checking for MacOSX architectures... no
checking for MacOSX SDK... checking for /Developer/SDKs/MacOSX10.8.sdk/SDKSettings.plist... yes
checking how to build libraries... shared
checking for additional include dirs...
checking for additional library dirs...
checking for a BSD compatible install... /usr/bin/install -c
checking for flex... flex
checking for yywrap in -lfl... no
checking for bison... bison -y
checking for ranlib... ranlib
checking for ar... ar
checking for env... env
checking for perl... /usr/bin/perl
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for limits.h... yes
checking for termio.h... no
checking for termios.h... yes
checking for unistd.h... yes
checking for values.h... no
checking for f2c.h... no
checking for g2c.h... no
checking for sys/ioctl.h... yes
checking for sys/mtio.h... no
checking for sys/resource.h... yes
checking for sys/time.h... yes
checking for sys/timeb.h... yes
checking for sys/types.h... yes
checking for sys/utsname.h... yes
checking for libintl.h... yes
checking for iconv.h... yes
checking for langinfo.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for off_t... yes
checking for uid_t in sys/types.h... yes
checking return type of signal handlers... void
checking for Cygwin environment... no
checking for ftime... yes
checking for gethostname... yes
checking for gettimeofday... yes
checking for lseek... yes
checking for nice... yes
checking for time... yes
checking for uname... yes
checking for seteuid... yes
checking for setpriority... yes
checking for setreuid... yes
checking for setruid... yes
checking for drand48... yes
checking for putenv... yes
checking for setenv... yes
checking for nanosleep... yes
checking whether setpgrp takes no argument... yes
checking for long long int... yes
checking for W11... no
checking for X... no
checking for library containing cuserid... no
checking for asprintf... yes
checking for atan... yes
checking for dlsym... yes
checking for iconv... no
checking for iconv in -liconv... yes
checking for socket... yes
checking for location of zlib includes...
checking for zlib.h... yes
checking for location of zlib library...
checking for deflate in -lz... yes
checking whether to use bzlib... no
checking for location of External PROJ.4 includes... /Applications/anaconda/include
checking for proj_api.h... yes
checking External PROJ.4 version... 492
checking for location of External PROJ.4 library... /Applications/anaconda/lib
checking for pj_get_def in -lproj... yes
checking for location of External PROJ.4 data files... /Applications/anaconda/share/proj
checking for /Applications/anaconda/share/proj/epsg... yes
checking for nad2bin... /Applications/anaconda/bin/nad2bin
checking whether to use regex... yes
checking for location of regex includes...
checking for regex.h... yes
checking for location of regex library...
checking for regcomp... yes
checking whether to use Readline... no
checking whether to use GDAL... yes
checking for gdal-config... /Applications/anaconda/bin/gdal-config
rm: conftest.dSYM: is a directory
checking whether to use libLAS... no
checking whether to use PDAL... no
checking whether to use NetCDF... no
checking whether to use GEOS... yes
checking for geos-config... /Applications/anaconda/bin/geos-config
checking for geos_c.h... yes
checking for initGEOS in -lgeos_c... yes
checking whether to use TIFF... yes
checking for location of TIFF includes... /Applications/anaconda/include
checking for tiffio.h... yes
checking for location of TIFF library... /Applications/anaconda/lib
checking for TIFFOpen in -ltiff... yes
checking whether to use PNG... yes
checking for location of PNG includes... /Applications/anaconda/include
checking for png.h... yes
checking for location of PNG library... /Applications/anaconda/lib
checking for png_read_image in -lpng... yes
checking whether to use PostgreSQL... no
checking whether to use MySQL... no
checking whether to use SQLite... yes
checking for location of SQLite includes... /Applications/anaconda/include
checking for sqlite3.h... yes
checking for location of SQLite library... /Applications/anaconda/lib
checking for sqlite3_open in -lsqlite3... yes
checking whether to use OpenGL... aqua
checking for location of OpenGL framework...
checking for OpenGL/gl.h... yes
checking for OpenGL/glu.h... yes
checking for glBegin... yes
checking for gluBeginCurve... yes
checking whether to use ODBC... no
checking whether to use FFTW... yes
checking for location of FFTW includes... /Applications/anaconda/include
checking for fftw3.h... yes
checking for location of FFTW library... /Applications/anaconda/lib
checking for fftw_execute in -lfftw3... yes
checking whether to use BLAS... no
checking whether to use LAPACK... no
checking whether to use Cairo... yes
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
checking for location of cairo includes... /Applications/anaconda/include/cairo
checking for cairo.h... yes
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
checking for location of cairo library... /Applications/anaconda/lib
checking for cairo linking flags... -lcairo
checking for cairo_create... yes
checking for cairo_xlib_surface_create_with_xrender_format... no
checking for cairo_xlib_surface_get_xrender_format... no
checking whether to use FreeType... yes
checking for location of FreeType includes... /Applications/anaconda/include/freetype2
checking for ft2build.h... yes
checking for location of FreeType library... /Applications/anaconda/lib
checking for FT_Init_FreeType in -lfreetype... yes
checking whether to use NLS... no
checking whether to use C++... yes
checking for c++... g++
checking whether the C++ compiler (g++  -isysroot /Developer/SDKs/MacOSX10.8.sdk  -isysroot /Developer/SDKs/MacOSX10.8.sdk ) works... yes
checking whether the C++ compiler (g++  -isysroot /Developer/SDKs/MacOSX10.8.sdk  -isysroot /Developer/SDKs/MacOSX10.8.sdk ) is a cross-compiler... no
checking whether we are using GNU C++... yes
checking whether g++ accepts -g... yes
checking whether to use openDWG... no
checking whether to use POSIX threads... no
checking whether to use OpenMP... no
checking whether to use OpenCL... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for fseeko... yes
checking if system supports Large Files at all... yes
creating ./config.status
creating include/Make/Platform.make
creating include/Make/Doxyfile_arch_html
creating include/Make/Doxyfile_arch_latex
creating include/version.h
creating grass.pc
creating include/config.h
include/config.h is unchanged
Copying config.status to config.status.x86_64-apple-darwin16.7.0

GRASS is now configured for:  x86_64-apple-darwin16.7.0

  Source directory:           /Users/cmbarton/grass_source/trunk
  Build directory:            /Users/cmbarton/grass_source/trunk
  Installation directory:     ${prefix}/GRASS-7.3.app/Contents/MacOS
  Startup script in directory:${exec_prefix}/bin
  C compiler:                 gcc -g -O2  -isysroot /Developer/SDKs/MacOSX10.8.sdk
  C++ compiler:               g++  -isysroot /Developer/SDKs/MacOSX10.8.sdk
  Building shared libraries:  yes
  OpenGL platform:            Aqua

  MacOSX application:         yes
  MacOSX architectures:
  MacOSX SDK:                 -isysroot /Developer/SDKs/MacOSX10.8.sdk

  BLAS support:               no
  BZIP2 support:              no
  C++ support:                yes
  Cairo support:              yes
  DWG support:                no
  FFTW support:               yes
  FreeType support:           yes
  GDAL support:               yes
  GEOS support:               yes
  LAPACK support:             no
  Large File support (LFS):   yes
  libLAS support:             no
  MySQL support:              no
  NetCDF support:             no
  NLS support:                no
  ODBC support:               no
  OGR support:                yes
  OpenCL support:             no
  OpenGL support:             yes
  OpenMP support:             no
  PDAL support:               no
  PNG support:                yes
  POSIX thread support:       no
  PostgreSQL support:         no
  Readline support:           no
  Regex support:              yes
  SQLite support:             yes
  TIFF support:               yes
  X11 support:                no




____________________
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

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















On Aug 5, 2017, at 3:56 PM, Michael Barton <michael.barton at asu.edu<mailto:michael.barton at asu.edu>> wrote:

I figured you are working towards an anaconda build. I'm trying something simpler. What did you change in platform.make?

Michael Barton
School of Human Evolution &Social Change
Center for Social Dynamics & Complexity
Arizona State University

...Sent from my iPad

On Aug 5, 2017, at 11:05 AM, Eric Hutton <hutton.eric at gmail.com<mailto:hutton.eric at gmail.com>> wrote:

Michael,

Those were the sorts of files I was making changes in.

Also, I just realized that I am building things slightly differently than you and so the stuff I wrote about the temporary folder doesn't apply to you. I'm building GRASS with conda-build so that it can be a conda installable package.

Eric
On Sat, Aug 5, 2017 at 10:39 AM Michael Barton <Michael.Barton at asu.edu<mailto:Michael.Barton at asu.edu>> wrote:
Is the place to fix this in ../include/make/Platform.make?

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

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.public.asu.edu_-7Ecmbarton&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=lk-7X7CEOMDN8GaGVhiDsuO6gEp1wbG6nfT1XEEEtR0&m=kz9Bf_LTP0czZnIt3-pHiAJIYWW4NegjOVKWpC48EGM&s=kVm-Ph7PI7je3NbzySuE7Mc_F6JXpGzNHqsjRDRBcWQ&e=>, http://csdc.asu.edu<https://urldefense.proofpoint.com/v2/url?u=http-3A__csdc.asu.edu&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=lk-7X7CEOMDN8GaGVhiDsuO6gEp1wbG6nfT1XEEEtR0&m=kz9Bf_LTP0czZnIt3-pHiAJIYWW4NegjOVKWpC48EGM&s=siUhDOqaUWp-dbRqlchHg9BaehLzaTlIDI4xvExGxzc&e=>















On Aug 4, 2017, at 3:50 PM, Eric Hutton <hutton.eric at gmail.com<mailto:hutton.eric at gmail.com>> wrote:

Hi Michael

I found that if I manually add linker flags (like "-L$PREFIX/lib -liconv") I was able to get rid of these errors. I also notice that I had to append them to the end of the compile command (or at least after things like "-lgrass_gis.7.2.0" - I guess it has to do with the order that the compiler looks at libraries to resolve sysbols). Then, at runtime $PREFIX/lib needed to appear in the LD_LIBRARY_PATH_VAR when running the tests.

I'm not sure of the best way to fix this within the grass build system (simply adding the link flags to LDFLAGS didn't do the trick). Perhaps tweaking Rules.make and the like would do the trick? I think the basic problem is that conda does the entire build within a temporary folder that contains installations of all the dependencies and that this temporary folder is not added to all the necessary places.

Eric


On Fri, Aug 4, 2017 at 3:05 PM Michael Barton <Michael.Barton at asu.edu<mailto:Michael.Barton at asu.edu>> wrote:
After a tedious set of tests, I can say that GRASS will not build with ANY dependency from Anaconda except SQLite. That is, I went through the dependencies one-by-one and replaced the path to a Framework version with an Anaconda version in my configure string. I did a make clean between each build attempt.

All the versions are close (secondary or tertiary version number) or identical between William's framework builds and those in Anaconda.

For FreeType and Cairo, the errors of the type I posted yesterday

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

For the other dependencies, the errors are that the appropriate library cannot be found, like the following for fftw:

dyld: Library not loaded: @rpath/libfftw3.3.dylib
  Referenced from: /Users/cmbarton/grass_source/trunk/dist.x86_64-apple-darwin16.7.0/lib/libgrass_gmath.7.3.svn.dylib
  Reason: image not found

It seems to me like there has to be some kind of systematic reason for this not to work. Something hardwired in a key makefile or something. The Anaconda packages are all current builds of normal dependencies.

I am even doing it in an environment in which /Applications/anaconda/bin is first in my PATH (which works fine if the dependencies are Frameworks).

Any thoughts on this?

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

voice:  480-965-6262<tel:(480)%20965-6262> (SHESC), 480-965-8130<tel:(480)%20965-8130>/727-9746 (CSDC)
fax: 480-965-7671<tel:(480)%20965-7671> (SHESC),  480-727-0709<tel:(480)%20727-0709> (CSDC)
www: http://www.public.asu.edu/~cmbarton<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.public.asu.edu_-7Ecmbarton&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=lk-7X7CEOMDN8GaGVhiDsuO6gEp1wbG6nfT1XEEEtR0&m=KtrgOgv-4RMiEJEdKKQg5Z_ZL4pv8gJw3U0lH7fV_jg&s=LIHaJSGN6aEh018lfLuD_oohvcwC4GRCW2pleRj90HE&e=>, http://csdc.asu.edu<https://urldefense.proofpoint.com/v2/url?u=http-3A__csdc.asu.edu&d=DwMFaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=lk-7X7CEOMDN8GaGVhiDsuO6gEp1wbG6nfT1XEEEtR0&m=KtrgOgv-4RMiEJEdKKQg5Z_ZL4pv8gJw3U0lH7fV_jg&s=ZZ_j-P8_GLz4WT29WIipvPXFuAZoZlYUntcjvNtYEOs&e=>















On Aug 4, 2017, at 12:56 AM, Moritz Lennert <mlennert at club.worldonline.be<mailto:mlennert at club.worldonline.be>> wrote:

On 04/08/17 00:33, Vaclav Petras wrote:
Well, the error (below) suggests that wrong library is either linked or included. You need to go through the -L and -I paths and see if you need to set one of these differently or add additional one for iconv. I don't see how to set this through ./configure (I don't see any --with-iconv-includes= or --with-iconv-libs=), but you can start by editing the Makefiles or the command itself and changing -L and -I directly.
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _draw_main in text3.o
  "_iconv_close", referenced from:
      _draw_main in text3.o
  "_iconv_open", referenced from:
      _draw_main in text3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Just guessing: Could the error be linked to the use of clang ? Have you tried with gcc ?

Moritz



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20170806/37aad205/attachment-0001.html>


More information about the grass-dev mailing list