5

I am trying to install package RODBC via CRAN on MacBook Air with OS 10.12.

I am receiving the below error:

Installing package into ‘/Users/aaron.samuels/Library/R/3.3/library’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘RODBC’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RODBC’

trying URL 'https://cran.rstudio.com/src/contrib/RODBC_1.3-14.tar.gz'
Content type 'application/x-gzip' length 1163799 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘RODBC’ ...
** package ‘RODBC’ successfully unpacked and MD5 sums checked
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... 
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking sqlext.h usability... no
checking sqlext.h presence... no
checking for sqlext.h... no
configure: error: "ODBC headers sql.h and sqlext.h not found"
ERROR: configuration failed for package ‘RODBC’
* removing ‘/Users/aaron.samuels/Library/R/3.3/library/RODBC’
Warning in install.packages :
  installation of package ‘RODBC’ had non-zero exit status

The downloaded source packages are in

/private/var/folders/3l/nrtzvm592736jz_qh_5l1wbmffq3bz/T/RtmpeuPUR0/downloaded_packages

Any suggestion on how I can easily install these headers and subsequently successfully install RODBC?

epo3
  • 2,991
  • 2
  • 33
  • 60
A.Samuels
  • 51
  • 1
  • 3

4 Answers4

3

I found an official Microsoft Source that enable the ODBC driver.

You just need to run this lines on the Terminal

/usr/bin/ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install --no-sandbox msodbcsql17 mssql-tools
albert
  • 8,027
  • 10
  • 48
  • 84
Rafa Barragan
  • 602
  • 9
  • 24
2

Use the below command to get rid of error thrown while installing RODBC package in R.

sudo zypper install unixODBC-devel
PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
Arti Yadav
  • 21
  • 1
1

Thanks @Rafa Barragan.

Following commands worked for me on my mac-os (Mojave version).

Run following commands in terminal -

  1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
  3. brew update
  4. brew install msodbcsql17 mssql-tools
Nithin Kumar Biliya
  • 2,763
  • 3
  • 34
  • 54
Tapan Hegde
  • 1,222
  • 1
  • 8
  • 25
0

configure: error: "ODBC headers sql.h and sqlext.h not found" means that ODBC drivers are not installed on your mac.

I would install iODBC and make sure the header files are present in the path

sc3339
  • 79
  • 10