piersharding / RSAP

SAP NW RFC connector for R
21 stars 16 forks source link

sapnwrfc.h not found issue #16

Closed t-perry closed 4 years ago

t-perry commented 4 years ago

I am coming across an issue where the package install is failing because sapnwrfc.h isn't being found, while trying to install on RHEL7

     checking sapnwrfc.h usability... no
     checking sapnwrfc.h presence... no
     checking for sapnwrfc.h... no
     configure: error: "SAPNWRFCSDK header sapnwrfc.h not found"

However, when I look at the path provided in the args ('--with-nwrfcsdk-include=/usr/local/sap/nwrfcsdk/include), I can see that the file is indeed there.

$ ls -ls /usr/local/sap/nwrfcsdk/include

      52 -rw-r--r-- 1 root root  52883 Jun 27  2017 sapdecf.h
     220 -rw-r--r-- 1 root root 222602 Jun 27  2017 sapnwrfc.h
     188 -rw-r--r-- 1 root root 189192 Jun 27  2017 sapuc.h
      24 -rw-r--r-- 1 root root  20950 Jun 27  2017 sapucx.h

I have tried changing permissions on the directory ( and file ) with no luck. Would there be any other prerequisites that could be causing this?

piersharding commented 4 years ago

Hi -

Could you try:

export NWRFCSDK_INCLUDE=/usr/local/sap/nwrfcsdk/include
export NWRFCSDK_LIBS=/usr/local/sap/nwrfcsdk/lib

Maybe there is a problem with the switch --with-nwrfcsdk-include being ignored? Cheers, Piers.

t-perry commented 4 years ago

Seems like you were correct. I took the approach of installing from within RStudio (a weird mirror error when I tried to do it through SSH).

Sys.setenv(NWRFCSDK_INCLUDE="/usr/local/sap/nwrfcsdk/include")
Sys.setenv(NWRFCSDK_LIBS="/usr/local/sap/nwrfcsdk/lib")
devtools::install_github('piersharding/RSAP', args=c("--configure-args='--with-nwrfcsdk-include=/usr/local/sap/nwrfcsdk/include --with-nwrfcsdk-lib=/usr/local/sap/nwrfcsdk/lib' --no-clean-on-error"))

Which gave me the successful output!

...
checking sapnwrfc.h usability... yes
checking sapnwrfc.h presence... yes
checking for sapnwrfc.h... yes
yes! we have libsapnwrfc
...

I can successfully pull data now!

Thanks for your help!