Skip to content

Theres' no Makevars file in this repo #28

@Paxanator

Description

@Paxanator

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions