m32 kdb using qserver compiled under m64?

Hi,

I’m following the instructions in kx svn to compile the qserver in osx. But I’m running m32 reseach license kdb on my imac. in R i can load qserver.R correctly however even when I load a table of 10 rows R session will crash. 

Is this an issue of using m64 qserver in m32 kdb? Or is it an R issue?

R version 3.0.2 

x86_64-apple-darwin10.8.0 (64-bit)

thanks

Chao

Hi Chao Li

The distributed osx qserver.so was compiled with R 2.15, and will work with kdb+ m32 and m64. 

I just tried compiling with R 3.02, and this also works with both m32 and m64. I will send you the .so in a separate message.

Chris

Hi

I am having some difficulty getting qserver working on OSX 10.10 with R 3.1.1 (Platform: x86_64-apple-darwin13.1.0 (64-bit)) and free trial kdb+ 3.2 (m32). Both R and kdb+ are working independently. I followed these steps to try and get qserver compiled:

  1. Downloaded cookbook_code/r/osx_qserver from svn and saved this at ~/r/osx_qserver

  2. Copied in to ~/r/osx_qserver: k.h (from svn kx/kdb+/c/c) and m64/c.o (from svn kx/kdb+/m64)

  3. Downloaded common.c and qserver.c from svn cookbook_code/r/c and saved to ~/r/c

  4. Ran make in ~/r/osx_qserver and had the following returned

==============================

/usr/bin/R CMD gcc -g -O -fpic -m64   -shared -D KXVER=3 -I. -I/Library/Frameworks/R.framework/Resources/include base.c c.o -lpthread -L/Library/Frameworks/R.framework/Resources/lib -lR -o qserver.so

In file included from base.c:13:

./../c/common.c:556:13: warning: using the result of an assignment as a condition without parentheses

      [-Wparentheses]

                if (table = ktd(x)) {

                    ^~

./../c/common.c:556:13: note: place parentheses around the assignment to silence this warning

                if (table = ktd(x)) {

                          ^

                    (             )

./../c/common.c:556:13: note: use ‘==’ to turn this assignment into an equality comparison

                if (table = ktd(x)) {

                          ^

                          ==

1 warning generated.

Undefined symbols for architecture x86_64:

  “___emutls_get_address”, referenced from:

      _clr in c.o

      _krr in c.o

      _orr in c.o

      _m5 in c.o

      _w1 in c.o

      _w0 in c.o

      _g8 in c.o

      …

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [all] Error 1

==============================

I am stuck at this point, any advice would be appreciated.

Thanks

The default gcc from Apple is not sufficient to build for kdb+.

Can you install GCC 4.8 from Homebrew?

e.g.

http://www-scf.usc.edu/~csci104/installation/gccmac.html

Thanks Charles. I got everything working fine. After installing GCC 4.8 the default was still the Apple version, so I changed the Makefile to refer to gcc-4.8. Is that the preferred way to do it, or should I used an alias or some other way to make the default compiler GCC 4.8?

it’s really up to whatever you personally prefer; both approaches work.