X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fe2apv1sim%2Fbuild_e2sim;fp=e2sim%2Fe2apv1sim%2Fbuild_e2sim;h=80a53c6c1825fac21401bd36a85a6bfbbcd17ab4;hp=0000000000000000000000000000000000000000;hb=0eba05c4ff0c99974d3f3a63b65cbe2adb209e51;hpb=c380e183231711cf9f8bc72d0eb52e532dd07085 diff --git a/e2sim/e2apv1sim/build_e2sim b/e2sim/e2apv1sim/build_e2sim new file mode 100755 index 0000000..80a53c6 --- /dev/null +++ b/e2sim/e2apv1sim/build_e2sim @@ -0,0 +1,86 @@ +#!/bin/bash +#/***************************************************************************** +# * +# Copyright 2019 AT&T Intellectual Property * +# Copyright 2019 Nokia * +# * +# Licensed under the Apache License, Version 2.0 (the "License"); * +# you may not use this file except in compliance with the License. * +# You may obtain a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, software * +# distributed under the License is distributed on an "AS IS" BASIS, * +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +# See the License for the specific language governing permissions and * +# limitations under the License. * +# * +#******************************************************************************/ + +set -e + +E2SIM_VERSION='1.4.0' +export E2SIM_DIR=$PWD +source $E2SIM_DIR/tools/build_helper.bash +DOCKER_IMAGE='e2sim' + +print_help() { + echo " + This program installs E2 Simulator + You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14 + The program is run by default with no option + + USAGE: + ./build_e2sim [OPTIONS] + + OPTIONS: + --clean + Erase all files to make a rebuild from start + --docker + Build docker image + -h + Print this help + " +} + +function main(){ + case "$1" in + --clean) + echo_info "Will clean all previously producted files under build/" + rm -rf $E2SIM_DIR/build + echo_success "Clean Done" + exit + ;; + + --docker) + echo "Will build docker image ${DOCKER_IMAGE}:${E2SIM_VERSION}" + sudo docker build -f docker/Dockerfile -t $DOCKER_IMAGE:$E2SIM_VERSION . + exit + ;; + + "") + ;; + + -h) + print_help + exit 1;; + + *) + echo_error "Unknown option $1" + exit + esac + + BUILD_DIR=$E2SIM_DIR/build + mkdir -p $BUILD_DIR + + echo_info "Will build e2sim" + cd $BUILD_DIR + rm -rf CMakeCache.txt + cmake .. + make -j`nproc` + + echo_success "e2sim compiled" +} + +main "$@"