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

2021-03-31 Thread Rasmus Liland
Hello there again,

I found (in --help) the `R CMD INSTALL` 
flag `--configure-args`, and were 
successfully able to install it:

R CMD INSTALL RODBC --configure-args=--with-odbc-manager=odbc

Rasmus


signature.asc
Description: PGP signature
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2021-03-29 Thread Rasmus Liland
Dirk, I did not realize libiodbc[1] is an 
alternative to unixODBC, how are you 
able to see this?  

I also did not realize I had both of 
them installed ... 

Uninstalling libiodbc, keeping unixODBC, 
adding the flag (I only suppose this is 
how the flag is added), does nothing:

rasmus@iselin ~/src/RODBC % R CMD INSTALL RODBC --with-odbc-manager=odbc
Warning: unknown option ‘--with-odbc-manager=odbc’
* installing to library 
‘/usr/home/rasmus/R/amd64-portbld-freebsd13.0-library/4.0’
* installing *source* package ‘RODBC’ ...
files ‘configure’, ‘configure.ac’ have the wrong MD5 checksums
** using staged installation
checking for gcc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -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... 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... yes
checking sql.h presence... yes
checking for sql.h... yes
checking sqlext.h usability... yes
checking sqlext.h presence... yes
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’

The other way around, uninstalling 
unixODBC, keeping libiodbc, brings me 
one step backwards: 

rasmus@iselin ~/src/RODBC % R CMD INSTALL RODBC 
--with-odbc-manager=iodbc
Warning: unknown option ‘--with-odbc-manager=iodbc’
* installing to library 
‘/usr/home/rasmus/R/amd64-portbld-freebsd13.0-library/4.0’
* installing *source* package ‘RODBC’ ...
files ‘configure’, ‘configure.ac’ have the wrong MD5 checksums
** using staged installation
checking for gcc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -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... 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 
‘/usr/home/rasmus/R/amd64-portbld-freebsd13.0-library/4.0/RODBC’

... the sql.h and sqlext.h header files 
are there, libiodbc provides them both:

root@iselin /usr/home/rasmus # pkg info -l libiodbc | egrep 
'sql.h|sqlext.h'
/usr/local/include/libiodbc/isql.h
/usr/local/include/libiodbc/isqlext.h
/usr/local/include/libiodbc/sql.h
/usr/local/include/libiodbc/sqlext.h

... also when having unixodbc installed:

root@iselin /usr/home/rasmus # pkg info -l unixODBC-2.3.9 | egrep 
'sql.h|sqlext.h'
/usr/local/include/sql.h
/usr/local/include/sqlext.h

Rasmus

[1] https://www.freshports.org/databases/libiodbc/


signature.asc
Description: PGP signature
__
R-package-devel@r-project.org mailing list

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

2021-03-29 Thread Dirk Eddelbuettel


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@iselin ~ % mkdir ~/src/RODBC
|   rasmus@iselin ~ % cd ~/src/RODBC
|   rasmus@iselin ~/src/RODBC % fetch 
'https://cran.rstudio.com/src/contrib/RODBC_1.3-17.tar.gz'
|   rasmus@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")
   fi
   
   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"))
   else
 AC_SEARCH_LIBS(SQLTables, odbc odbc32 iodbc, ,
 AC_MSG_ERROR("no ODBC driver manager found"))
   fi
   
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
   odbc_mgr=""
   AC_ARG_WITH([odbc-manager],
   AC_HELP_STRING([--with-odbc-manager=MGR],
  [specify the ODBC manager, e.g. odbc or iodbc]),
   [odbc_mgr=$withval])
   
   if test "$odbc_mgr" = "odbc" ; then
 AC_PATH_PROGS(ODBC_CONFIG, odbc_config)
   fi

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.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2021-03-29 Thread Rasmus Liland
Dear r-package-devel list subscribers,

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@iselin ~ % mkdir ~/src/RODBC
rasmus@iselin ~ % cd ~/src/RODBC
rasmus@iselin ~/src/RODBC % fetch 
'https://cran.rstudio.com/src/contrib/RODBC_1.3-17.tar.gz'
rasmus@iselin ~/src/RODBC % R CMD INSTALL RODBC
* installing to library 
‘/usr/home/rasmus/R/amd64-portbld-freebsd13.0-library/4.0’
* installing *source* package ‘RODBC’ ...
** package ‘RODBC’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -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... 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... yes
checking sql.h presence... yes
checking for sql.h... yes
checking sqlext.h usability... yes
checking sqlext.h presence... yes
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:

configure:3672: cc -o conftest -O2 -pipe -DLIBICONV_PLUG 
-fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing 
-DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -I.  
conftest.c -lodbc   >&5
ld: error: unable to find library -lodbc
cc: error: linker command failed with exit code 1 (use -v to see 
invocation)
configure:3672: $? = 1

I found line 48 in configure.ac [3]

odbc_lib_path=`odbc_config --libs | sed s/-lodbc//`

and tried to change it to

odbc_lib_path=`pkg-config --libs --cflags odbc | sed s/-lodbc//`

but this changes nothing (I think ...)

Running odbc_config and pkg-config:

rasmus@iselin ~/src/RODBC % odbc_config --libs
-L/usr/local/lib -lodbc
rasmus@iselin ~/src/RODBC % pkg-config --libs --cflags odbc
-I/usr/local/include -L/usr/local/lib -lodbc

Hey, I am at a loss here ...

I have not done much debugging work like 
this before ...

Perhaps some kind soul among you can 
provide some useful pointers on this?

Best,
Rasmus Liland

[1] https://cran.r-project.org/web/packages/RODBC/index.html
[2] http://www.unixodbc.org/
[3] https://raw.githubusercontent.com/cran/RODBC/master/configure.ac
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by RODBC configure 1.3, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

## - ##
## Platform. ##
## - ##

hostname = iselin
uname -m = amd64
uname -r = 13.0-STABLE
uname -s = FreeBSD
uname -v = FreeBSD 13.0-STABLE #0 stable/13-08639983e: Sun Mar 28 04:36:56 CEST 
2021 root@iselin:/usr/obj/root/src/stable/13/amd64.amd64/sys/GENERIC 

/usr/bin/uname -p = amd64
/bin/uname -X = unknown

/bin/arch  = unknown
/usr/bin/arch -k   = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo  = unknown
/bin/machine   = unknown
/usr/bin/oslevel   = unknown
/bin/universe  = unknown

PATH: /home/rasmus/.local/bin
PATH: /sbin
PATH: /bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /home/rasmus/bin
PATH: /home/rasmus.local/bin


## --- ##
## Core tests. ##
## --- ##

configure:2424: checking for gcc
configure:2451: result: cc
configure:2680: checking for C compiler version
configure:2689: cc --version >&5
FreeBSD clang version 11.0.1 (g...@github.com:llvm/llvm-project.git 
llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
configure:2700: $? = 0
configure:2689: cc -v >&5
FreeBSD clang