fRanz
fRanz copied to clipboard
Working Travis Build
Making this mostly for commenting and help rather then testing the build. I'm in the process of testing the travis build on my forked repository, but it continues to fail R CMD CHECK, but passes on osx. It has to do with dynamic loading of the library
Error: package or namespace load failed for ‘fRanz’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/pboueri/fRanz.Rcheck/fRanz/libs/fRanz.so':
librdkafka++.so.1: cannot open shared object file: No such file or directory```
This has lead me down the path of correctly building multi-platform R packages and have been overwhelmed with the choice/can't get one to work. I have . opened #28 as a result
For posterity i think the reason it installs on mac and not linux is because
gcc -shared -dynamiclib -Wl,-install_name,/Users/pboueri/Repos/oss/fRanz/fRanz/inst/librdkafka/lib/librdkafka++.1.dylib RdKafka.o ConfImpl.o HandleImpl.o ConsumerImpl.o ProducerImpl.o KafkaConsumerImpl.o TopicImpl.o TopicPartitionImpl.o MessageImpl.o HeadersImpl.o QueueImpl.o MetadataImpl.o -o librdkafka++.1.dylib -L../src -lrdkafka -lstdc++
of the librdkafka compilation -install_name I think tells fRanz.so where librdfkaka++/.dylib is so when fRanz.so moves as part of the installation process , it still can reference it
Current options are in my mind:
- Figure out how to compile fRanz.so with librdkafka.a as part of it by overriding SHLIB like this: https://stackoverflow.com/a/31754107
- Put compiled librdkafka stuff in /inst and then figure out how to make a relative link against it in fRanz.so. thing to note here is that inst/ stuff is moved one level up when being installed
- Figure out if there’s a way to override install.packages.R to move both fRanz.so and librdfkafka.a/dylib/so to the installed libs dir and link locally
- Do the system level library linking thing