2020-04-02 19:11:19 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e -x
|
|
|
|
|
|
|
|
amarisoft_tgz="$1"
|
|
|
|
|
2020-04-03 15:45:42 +00:00
|
|
|
BUILD_AMARISOFT_TRX_ZMQ="${BUILD_AMARISOFT_TRX_ZMQ:-1}"
|
2020-07-13 13:52:19 +00:00
|
|
|
HAVE_AMARISOFT_LTEUE="${HAVE_AMARISOFT_LTEUE:-1}"
|
2020-04-03 15:45:42 +00:00
|
|
|
|
2020-04-02 19:11:19 +00:00
|
|
|
if [ ! -f "$amarisoft_tgz" ]; then
|
|
|
|
echo "Amarisoft tgz doesn't exist: $amarisoft_tgz"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
base="$PWD"
|
2020-04-03 15:45:42 +00:00
|
|
|
if [ "x${BUILD_AMARISOFT_TRX_ZMQ}" = "x1" ]; then
|
|
|
|
name="srslte"
|
|
|
|
git_url="${git_url:-https://github.com/srsLTE}"
|
|
|
|
project_name_srslte="${project_name:-srsLTE}"
|
2020-07-13 13:44:20 +00:00
|
|
|
branch="master"
|
2020-04-03 15:45:42 +00:00
|
|
|
. "$(dirname "$0")/jenkins-build-common.sh"
|
2020-04-02 19:11:19 +00:00
|
|
|
|
2020-04-03 15:45:42 +00:00
|
|
|
#TODO: make sure libconfig, zeroMQ is installed
|
2020-07-13 13:44:20 +00:00
|
|
|
build_repo $project_name_srslte $branch -DENABLE_UHD=False -DENABLE_BLADERF=False -DENABLE_SOAPYSDR=False -DENABLE_ZEROMQ=True
|
2020-04-02 19:11:19 +00:00
|
|
|
|
2020-04-03 15:45:42 +00:00
|
|
|
git_url="git@github.com:softwareradiosystems"
|
|
|
|
project_name_zmq="amarisoft_dummy_trx"
|
|
|
|
branch="trx_zmq"
|
|
|
|
have_repo $project_name_zmq $branch
|
|
|
|
cd $project_name_zmq
|
|
|
|
rm -rf build && mkdir build && cd build || exit 1
|
|
|
|
cmake -DSRSLTE_BUILD_PATH=${base}/${project_name_srslte}/build ../
|
|
|
|
make -j8
|
|
|
|
cd $base
|
|
|
|
fi
|
2020-04-02 19:11:19 +00:00
|
|
|
|
|
|
|
rm -rf inst-tmp && mkdir inst-tmp
|
|
|
|
rm -rf inst-tmp-uhd && mkdir inst-tmp-uhd
|
|
|
|
tar -zxf $amarisoft_tgz -C inst-tmp/
|
2021-03-23 11:33:08 +00:00
|
|
|
for file in inst-tmp/*/trx_uhd*.tar.gz; do tar -zxf "$file" -C inst-tmp/; done
|
2020-04-02 19:11:19 +00:00
|
|
|
|
|
|
|
# Build trx_uhd.so:
|
2021-03-23 11:33:08 +00:00
|
|
|
for path in ${base}/inst-tmp/trx_uhd-linux*/; do (cd "$path"; make; cd ${base}); done
|
2020-04-02 19:11:19 +00:00
|
|
|
|
|
|
|
# Create amarisoftenb inst:
|
|
|
|
rm -rf inst-amarisoftenb && mkdir inst-amarisoftenb || exit 1
|
|
|
|
tar --strip-components=1 -zxf inst-tmp/*/lteenb-linux*.tar.gz -C inst-amarisoftenb/
|
2020-04-03 15:45:42 +00:00
|
|
|
if [ "x${BUILD_AMARISOFT_TRX_ZMQ}" = "x1" ]; then
|
2021-03-23 11:33:08 +00:00
|
|
|
cp ${base}/${project_name_srslte}/build/lib/src/phy/rf/libsrsran_rf.so inst-amarisoftenb/
|
|
|
|
cp ${base}/${project_name_zmq}/build/libtrx_zmq-linux-2021-03-15.so inst-amarisoftenb/trx_zmq.so
|
2020-04-06 14:32:11 +00:00
|
|
|
patchelf --set-rpath '$ORIGIN/' inst-amarisoftenb/trx_zmq.so
|
2021-03-23 11:33:08 +00:00
|
|
|
cd inst-amarisoftenb && ln -s libsrsran_rf.so libsrsran_rf.so.0 && cd ..
|
2020-04-03 15:45:42 +00:00
|
|
|
fi
|
2021-03-23 11:33:08 +00:00
|
|
|
|
|
|
|
# Untar trx_sdr and copy the libraries to enb.
|
|
|
|
tar -xzf inst-tmp/*/trx_sdr*.tar.gz -C inst-tmp/
|
|
|
|
cp ${base}/inst-tmp/trx_sdr-linux-2021-03-15/trx_sdr.so inst-amarisoftenb/
|
|
|
|
cp ${base}/inst-tmp/trx_sdr-linux-2021-03-15/libsdr.so inst-amarisoftenb/
|
|
|
|
cp ${base}/inst-tmp/trx_sdr-linux-2021-03-15/libc_wrapper_sdr.so inst-amarisoftenb/
|
|
|
|
|
|
|
|
# Copy the uhd library and create the tarball.
|
|
|
|
cp ${base}/inst-tmp/trx_uhd-linux-2021-03-15/trx_uhd.so inst-amarisoftenb/
|
2020-04-02 19:11:19 +00:00
|
|
|
this="amarisoftenb.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"
|
|
|
|
tar="${this}.tgz"
|
|
|
|
tar -czf "$tar" -C inst-amarisoftenb/ .
|
|
|
|
md5sum "$tar" > "${this}.md5"
|
|
|
|
|
|
|
|
# Create amarisoftue inst:
|
2020-07-13 13:52:19 +00:00
|
|
|
if [ "x${HAVE_AMARISOFT_LTEUE}" = "x1" ]; then
|
|
|
|
rm -rf inst-amarisoftue && mkdir inst-amarisoftue || exit 1
|
2021-03-23 11:33:08 +00:00
|
|
|
tar --strip-components=1 -zxf inst-tmp/*/lteue-linux-2018-10-18.tar.gz -C inst-amarisoftue/
|
2020-07-13 13:52:19 +00:00
|
|
|
if [ "x${BUILD_AMARISOFT_TRX_ZMQ}" = "x1" ]; then
|
2021-03-23 11:33:08 +00:00
|
|
|
cp ${base}/${project_name_srslte}/build/lib/src/phy/rf/libsrsran_rf.so inst-amarisoftue/
|
2020-07-13 13:52:19 +00:00
|
|
|
cp ${base}/${project_name_zmq}/build/libtrx_zmq-linux-2018-10-18.so inst-amarisoftue/trx_zmq.so
|
|
|
|
patchelf --set-rpath '$ORIGIN/' inst-amarisoftue/trx_zmq.so
|
2021-03-23 11:33:08 +00:00
|
|
|
cd inst-amarisoftue && ln -s libsrsran_rf.so libsrsran_rf.so.0 && cd ..
|
2020-07-13 13:52:19 +00:00
|
|
|
fi
|
2021-03-23 11:33:08 +00:00
|
|
|
cp ${base}/inst-tmp/trx_uhd-linux-2018-10-18/trx_uhd.so inst-amarisoftue/
|
2020-07-13 13:52:19 +00:00
|
|
|
this="amarisoftue.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"
|
|
|
|
tar="${this}.tgz"
|
|
|
|
tar -czf "$tar" -C inst-amarisoftue/ .
|
|
|
|
md5sum "$tar" > "${this}.md5"
|
2020-04-03 15:45:42 +00:00
|
|
|
fi
|
2020-04-02 19:11:19 +00:00
|
|
|
|
|
|
|
# Create amarisoftepc inst:
|
|
|
|
rm -rf inst-amarisoftepc && mkdir inst-amarisoftepc || exit 1
|
|
|
|
tar --strip-components=1 -zxf inst-tmp/*/ltemme-linux*.tar.gz -C inst-amarisoftepc/
|
2021-03-23 11:33:08 +00:00
|
|
|
|
|
|
|
# place newer libssl-1.1 and libcrypto-1.1 for older OS distributions inside the EPC folder
|
|
|
|
cp inst-tmp/*/libs/libssl* inst-amarisoftepc/
|
|
|
|
cp inst-tmp/*/libs/libcrypto* inst-amarisoftepc/
|
|
|
|
|
2021-03-08 15:03:26 +00:00
|
|
|
# Copy ltesim_server from UE package if available
|
|
|
|
if [ "x${HAVE_AMARISOFT_LTEUE}" = "x1" ]; then
|
2021-03-23 11:33:08 +00:00
|
|
|
# Untar newer lteue version for fresh ltesim_server (2018 uses libssl-1.0.0)
|
|
|
|
rm -rf inst-amarisoftue && mkdir inst-amarisoftue || exit 1
|
|
|
|
tar --strip-components=1 -zxf inst-tmp/*/lteue-linux-2021-03-15.tar.gz -C inst-amarisoftue/
|
2021-03-08 15:03:26 +00:00
|
|
|
cp inst-amarisoftue/ltesim_server inst-amarisoftepc/
|
|
|
|
fi
|
2020-04-02 19:11:19 +00:00
|
|
|
this="amarisoftepc.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"
|
|
|
|
tar="${this}.tgz"
|
|
|
|
tar -czf "$tar" -C inst-amarisoftepc/ .
|
|
|
|
md5sum "$tar" > "${this}.md5"
|