[R-pkg-devel] Debugging RODBC installation problems on FreeBSD (unixodbc library path)

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Mar 30 00:07:25 CEST 2021

On 29 March 2021 at 23:29, Rasmus Liland wrote:
| can someone please guide me a little in
| installing RODBC[1] on FreeBSD 13?
| I believe it depends on unixodbc[2], but
| the compilation stops with at not
| finding unixodbc (I think):
| 	rasmus using iselin ~ % mkdir ~/src/RODBC
| 	rasmus using iselin ~ % cd ~/src/RODBC
| 	rasmus using iselin ~/src/RODBC % fetch 'https://cran.rstudio.com/src/contrib/RODBC_1.3-17.tar.gz'
| 	rasmus using iselin ~/src/RODBC % R CMD INSTALL RODBC
| 	* installing to library ‘/usr/home/rasmus/R/amd64-portbld-freebsd13.0-library/4.0’
| 	checking for sqlext.h... yes
| 	checking for library containing SQLTables... no
| 	configure: error: "no ODBC driver manager found"
| 	ERROR: configuration failed for package ‘RODBC’
| 	* removing ‘/usr/home/rasmus/R/amd64-portbld-freebsd13.0-library/4.0/RODBC’
| I've attached the config.log.  I think
| the important lines are 249:253:

I find it easier to look at the input code in configure.ac that is used to
create configure (which, as a machine generated script, is less readable,
same for the log). So we see that test for sqlext.h still passed, but the
next one failed. Using the source for RODBC we have first the block that
passes and then the block that fails:

   dnl Check the headers can be found
   AC_CHECK_HEADERS(sql.h sqlext.h)
   if test "${ac_cv_header_sql_h}" = no || 
      test "${ac_cv_header_sqlext_h}" = no; then
      AC_MSG_ERROR("ODBC headers sql.h and sqlext.h not found")
   dnl search for a library containing an ODBC function
   if test [ -n "${odbc_mgr}" ] ; then
     AC_SEARCH_LIBS(SQLTables, ${odbc_mgr}, ,
   	         AC_MSG_ERROR("ODBC driver manager '${odbc_mgr}' not found"))
     AC_SEARCH_LIBS(SQLTables, odbc odbc32 iodbc, ,
   	         AC_MSG_ERROR("no ODBC driver manager found"))
So we see that we end up in the else branch of the test for
odbc_mgr. Scrolling back we see

   dnl A user-specifiable option
                              [specify the ODBC manager, e.g. odbc or iodbc]),
   if test "$odbc_mgr" = "odbc" ; then
     AC_PATH_PROGS(ODBC_CONFIG, odbc_config)

So this wants you to specify either (unix)odbc or (lib)iodbc explicitly, and
if odbc was set, check for odbc_config.

I have looked after RODBC for Debian since 2003 or so, and I think I switched
from unixodbc to iodbc and back in that time, reflecting the state of the
library at the time. I think what I would do now is to see which of libiodbc
and unixodbc is present, and if it is the latter if setting it as argument to
--with-odbc-manager helps some more.


https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org

More information about the R-package-devel mailing list