Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theres' no Makevars file in this repo #28

Open
Paxanator opened this issue May 19, 2019 · 4 comments
Open

Theres' no Makevars file in this repo #28

Paxanator opened this issue May 19, 2019 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Paxanator
Copy link
Collaborator

We need to add Makevars/Makevars.win in order to link against librdkafka. It should consist of two options:

  1. Link against a system include/library if already installed
  2. Pull and compile and build a librdkafka for the package itself locally

This should pass R CMD CHECK. For examples, refer to:
https://github.com/confluentinc/confluent-kafka-python/blob/master/tools/bootstrap-librdkafka.sh
http://dirk.eddelbuettel.com/code/rcpp.cranusers.html
https://stackoverflow.com/questions/50539270/writing-configure-file-for-an-r-package ... though everything i've read says autconf is not worth it

It's important to note the below has worked on mac but not CentOS

INSTALLDIR = $(shell pwd)

PKG_LIBS = -L$(INSTALLDIR)/librdkafka/src-cpp -lrdkafka++
PKG_CXXFLAGS = -std=c++11 -I$(INSTALLDIR)/librdkafka/src-cpp

.PHONY: all install_librdkadka

all: install_librdkadka

install_librdkadka:
	if [ ! -d $(INSTALLDIR)/librdkafka/src-cpp ] ; \
	then \
		mkdir -p $(INSTALLDIR)/librdkafka && \
		cd ../inst && \
		tar xzf librdkafka-1.0.0.tar.gz && \
		cd librdkafka-1.0.0 && \
		./configure --prefix="$(INSTALLDIR)/librdkafka"&& \
		$(MAKE) && \
		$(MAKE) install && \
		mv * $(INSTALLDIR)/librdkafka ; \
	fi

additionally it doesn't allow for just linking against a system lib if available

@Paxanator Paxanator added this to the cran initial release milestone May 19, 2019
@Paxanator Paxanator added bug Something isn't working help wanted Extra attention is needed labels May 19, 2019
@Paxanator
Copy link
Collaborator Author

I must say I don't have a good sense of the right way to go about doing this. Seems like there's a million options

@Paxanator
Copy link
Collaborator Author

Other option to look at:
https://github.com/r-dbi/RPostgres

Note the apt get libpq in their .travis.yml https://github.com/r-dbi/RPostgres/blob/master/.travis.yml#L56-L60

@Paxanator
Copy link
Collaborator Author

I would like to additionally link against avro too since there's a benefit of using same toolchain to build multiple things.

mjermann added a commit to mjermann/fRanz that referenced this issue May 26, 2019
@dselivanov
Copy link

As librdkafka is widely accessible with system package managers I believe having it as system dependency is much more easier and reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants