From ed186e13cde78086d9f86cfd9d680d0462e3b354 Mon Sep 17 00:00:00 2001 From: Viktor Kreschenski Date: Tue, 21 Jan 2020 09:17:29 +0100 Subject: [PATCH 1/5] Fix install deps and replace docker --- .travis.yml | 39 +++++++++++++++++++++++----- build-install-build-deps.sh | 52 ++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index baa1142..56a094f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,42 @@ +# Define Distribution +dist: bionic + # Use C++ build environment. language: cpp sudo: required -# We use docker-based builds to enable current Ubuntu LTS BuildEnv -services: - - docker +# Protobuf requires g++ (see https://github.com/google/protobuf/blob/master/src/README.md) +compiler: + - gcc +# Handle dependencies in separate directory. before_install: - - docker build -t osi-standard/osi-visualizer . + - DEPS_DIR="${HOME}/deps" + - mkdir -p "${DEPS_DIR}" + - cd "${DEPS_DIR}" + +# Install necessary packages. +install: + # Install a recent version of CMake + - | + CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz" + if [ ! -f ${DEPS_DIR}/cmake/bin/cmake ] ; then mkdir -p cmake ; travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake ; fi + export PATH=${DEPS_DIR}/cmake/bin:${PATH} + + # Install a recent version of the Protobuf + - | + PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz" + if [ ! -f ${DEPS_DIR}/protobuf/install/bin/protoc ] ; then mkdir -p protobuf ; travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf ; cd protobuf ; ./configure --prefix=${DEPS_DIR}/protobuf/install ; make ; make install ; fi + export PATH=${DEPS_DIR}/protobuf/install/bin:${PATH} + + +# Change directory back to default build directory. +before_script: + - cd "${TRAVIS_BUILD_DIR}" + - bash install-deps.sh + - bash build-install-build-deps.sh -# Run the build script. +# Run the build script script: - - docker run -it -v $(pwd):/project osi-standard/osi-visualizer /bin/sh -c "mkdir -p build && cd build && cmake .. && cmake --build ." + - bash build.sh diff --git a/build-install-build-deps.sh b/build-install-build-deps.sh index 08b8f34..4cdf81a 100644 --- a/build-install-build-deps.sh +++ b/build-install-build-deps.sh @@ -24,45 +24,37 @@ echo " mkdir -p fmi_library cd fmi_library -FMI_lib_version=2.0.2 - fmi_library_include_install_dir=/usr/local/include/fmi-library fmi_library_lib_install_dir=/usr/local/lib/fmi-library -if ! [ -e ${fmi_library_include_install_dir} -a -e ${fmi_library_lib_install_dir} ] +if ! [ -e ${fmi_library_include_install_dir} -a -e ${fmi_library_lib_install_dir} ] then -echo " -Downloading FMI library... -" + echo "Downloading FMI library..." -if [ ! -d $FMI_lib_version ] -then - wget --no-parent -nH --cut-dirs=2 -r https://svn.jmodelica.org/FMILibrary/tags/$FMI_lib_version/ -fi + if [ ! -d FMILibrary-2.0.2 ] + then + wget --no-parent -nH --cut-dirs=2 -r https://jmodelica.org/FMILibrary/FMILibrary-2.0.2-src.zip + fi -echo " -Building FMI library... -" - cd ${FMI_lib_version} + echo "Building FMI library..." + unzip FMILibrary-2.0.2-src.zip + cd FMILibrary-2.0.2 mkdir -p build cd build - cmake ../. -DCMAKE_BUILD_TYPE=RELEASE + cmake .. + make -j8 make -j8 install - cd .. - if [[ -d "install" ]] + cd ../install + + if [ ! -d ${fmi_library_include_install_dir} ] + then + sudo mkdir -p ${fmi_library_include_install_dir} + sudo cp -uvrf ./include/* ${fmi_library_include_install_dir}/ + fi + + if [ ! -d ${fmi_library_lib_install_dir} ] then - cd install - mkdir -p ${fmi_library_include_install_dir} - if [[ -d ${fmi_library_include_install_dir} ]] - then - cp -uvrf ./include/* ${fmi_library_include_install_dir}/ - fi - mkdir -p ${fmi_library_lib_install_dir} - if [[ -d ${fmi_library_lib_install_dir} ]] - then - cp -uvrf ./lib/* ${fmi_library_lib_install_dir}/ - fi - else - echo "Could not install the fmi-library into usr/local" + sudo mkdir -p ${fmi_library_lib_install_dir} + sudo cp -uvrf ./lib/* ${fmi_library_lib_install_dir}/ fi fi \ No newline at end of file From 8b262eb630ece79573f5efda931c41b9064e7429 Mon Sep 17 00:00:00 2001 From: Viktor Kreschenski Date: Tue, 21 Jan 2020 09:28:06 +0100 Subject: [PATCH 2/5] Add sudo to installation --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56a094f..0cdb2e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,8 @@ install: # Change directory back to default build directory. before_script: - cd "${TRAVIS_BUILD_DIR}" - - bash install-deps.sh - - bash build-install-build-deps.sh + - sudo bash install-deps.sh + - sudo bash build-install-build-deps.sh # Run the build script script: From 0c73628a3a4ae8d541202a230c11e5312bfa751a Mon Sep 17 00:00:00 2001 From: Viktor Kreschenski Date: Tue, 21 Jan 2020 09:43:14 +0100 Subject: [PATCH 3/5] Added update system --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0cdb2e2..899143b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ install: # Change directory back to default build directory. before_script: - cd "${TRAVIS_BUILD_DIR}" + - sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove - sudo bash install-deps.sh - sudo bash build-install-build-deps.sh From 9207890b71262c27f98f46c00dd2ae1325d423a9 Mon Sep 17 00:00:00 2001 From: Viktor Kreschenski Date: Tue, 21 Jan 2020 10:03:42 +0100 Subject: [PATCH 4/5] Remove newest protobuf installation --- .travis.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 899143b..a68db74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,13 +24,6 @@ install: if [ ! -f ${DEPS_DIR}/cmake/bin/cmake ] ; then mkdir -p cmake ; travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake ; fi export PATH=${DEPS_DIR}/cmake/bin:${PATH} - # Install a recent version of the Protobuf - - | - PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz" - if [ ! -f ${DEPS_DIR}/protobuf/install/bin/protoc ] ; then mkdir -p protobuf ; travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf ; cd protobuf ; ./configure --prefix=${DEPS_DIR}/protobuf/install ; make ; make install ; fi - export PATH=${DEPS_DIR}/protobuf/install/bin:${PATH} - - # Change directory back to default build directory. before_script: - cd "${TRAVIS_BUILD_DIR}" From 178b3d8dab28eb80a450cfa7b105e19130bdaf00 Mon Sep 17 00:00:00 2001 From: Viktor Kreschenski Date: Tue, 21 Jan 2020 11:32:02 +0100 Subject: [PATCH 5/5] Added libqt5opengl5 installation --- install-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-deps.sh b/install-deps.sh index b68f0ce..c67b4d9 100644 --- a/install-deps.sh +++ b/install-deps.sh @@ -42,4 +42,4 @@ echo " # Installing OpenGL ################################# " -apt-get install libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx -y +apt-get install libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libqt5opengl5-dev -y