Skip to content

Instantly share code, notes, and snippets.

@Geesu
Created February 20, 2017 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Geesu/a4e02b029309e58bfa009b5c46022a95 to your computer and use it in GitHub Desktop.
Save Geesu/a4e02b029309e58bfa009b5c46022a95 to your computer and use it in GitHub Desktop.
Compiling MaxScale 2.0 branch on Ubuntu 16.04.2
# Avro C prereqs
# https://github.com/grisha/json2avro/blob/master/avro-c/INSTALL
apt-get install cmake g++ pkg-config asciidoc libsnappy-dev libboost-dev libboost-filesystem-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev
# Install jansson 2.3.x
wget http://www.digip.org/jansson/releases/jansson-2.3.1.tar.gz
tar -xzvf jansson-2.3.1.tar.gz
cd jansson-2.3.1
./configure
make && make install && ldconfig
# Install avro C library
wget http://apache.claz.org/avro/avro-1.8.1/c/avro-c-1.8.1.tar.gz
tar -xzvf avro-c-1.8.1.tar.gz
cd avro-c-1.8.1
./build.sh test
./build.sh dist
cd /home/build/c/
make && make test && make install
# Compiling MaxScale
sudo apt-get install libsqlite3-dev build-essential libssl-dev libaio-dev ncurses-dev bison cmake perl libtool librabbitmq-dev libcurl4-openssl-dev libpcre3-dev
mkdir build
cd build
cmake ../MaxScale -DBUILD_TESTS=Y -DBUILD_AVRO=Y
make
# Error:
[ 66%] Linking C shared library libavrorouter.so
/usr/bin/ld: /usr/local/lib/libavro.a(datafile.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavro.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
server/modules/routing/avro/CMakeFiles/avrorouter.dir/build.make:257: recipe for target 'server/modules/routing/avro/libavrorouter.so.1.0.0' failed
make[2]: *** [server/modules/routing/avro/libavrorouter.so.1.0.0] Error 1
CMakeFiles/Makefile2:1963: recipe for target 'server/modules/routing/avro/CMakeFiles/avrorouter.dir/all' failed
make[1]: *** [server/modules/routing/avro/CMakeFiles/avrorouter.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
@sanfx
Copy link

sanfx commented Nov 26, 2020

were you able to compile it finally ?

@Geesu
Copy link
Author

Geesu commented Nov 26, 2020

Honestly I don't know - this was 4 years ago :/ I wouldn't try this on ubuntu 16 anymore. I'd do 18 or 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment