exasol / r-exasol

The EXASOL package for R provides an interface to the EXASOL database.
http://www.exasol.com
BSD 3-Clause "New" or "Revised" License
22 stars 8 forks source link

"sql.h" and "sqlext.h" not found during install on MacOS #147

Closed markheckmann closed 11 months ago

markheckmann commented 1 year ago

Installing the package on a fresh MacOS (Ventura 13.5) I get an error message that sql.h and sqlext.h cannot be found.

In file included from ./r_exasol/connection_context.h:5:
   ./r_exasol/external/sql.h:16:10: error: 'sql.h' file not found with <angled> include; use "quotes" instead
   #include <sql.h>
            ^~~~~~~
            "sql.h"
   ./r_exasol/external/sql.h:17:10: fatal error: 'sqlext.h' file not found
   #include <sqlext.h>
            ^~~~~~~~~~
   2 errors generated.

Following the docs, I have

  1. installed R (cask) unixodbc and openssl via homebrew.
  2. installed the ODBC driver (see odbcinst entry below)
markheckmann~$cat /Users/markheckmann/Library/ODBC/odbcinst.ini
[ODBC Drivers]
EXASolution Driver = Installed
EXASolution Driver (Framework) = Installed

[EXASolution Driver (Framework)]
Driver = /Users/markheckmann/Library/ODBC/EXASolution ODBC.bundle/Contents/MacOS/libexaodbc-io352fw.dylib
Setup = 

[EXASolution Driver]
Driver = /Users/markheckmann/Library/ODBC/EXASolution ODBC.bundle/Contents/MacOS/libexaodbc-io418sys.dylib
Setup = 

Is there something else I need to install/do for the installation to work?

tkilias commented 1 year ago

Hi @markheckmann,

I can't say it for sure, but I have an idea what it could be. It is possible, that you are missing the development package for unixodbc, it has probably a name similar to unixodbc-dev or unixodbc-devel. This package usually contains the missing header files.

markheckmann commented 1 year ago

I saw that the dev lib is required on linux, but was not able to find one for MacOS on brew (neither unixodbc-dev or unixodbc-devel are available).

Hence, I installed unixODBC again from source as described here. After that, the exasol R package can be installed succesfully πŸš€πŸš€πŸš€

However, now a new problem arises: A lib is not found, though the path seems correct. πŸ’€πŸ’€πŸ’€

> con <- exasol::dbConnect(drv="exa", dsn="EXASolution Driver", uid="xxx", pwd="xxx")  
...
1: In odbcDriverConnect(con_str) :
  [RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib '/Users/markheckmann/Library/ODBC/EXASolution ODBC.bundle/Contents/MacOS/libexaodbc-io418sys.dylib' : file not found
...

However, the file exists:

markheckmann~$ls "/Users/markheckmann/Library/ODBC/EXASolution ODBC.bundle/Contents/MacOS" | grep libexaodbc-io418sys.dylib
libexaodbc-io418sys.dylib

Any ideas?

tkilias commented 1 year ago

Hi @markheckmann ,

Good to here, that you could solve the header issue. Maybe the header files are not included in newer brew packages.

Regarding your new issue. I see one thing, that might cause an issue. Your path contains a space, this is often a cause for such issues. However, this is only a guess.

Another thing you could check is the permissions of the file with:

ls -l /Users/markheckmann/Library/ODBC/EXASolution ODBC.bundle/Contents/MacOS/libexaodbc-io352fw.dylib

tkilias commented 1 year ago

Hi @markheckmann,

Do you further help, or can I close this issue?

markheckmann commented 1 year ago

I have not solved it yet. Also, I am currently on vacation. I would be glad if the issue could remain open for 2 more weeks until I can get back to it. Thanks! :)

tkilias commented 1 year ago

I will leave it open, until you are back.

tkilias commented 11 months ago

Hello @markheckmann,

Any updates on this topic, or can we close this ticket?

Majid-Eismann commented 11 months ago

@tkilias ; I have the same issue using a docker container rocker/rstudio arm64 (Ubuntu) with the latest Exasol Driver (EXASOL_ODBC-7.1.22):

Error in odbcGetInfo(con) : argument is not an open RODBC channel In addition: Warning messages: 1: In odbcDriverConnect(con_str) : [RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib 'EXASolution Driver' : file not found 2: In odbcDriverConnect(con_str) : ODBC connection failed

running

DBI::dbConnect(
  "exa",
  exahost    = "xxx",
  uid        = "xxx",
  pwd        = "xxx",
  encryption = "Y"
)

Error in odbcGetInfo(con) : argument is not an open RODBC channel In addition: Warning messages: 1: In odbcDriverConnect(con_str) : [RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib '/EXASolution_ODBC-7.1.22/lib/linux/x86_64/libexaodbc-uo2214lv2.so' : file not found 2: In odbcDriverConnect(con_str) : ODBC connection failed

running

DBI::dbConnect(drv = "exa", dsn ="exasolution-uo2214lv2_64", encryption = "Y")

Permissions seems to be correct:

ls -l /EXASolution_ODBC-7.1.22/lib/darwin/x86_64/libexaodbc-io352fw.dylib

-rwxr-xr-x 1 10448 users 507380 Jul 22 06:53 /EXASolution_ODBC-7.1.22/lib/darwin/x86_64/libexaodbc-io352fw.dylib

I would appreciate your help!

tkilias commented 10 months ago

@Majid-Eismann this looks like a different issue, can you open an issue and copy your issue there?