GithubHelp home page GithubHelp logo

openwrt-packages's Introduction

librdkafka for OpenWrt

host machine: Ubuntu 14.04

target machine: mipsel

librdkafka version: v0.9.5

1. install librdkafka library

  1. Add src-git librdkafka https://github.com/ifding/openwrt-librdkafka.git to your feeds.conf

  2. Update the feed: ./scripts/feeds update librdkafka

  3. And then install it: ./scripts/feeds install librdkafa

  4. Now your package should be aviable when you do: make menuconfig

  5. Because the librdkafka including sc-cpp and examples, it is not easy to cross-compile them together, it will be buggy. So it'd just compile the librdkafka. To do this, you should remove the src-cpp and examples from the Makefile, I also comments the tests. It is like this:

$ vi ~/Downloads/openwrt/build_dir/target-mipsel_24kec+dsp_musl-1.1.16/librdkafka-0.9.5/Makefile
LIBSUBDIRS=	src

CHECK_FILES+=	CONFIGURATION.md

PACKAGE_NAME?=	librdkafka
VERSION?=	$(shell python packaging/get_version.py src/rdkafka.h)

# Jenkins CI integration
BUILD_NUMBER ?= 1

.PHONY:

all: mklove-check libs CONFIGURATION.md check

include mklove/Makefile.base

libs:
	@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d || exit $?; done)

CONFIGURATION.md: src/rdkafka.h
	@printf "$(MKL_YELLOW)Updating$(MKL_CLR_RESET)\n"
	@echo '//@file' > CONFIGURATION.md.tmp
	@(cmp CONFIGURATION.md CONFIGURATION.md.tmp || \
		mv CONFIGURATION.md.tmp CONFIGURATION.md; \
		rm -f CONFIGURATION.md.tmp)

file-check: CONFIGURATION.md LICENSES.txt
check: file-check
	@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d $@ || exit $?; done)

install:
	@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d $@ || exit $?; done)

#tests: .PHONY libs
#	$(MAKE) -C $@

docs:
	doxygen Doxyfile
	@echo "Documentation generated in staging-docs"

clean-docs:
	rm -rf staging-docs

clean:
#	@$(MAKE) -C tests $@
	@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d $@ ; done)

distclean: clean
	./configure --clean
	rm -f config.log config.log.old

archive:
	git archive --prefix=$(PACKAGE_NAME)-$(VERSION)/ \
		-o $(PACKAGE_NAME)-$(VERSION).tar.gz HEAD
	git archive --prefix=$(PACKAGE_NAME)-$(VERSION)/ \
		-o $(PACKAGE_NAME)-$(VERSION).zip HEAD

rpm: distclean
	$(MAKE) -C packaging/rpm

LICENSES.txt: .PHONY
	@(for i in LICENSE LICENSE.* ; do (echo "$$i" ; echo "--------------------------------------------------------------" ; cat $$i ; echo "" ; echo "") ; done) > [email protected]
	@cmp $@ [email protected] || mv [email protected] $@ ; rm -f [email protected]
  1. make V=s

2. install librdkafka example

Let's say the name of app is: kafkaClient

2.1 Create Makefile

$ mkdir package/kafkaClient
$ cd package/kafkaClient
$ vi Makefile

Note: package/kafkaClient/Makefile

2.2 Create src dir

$ mkdir src
$ vi Makefile

Note: package/kafkaClient/src/Makefile

Next, copy examples/rdkafka_example.c and libkafka.h to src

$ cp build_dir/target-mipsel_24kec+dsp_musl-1.1.16/librdkafka-0.9.5/examples/rdkafka_example.c package/kafkaClient/src
$ cp build_dir/target-mipsel_24kec+dsp_musl-1.1.16/librdkafka-0.9.5/src/rdkafka.h package/kafkaClient/src

2.3 Compile

$ make V=s

3. Reference

openwrt-packages's People

Stargazers

Roman avatar

Watchers

James Cloos avatar Fei Ding avatar

openwrt-packages's Issues

rdkafka_sasl_cyrus.c:39:23: fatal error: sasl/sasl.h: No such file or directory #1650

I want to cross-compile librdkafka for mipsel-openwrt-linux architecture using lede SDK toolchain mipsel-openwrt-linux-gcc and i gote the following error:

I'm Using Ubuntu 16.04LTS and librdkafka-0.9.5

here is the last part of the debug log:
after i run this command:
./scripts/feeds install librdkafka
The output:
WARNING: No feed for package 'libcrypto' found, maybe it's already part of the standard packages?

I ignored this warning message and i executed the make V=s command the following error occurred .

r/include -I/documents/source/staging_dir/target-mipsel_24kc_musl-1.1.16/usr/include -c rdkafka_sasl_cyrus.c -o rdkafka_sasl_cyrus.o
rdkafka_sasl_cyrus.c:39:23: fatal error: sasl/sasl.h: No such file or directory
compilation terminated.
../mklove/Makefile.base:77: recipe for target 'rdkafka_sasl_cyrus.o' failed
make[5]: *** [rdkafka_sasl_cyrus.o] Error 1
make[5]: Leaving directory '/documents/source/build_dir/target-mipsel_24kc_musl-1.1.16/librdkafka-0.9.5/src'
Makefile:20: recipe for target 'libs' failed
make[4]: *** [libs] Error 2
make[4]: Leaving directory '/documents/source/build_dir/target-mipsel_24kc_musl-1.1.16/librdkafka-0.9.5'
Makefile:63: recipe for target '/documents/source/build_dir/target-mipsel_24kc_musl-1.1.16/librdkafka-0.9.5/.built' failed
make[3]: *** [/documents/source/build_dir/target-mipsel_24kc_musl-1.1.16/librdkafka-0.9.5/.built] Error 2
make[3]: Leaving directory '/documents/source/feeds/librdkafka/librdkafka'
package/Makefile:105: recipe for target 'package/feeds/librdkafka/librdkafka/compile' failed
make[2]: *** [package/feeds/librdkafka/librdkafka/compile] Error 2
make[2]: Leaving directory '/documents/source'
package/Makefile:101: recipe for target '/documents/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile' failed
make[1]: *** [/documents/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.package_compile] Error 2
make[1]: Leaving directory '/documents/source'
/documents/source/include/toplevel.mk:205: recipe for target 'world' failed
make: *** [world] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.