<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">OK, with a little courage and reading the manual pages properly, I managed to install nn library on my Mac. In case anyone is interested, I copy the commands below. Apologies to anyone who might have spent time on this.</p>

<p dir="auto">Jón</p>

<p dir="auto">//<br>
Last login: Thu Jul 20 08:20:30 on console</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| ~ @ jons-iMac (jon)<br>
| => git clone <a href="https://github.com/sakov/nn-c" style="color:#3983C4">https://github.com/sakov/nn-c</a><br>
Cloning into 'nn-c'...<br>
remote: Counting objects: 208, done.<br>
remote: Total 208 (delta 0), reused 0 (delta 0), pack-reused 208<br>
Receiving objects: 100% (208/208), 792.10 KiB | 475.00 KiB/s, done.<br>
Resolving deltas: 100% (93/93), done.<br>
Checking connectivity... done.</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| ~ @ jons-iMac (jon)<br>
| => cd nn-c</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| nn-c @ jons-iMac (jon)<br>
| => cd nn</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| nn @ jons-iMac (jon)<br>
| => ls<br>
CHANGELOG        install-sh        nnai.c<br>
CUSTOMISE        istack.c        nnbathy.c<br>
LICENSE            istack.h        nncommon-vulnerable.c<br>
README            lpi.c            nncommon.c<br>
config.h.in        makefile.example    nnconfig.h.in<br>
configure        makefile.in        nnpi.c<br>
configure.in        minell.c        preader.c<br>
delaunay.c        minell.h        preader.h<br>
delaunay.h        mkinstalldirs        triangle.c<br>
examples        nan.h            triangle.h<br>
hash.c            nn.h            version.h<br>
hash.h            nn_internal.h</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| nn @ jons-iMac (jon)<br>
| => ./configure<br>
Using prefix /usr/local<br>
Using libdir /usr/local/lib<br>
checking for gcc... gcc<br>
checking for C compiler default output file name... a.out<br>
checking whether the C compiler works... yes<br>
checking whether we are cross compiling... no<br>
checking for suffix of executables...<br>
checking for suffix of object files... o<br>
checking whether we are using the GNU C compiler... yes<br>
checking whether gcc accepts -g... yes<br>
checking for gcc option to accept ISO C89... none needed<br>
checking for a BSD-compatible install... /usr/bin/install -c<br>
checking for ar... ar<br>
checking how to run the C preprocessor... gcc -E<br>
checking for grep that handles long lines and -e... /usr/bin/grep<br>
checking for egrep... /usr/bin/grep -E<br>
checking for ANSI C header files... rm: conftest.dSYM: is a directory<br>
rm: conftest.dSYM: is a directory<br>
yes<br>
checking for sys/types.h... yes<br>
checking for sys/stat.h... yes<br>
checking for stdlib.h... yes<br>
checking for string.h... yes<br>
checking for memory.h... yes<br>
checking for strings.h... yes<br>
checking for inttypes.h... yes<br>
checking for stdint.h... yes<br>
checking for unistd.h... yes<br>
checking math.h usability... yes<br>
checking math.h presence... yes<br>
checking for math.h... yes<br>
checking for main in -lm... yes<br>
checking for realloc... yes<br>
checking for strtod... yes<br>
checking for strtok... yes<br>
checking for hypot... yes<br>
checking for -fno-force-mem option... no<br>
configure: creating ./config.status<br>
config.status: creating makefile<br>
config.status: creating config.h</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| nn @ jons-iMac (jon)<br>
| => make<br>
gcc -c -DTRILIBRARY -g -O2 -Wall -pedantic -w -ffloat-store -I. triangle.c<br>
gcc -g -O2 -Wall -pedantic -c delaunay.c -o delaunay.o<br>
gcc -g -O2 -Wall -pedantic -c hash.c -o hash.o<br>
gcc -g -O2 -Wall -pedantic -c istack.c -o istack.o<br>
gcc -g -O2 -Wall -pedantic -c lpi.c -o lpi.o<br>
gcc -g -O2 -Wall -pedantic -c minell.c -o minell.o<br>
gcc -g -O2 -Wall -pedantic -c nnai.c -o nnai.o<br>
gcc -g -O2 -Wall -pedantic -c nnpi.c -o nnpi.o<br>
gcc -g -O2 -Wall -pedantic -c nncommon.c -o nncommon.o<br>
gcc -g -O2 -Wall -pedantic -ffloat-store -c nncommon-vulnerable.c -o nncommon-vulnerable.o<br>
gcc -g -O2 -Wall -pedantic -c preader.c -o preader.o<br>
ar cru libnn.a delaunay.o hash.o istack.o lpi.o minell.o nnai.o nnpi.o nncommon.o nncommon-vulnerable.o preader.o triangle.o<br>
chmod go+r libnn.a<br>
gcc -o minell minell.c -DME_STANDALONE -g -O2 -Wall -pedantic -I.  -lm<br>
gcc -o nnbathy nnbathy.c -g -O2 -Wall -pedantic -DNN_SERIAL -I.  libnn.a -lm</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| nn @ jons-iMac (jon)<br>
| => sudo make install<br>
Password:<br>
/bin/sh mkinstalldirs /usr/local/bin /usr/local/lib /usr/local/include<br>
for i in libnn.a; do \<br>
       /usr/bin/install -c -m 644 $i /usr/local/lib/$i; \<br>
    done<br>
