[zeromq-dev] cross-compile for PowerPC

Gary Crum gary.a.crum at nasa.gov
Mon Oct 17 20:11:30 CEST 2011


Hi everyone, I'm new to zeromq.  So far I like what I see.

I've been searching though the list on cross-compiling and I don't think
I found a final solution for the powerpc.  I just wanted to throw out
what has worked for me, and hopefully someone will find it helpful.

Below is an example of cross-compiling zeromq 2.1.x, hwserver.cpp and
hwclient.cpp (from the zguide) for the ppc440.  


My Setup:
Build Host: Ubuntu 11.04 64-Bit
Cross Compiler: Embedded Linux Development Kit 4.2 (ELDK)
Target: PPC405/PPC440 found in Xilinx Virtex 4 and 5 FPGA's
--this was tested on a Xilinx ML507 board.

Commands:
##setup the cross compiler
source /opt/eldk-4.2/eldk_init ppc_4xxFP

#setup the build directories and get the source
mkdir -p zmq/staging/bin
cd zmq
git clone https://github.com/zeromq/zeromq2-1.git
git clone https://github.com/imatix/zguide.git

#configure zeromq and make it
cd zeromq2-1
./autogen.sh

./configure --host=powerpc-unknown-linux-gnu CC=powerpc-linux-gcc    \
CXX=powerpc-linux-g++ --with-cpp --with-chat --without-documentation 

make
cd ..

##install into a 'staging' directory 
make -C zeromq2-1 DESTDIR=`pwd`/staging install


#cross compile the apps - point to the area where zmq was installed
powerpc-linux-g++ ./zguide/examples/C++/hwserver.cpp      \
-o ./staging/bin/hwserver -I./staging/usr/local/include/  \
-L./staging/usr/local/lib  -lzmq -lpthread  -luuid    

powerpc-linux-g++ ./zguide/examples/C++/hwclient.cpp      \
-o ./staging/bin/hwclient -I./staging/usr/local/include/  \
-L./staging/usr/local/lib  -lzmq -lpthread  -luuid


note: ELDK all ready provided the cross compile pthread and uuid libs

At this point, I rebuilt my ramdisk and copy over the contents
from ./staging into the root of my ramdisk.

I also needed to set the search library search path in the embedded
system.


Booting up my embedded linux board and executing the apps we see:

export LD_LIBRARY_PATH=/usr/local/lib
/bin/hwserver & 
/bin/hwclient
Connecting to hello world server...
Sending Hello 0...
Received Hello
Received World 0
Sending Hello 1...
Received Hello
<snip>



Thanks everyone and keep up the great work!
gary





More information about the zeromq-dev mailing list