KxSystems / rkdb

R client for kdb+
https://code.kx.com/q/interfaces
Apache License 2.0
41 stars 30 forks source link

Installation error #50

Closed stenevang closed 5 years ago

stenevang commented 5 years ago

Today, I tried installing the rkdb package by following the instructions on https://kx.com/blog/kdb-interface-r/

The result was as follows:

* installing *source* package 'rkdb' ...
** using staged installation
** libs

*** arch - i386
c:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG       -D_GNU_SOURCE   -O3 -Wall  -std=gnu99 -mtune=generic -c rkdb.c -o rkdb.o
In file included from rkdb.c:20:0:
common.c: In function 'from_list_of_kobjects':
common.c:202:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   utype= length > 0 ? kK(x)[0]->t : 0;
   ^
In file included from rkdb.c:15:0:
common.c: In function 'from_guid_kobject':
k.h:31:15: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness [-Wpointer-sign]
 #define kG(x) ((x)->G0)
               ^
k.h:32:15: note: in expansion of macro 'kG'
 #define kC(x) kG(x)
               ^
common.c:253:11: note: in expansion of macro 'kC'
   sprintf(kC(y),"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",gv[ 0],gv[ 1],gv[ 2],gv[ 3],gv[ 4],gv[ 5],gv[ 6],gv[ 7],gv[ 8],gv[ 9],gv[10],gv[11],gv[12],gv[13],gv[14],gv[15]);
           ^
In file included from C:/PROGRA~1/R/R-36~1.1/include/R.h:56:0,
                 from rkdb.c:7:
C:/Rtools/mingw_32/i686-w64-mingw32/include/stdio.h:379:15: note: expected 'char * restrict' but argument is of type 'G *'
   int __cdecl sprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
               ^
In file included from rkdb.c:20:0:
common.c: In function 'from_dictionary_kobject':
common.c:417:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   K table, k= kK(x)[0], v= kK(x)[1];
   ^
common.c:417:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
common.c: In function 'from_table_kobject':
common.c:441:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   PROTECT(names= from_any_kobject(kK(x->k)[0]));
   ^
common.c:442:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   PROTECT(result= from_columns_kobject(kK(x->k)[1]));
   ^
c:/Rtools/mingw_32/bin/gcc -shared -s -static-libgcc -o rkdb.dll tmp.def rkdb.o -Lw32 -le_static -lws2_32 -liphlpapi -LC:/PROGRA~1/R/R-36~1.1/bin/i386 -lR
C:/Rtools/mingw_32/bin/../lib/gcc/i686-w64-mingw32/4.9.3/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -le_static
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'rkdb'
cmccarthy1 commented 5 years ago

Hi,

Thanks for highlighting this. One quick questions just to narrow down the workflow here.

Is this your first time attempting to install via github on this repo? I think this may have been an issue for a while and all tests I've run so far suggest this to be the case but we had a minor update last week and want to check it wasn't caused by this on your end

It appears the problem is in linking to w64/e_static.lib within the repository.

I'm going to work on trying to fix the issue but in the interim can you try install via:

> devtools::install_github('kxsystems/rkdb@0.10.0', quiet=TRUE)

I tested this on a windows machine today and it should work for now. The primary difference between the two is the method for handling guids.

stenevang commented 5 years ago

Yes, first attempt.

This is the output of the alternative installation:

Error: Failed to install 'unknown package' from GitHub:
  HTTP error 404.
  No commit found for the ref 0.10.0

  Did you spell the repo owner (`kxsystems`) and repo name (`rkdb`) correctly?
  - If spelling is correct, check that you have the required permissions to access the repo.
> 
cmccarthy1 commented 5 years ago

Apologies mispelling in the above response and README.md you'll need to prepend the release with a v as below

> devtools::install_github('kxsystems/rkdb@v0.10.0', quiet=TRUE)

I'll update the README.md as appropriate

stenevang commented 5 years ago

Yes, that seems to have worked better:

> devtools::install_github('kxsystems/rkdb@v0.10.0', quiet=TRUE)
Your system is ready to build packages!
> 
cmccarthy1 commented 5 years ago

Perfect I'll update the README.md now to warn against running the windows build as you had it initially for now and update the install instructions from release.

I'll update here once a fix has been put in place for this issue

cmccarthy1 commented 5 years ago

I've updated the install instructions now which should fix the install_github instructions now. Please reopen if any further issues arise