for i in nn.h; do \<br>
       /usr/bin/install -c -m 644 $i /usr/local/include; \<br>
    done<br>
for i in minell nnbathy; do \<br>
       fname=<code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">basename $i</code>; \<br>
       /usr/bin/install -c $i /usr/local/bin; \<br>
    done</p>

<hr style="background:#333; background-image:linear-gradient(to right, #ccc, #333, #ccc); border:0; height:1px" height="1">

<p dir="auto">| nn @ jons-iMac (jon)<br>
| =></p>

<p dir="auto">--</p>

<p dir="auto">and the run session in GRASS:</p>

<p dir="auto">GRASS 7.3.svn (nc_spm_08_grass7):~ > g.region raster=elevation@PERMANENT -p<br>
projection: 99 (Lambert Conformal Conic)<br>
zone:       0<br>
datum:      nad83<br>
ellipsoid:  a=6378137 es=0.006694380022900787<br>
north:      228500<br>
south:      215000<br>
west:       630000<br>
east:       645000<br>
nsres:      10<br>
ewres:      10<br>
rows:       1350<br>
cols:       1500<br>
cells:      2025000<br>
GRASS 7.3.svn (nc_spm_08_grass7):~ > r.random input=elevation@PERMANENT n=100000 raster_output=random_points<br>
WARNING: Please update the usage of <r.random>: option <raster_output> has<br>
         been renamed to <raster><br>
Collecting Stats...<br>
 100%<br>
Writing raster map <random_points> ...<br>
 100%<br>
GRASS 7.3.svn (nc_spm_08_grass7):~ > r.surf.nnbathy input=random_points output=raster_map<br>
"nnbathy" is performing the interpolation now. This may take some time...<br>
Converting nnbathy output to GRASS raster ...<br>
All done. Raster map <raster_map> created.<br>
GRASS 7.3.svn (nc_spm_08_grass7):~ > <br>
//</p>

<p dir="auto">On 19 Jul 2017, at 10:13, jon wrote:</p>

<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">Hi,</p>

<p dir="auto">I am running  GRASS GIS 7.3.svn (r68671M) on MacOSX 10.10.5</p>

<p dir="auto">I have used g.extension to install r.surf.nnbathy and v.surf.nnbathy, and the following command indicates that it is in the right place (accessible from GRASS command line):</p>

<p dir="auto">r.surf.nnbathy --help</p>

<p dir="auto">Description:<br>
 Interpolates a raster map using the nnbathy natural neighbor interpolation program.</p>

<p dir="auto">Keywords:<br>
 vector, surface, interpolation, natural, neighbor</p>

<p dir="auto">Usage:<br>
 r.surf.nnbathy input=name output=name [algorithm=string] [--overwrite]<br>
   [--help] [--verbose] [--quiet] [--ui]</p>

<p dir="auto">Flags:<br>
 --o   Allow output files to overwrite existing files<br>
 --h   Print usage summary<br>
 --v   Verbose module output<br>
 --q   Quiet module output<br>
 --qq  Super quiet module output<br>
 --ui  Force launching GUI dialog</p>

<p dir="auto">Parameters:<br>
      input   Name of input raster map<br>
     output   Name of output raster map<br>
  algorithm   Settings<br>
              options: l,nn,ns<br>
              default: nn<br>
               l: Linear<br>
               nn: Sibson natural neighbor<br>
               ns: Non-Sibsonian natural neighbor</p>

<p dir="auto">However, issuing e.g.  [r.surf.nnbathy input=dem_ct output=dem_nn]</p>

<p dir="auto">GRASS 7.3.svn (skeifa_river_02):~ > r.surf.nnbathy input=dem output=dem_nn<br>
"nnbathy" is performing the interpolation now. This may take some time...<br>
Traceback (most recent call last):<br>
  File "/Users/jon/Library/GRASS/7.3/Modules/scripts/r.surf.nnbathy", line 80, in <module><br>
    main()<br>
  File "/Users/jon/Library/GRASS/7.3/Modules/scripts/r.surf.nnbathy", line 75, in main<br>
    obj.compute()<br>
  File "/Users/jon/Library/GRASS/7.3/Modules/etc/v.surf.nnbathy/nnbathy.py", line 57, in compute<br>
    stdout=fsock)<br>
  File "/Applications/GRASS-7.3.app/Contents/MacOS/etc/python/grass/script/core.py", line 84, in call<br>
    return Popen(*args, **kwargs).wait()<br>
  File "/Applications/GRASS-7.3.app/Contents/MacOS/etc/python/grass/script/core.py", line 74, in <strong>init</strong><br>
    subprocess.Popen.<strong>init</strong>(self, args, **kwargs)<br>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in <strong>init</strong><br>
    errread, errwrite)<br>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child<br>
    raise child_exception<br>
OSError: [Errno 2] No such file or directory</p>

<p dir="auto">I suspect I need to install the nn-c library.</p>

<p dir="auto">Does anyone have step-by-step cookbook type instructions or any guidelines on how to do this on MacOSX?</p>

<p dir="auto">Cheers,</p>

<p dir="auto">Jon Eiriksson</p>
</blockquote>
</div>
</div>
</body>
</html>