build_examples


#!/bin/bash

PLATFORM=Linuxx64

# It is assumed this script is run from the location where ceda.tar.gz was unzipped
CEDA_PKG=`pwd`

# build artefats folder for building the examples which use the packaged ceda core libraries
BUILD_CEDA_EXAMPLES=$CEDA_PKG/../build_ceda_core_examples

echo "----------------- generate make files to build the ceda core examples --------------------"

mkdir -p $BUILD_CEDA_EXAMPLES/lib/$PLATFORM/Release
cp -r $CEDA_PKG/lib/$PLATFORM/Release/*.so $BUILD_CEDA_EXAMPLES/lib/$PLATFORM/Release

mkdir -p $BUILD_CEDA_EXAMPLES/build
cp $CEDA_PKG/examples/config/wsExamples.xcpp $BUILD_CEDA_EXAMPLES/build
cd $BUILD_CEDA_EXAMPLES/build

# Generate make files
$CEDA_PKG/lib/$PLATFORM/Release/Xcpp wsExamples.xcpp mode=gen

echo "----------------- build the ceda core examples --------------------"

# Make the release build (use d for the debug version)
make r

echo "----------------- run the ceda core examples --------------------"

echo "log files are written to $BUILD_CEDA_EXAMPLES/lib/$PLATFORM/Release"

cd $BUILD_CEDA_EXAMPLES/lib/$PLATFORM/Release
mkdir log

echo "exThread"
./exThread >log/exThread.txt

echo "exLss"
./exLss >log/exLss.txt

echo "exCedaScript"
./exCedaScript >log/exCedaScript.txt

echo "exObject"
./exObject >log/exObject.txt

echo "exPersistStore"
./exPersistStore >log/exPersistStore.txt

echo "exRmi"
./exRmi >log/exRmi.txt

echo "exOperation"
./exOperation >log/exOperation.txt

echo "exPython"
./exPython >log/exPython.txt

echo "exPython2"
./exPython2 >log/exPython2.txt