title: installing ncdf R package
body: <p>I have been trying to install the ncdf R package. I have searched answers and attempted to solve the problem, but it looks like it's the time for me to ask for some help here.</p>
  
  <p>I downloaded ncdf_1.6.5.tar.gz from this page ("<a href="https://cran.r-project.org/src/contrib/Archive/ncdf/" rel="nofollow noreferrer">https://cran.r-project.org/src/contrib/Archive/ncdf/</a>), saved it in Download folder.</p>
  
  <p>As it does not have a NAMESPACE file, I untar-ed the file and  did the following</p>
  
  <pre><code>cd Downloads
  cd ncdf
  echo 'exportPattern( "." )' &gt; NAMESPACE
  cd ..
  tar -zcf ncdf.tar.gz ncdf
  </code></pre>
  
  <p>Then I tried to install the package by this command</p>
  
  <pre><code>R CMD INSTALL -l /Users/xyc/Downloads/ncdf.tar.gz
  </code></pre>
  
  <p>It gave me this </p>
  
  <pre><code>ARGUMENT 'CDM' __ignor'e__
  
  ARGUMENT 'INSTALL' __ignor'e__
  
  AVIS : option inconnue '-l'
  
  ARGUMENT 'ncdf.tar.gz' __ignor'e__
  
  
  R version 3.4.2 (2017-09-28) -- "Short Summer"
  Copyright (C) 2017 The R Foundation for Statistical Computing
  Platform: x86_64-apple-darwin15.6.0 (64-bit)
  
  R est un logiciel libre livré sans AUCUNE GARANTIE.
  Vous pouvez le redistribuer sous certaines conditions.
  Tapez 'license()' ou 'licence()' pour plus de détails.
  
  Natural language support but running in an English locale
  
  R is a collaborative project with many contributors.
  Type 'contributors()' for more information and
  'citation()' on how to cite R or R packages in publications.
  
  Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
  en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
  Tapez 'q()' pour quitter R.
  </code></pre>
  
  <p>Obviously, this did not install the package.</p>
  
  <p>I tried to install in RStudio by </p>
  
  <pre><code>install.packages("ncdf.tar.gz", lib = "/Users/xyc/Downloads", repos = NULL)
  </code></pre>
  
  <p>It showed me </p>
  
  <pre><code>* installing *source* package ‘ncdf’ ...
  checking for nc-config... /opt/local/bin/nc-config
  configure: creating ./config.status
  config.status: creating src/Makevars
  ** libs
  make: error: unable to find utility "make", not a developer tool or in PATH
  ERROR: compilation failed for package ‘ncdf’
  * removing ‘/Users/xyc/Downloads/ncdf’
  * restoring previous ‘/Users/xyc/Downloads/ncdf’
  Warning in install.packages :
  installation of package ‘ncdf.tar.gz’ had non-zero exit status
  </code></pre>
  
  <p>Could someone help me here? Thank you very much.</p>
  
  <p><strong>UPDATE</strong>
  Thank you for all your inputs. I downloaded Xcode 9 and a lower version of ncdf and did this</p>
  
  <pre><code>$ sudo xcode-select --switch /Users/xyc/Downloads/Xcode.app
  
  $R CMD INSTALL ncdf_1.6.3.tar.gz
  </code></pre>
  
  <p>It gave me 96 warnings and 11 errors. The compilation failed again.</p>
  
  <pre><code>* installing to library ‘/Users/hhsieh/Library/R/3.4/library’
  * installing *source* package ‘ncdf’ ...
  checking for nc-config... /opt/local/bin/nc-config
  configure: creating ./config.status
  config.status: creating src/Makevars
  ** libs
  clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -
  I/opt/local/include  -I/usr/local/include   -fPIC  -Wall -g -O2  -c 
  ._ncdf.c -o ._ncdf.o
  ._ncdf.c:1:1: warning: null character ignored [-Wnull-character]
  &lt;U+0000&gt;&lt;U+0005&gt;&lt;U+0016&gt;&lt;U+0007&gt;&lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;Mac OS 
  X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;...
  ^
  ._ncdf.c:1:2: error: expected identifier or '('
  &lt;U+0000&gt;&lt;U+0005&gt;&lt;U+0016&gt;&lt;U+0007&gt;&lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;Mac OS 
  X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;...
      ^
  ._ncdf.c:1:5: warning: null character ignored [-Wnull-character]
  &lt;U+0000&gt;&lt;U+0005&gt;&lt;U+0016&gt;&lt;U+0007&gt;&lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;Mac OS 
  X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;...
                              ^
  ._ncdf.c:1:7: warning: null character ignored [-Wnull-character]
  &lt;U+0000&gt;&lt;U+0005&gt;&lt;U+0016&gt;&lt;U+0007&gt;&lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;Mac OS 
  X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;...
                                              ^
  ._ncdf.c:1:8: warning: null character ignored [-Wnull-character]
  &lt;U+0000&gt;&lt;U+0005&gt;&lt;U+0016&gt;&lt;U+0007&gt;&lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;Mac OS 
  X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;...
                                                      ^
  ._ncdf.c:1:25: warning: null character ignored [-Wnull-character]
  &lt;U+0000&gt;&lt;U+0005&gt;&lt;U+0016&gt;&lt;U+0007&gt;&lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;Mac OS 
  X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;...
  
  ^
  ._ncdf.c:1:27: warning: null character ignored [-Wnull-character]
  ...OS X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;&lt;U+0000&gt;  &lt;U+0000&gt;
  &lt;U+0000&gt;&lt;U+0000&gt;2&lt;U+0000&gt;&lt;U+0000&gt;&lt;U+0000&gt;&lt;AC&gt;...
                               ^
  ._ncdf.c:1:28: warning: null character ignored [-Wnull-character]
  ...OS X        &lt;U+0000&gt;&lt;U+0002&gt;&lt;U+0000&gt;&lt;U+0000&gt;&lt;U+0000&gt;  &lt;U+0000&gt;
  &lt;U+0000&gt;&lt;U+0000&gt;2&lt;U+0000&gt;&lt;U+0000&gt;&lt;U+0000&gt;&lt;AC&gt;...
                                       ^
  
  (warnings and error cut from here)
  
  96 warnings and 11 errors generated.
  make: *** [._ncdf.o] Error 1
  ERROR: compilation failed for package ‘ncdf’
  * removing ‘/Users/xyc/Library/R/3.4/library/ncdf’
  </code></pre>
  
  <p>I also tried this</p>
  
  <pre><code>$R CMD INSTALL --configure-args="-with-netcdf_incdir=/usr/local/netcdf/4.1.1-gcc/include -with-netcdf_libdir=/usr/local/netcdf/4.1.1-gcc/lib" ncdf_1.6.3.tar.gz
  </code></pre>
  
  <p>which also gave me 96 warnings and 11 errors. </p>
  
  <pre><code>96 warnings and 11 errors generated.
  make: *** [._ncdf.o] Error 1
  ERROR: compilation failed for package ‘ncdf’
  * removing ‘/Users/xyc/Library/R/3.4/library/ncdf’
  </code></pre>
  
  <p>It looks like I still have a problem with XCode.</p>
  
  <p>All suggestions are highly appreciated and welcome.</p>
  
  <p>Thank you...</p>