diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db84160d4d19991b634f3c03c5f1d5efc53ff85c..123cc0f98b79b5fa93c8fc6e841ce1323c44505f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ ubuntu_boost_system: - cp exprtk/exprtk.hpp /usr/include - export TERM=xterm - cd build_scripts/linux - - ./linux_gcc_build_x64_debug.sh + - ./linux_gcc_build_x64_debug_system.sh script: - './linux_run_tests.sh' diff --git a/build_scripts/linux/linux_gcc_build_x64_debug.sh b/build_scripts/linux/linux_gcc_build_x64_debug.sh index 9f010bf5b8e1f837cf665b455005e8d79b271500..bdd5c826f2bb605b720e46cee54b8440ac088659 100755 --- a/build_scripts/linux/linux_gcc_build_x64_debug.sh +++ b/build_scripts/linux/linux_gcc_build_x64_debug.sh @@ -15,8 +15,8 @@ BUILD_TESTS=yes BUILD_LIB=yes # C++ compiler -CXX_COMPILER="g++ -fPIC" -C_COMPILER="gcc -fPIC" +CXX_COMPILER="g++" +C_COMPILER="gcc" #**********************DO NOT CHANGE BEYOND THIS LINE**************************************** @@ -75,7 +75,7 @@ then cd external_dependencies/boost - ./b2 cxxflags=-fPIC --layout=system variant=debug link=static address-model=64 --with-system --with-serialization --with-random + ./b2 cxxflags=-fPIC --layout=system variant=debug link=${DEPENDENCIES_LINK_TYPE} address-model=64 --with-system --with-serialization --with-random # ./b2 --layout=system variant=debug link=shared address-model=64 --with-system --with-serialization --with-random cd ../../build_scripts/linux diff --git a/build_scripts/linux/linux_gcc_build_x64_debug_system.sh b/build_scripts/linux/linux_gcc_build_x64_debug_system.sh new file mode 100755 index 0000000000000000000000000000000000000000..eb349e30127c0aa508c29896ca248e7ba3d056b2 --- /dev/null +++ b/build_scripts/linux/linux_gcc_build_x64_debug_system.sh @@ -0,0 +1,105 @@ +#!/bin/sh + +clear + +# Should we rebuild BOOST? (yes/no) +REBUILD_BOOST=no + +# Should we build the examples? (yes/no) +BUILD_EXAMPLES=yes + +# Should we build the unit-tests? (yes/no) +BUILD_TESTS=yes + +# Should we build the lib4neuro library? (yes) +BUILD_LIB=yes + +# C++ compiler +CXX_COMPILER="g++" +C_COMPILER="gcc" + +#**********************DO NOT CHANGE BEYOND THIS LINE**************************************** + +RED='\033[0;31m' +CYAN='\033[0;36m' +YELLOW='\033[1;33m' +GREEN='\033[0;32m' +WHITE='\033[1;37m' +NC='\033[0m' # No Color +echo "Building the '${CYAN}lib4neuro${NC}' project for ${WHITE}Debug${NC}" + + +BUILD_SOMETHING=no +BUILD_SOMETHING_LIB=no + +if [ $BUILD_LIB = "yes" ] +then + echo "${CYAN}lib4neuro${NC} build type: ${WHITE}Debug${NC}" + echo "${CYAN}lib4neuro${NC} build architecture: ${WHITE}x64${NC}" + echo "${CYAN}lib4neuro${NC} will be built in '${YELLOW}build/lib/${NC}'" + BUILD_SOMETHING=yes + BUILD_SOMETHING_LIB=yes +fi + +if [ $BUILD_TESTS = "yes" ] +then + echo "${CYAN}lib4neuro${NC} unit tests will be built in '${YELLOW}build/unit-tests${NC}'" + BUILD_SOMETHING=yes + BUILD_SOMETHING_LIB=yes +fi + +if [ $BUILD_EXAMPLES = "yes" ] +then + echo "${CYAN}lib4neuro${NC} examples will be built in '${YELLOW}build/examples${NC}'" + BUILD_SOMETHING=yes + BUILD_SOMETHING_LIB=yes +fi + +if [ $REBUILD_BOOST = "yes" ] +then + echo "The required '${CYAN}BOOST${NC}' library will be recompiled in the directory '${YELLOW}external_dependencies/boost${NC}'" + BUILD_SOMETHING=yes + BUILD_SOMETHING_LIB=yes +fi + + +# Clean locally stored external dependencies +rm -rf ${BOOST_ROOT}/external_dependencies/boost/* +rm -rf ${BOOST_ROOT}/external_dependencies/exprtk/* + +if [ $BUILD_SOMETHING_LIB = "yes" ] +then + + if [ $BUILD_LIB = "yes" ] + then + ./linux_clean_lib.sh + fi + + if [ $BUILD_EXAMPLES = "yes" ] + then + ./linux_clean_examples.sh + fi + + if [ $BUILD_TESTS = "yes" ] + then + ./linux_clean_tests.sh + fi + + clear + echo "Building the '${CYAN}lib4neuro${NC}' project for ${WHITE}Debug${NC} (preparing makefiles)" + + + cd ../.. + + cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DCMAKE_C_COMPILER=${C_COMPILER} -DBOOST_ROOT=${BOOST_ROOT} -DBOOST_LIBRARYDIR=${BOOST_LIBRARYDIR} -DBOOST_INCLUDEDIR=${BOOST_INCLUDEDIR} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_LIB=${BUILD_LIB} -DLIB4NEURO_DIR=${PWD}/build/lib . + + echo "Building the '${CYAN}lib4neuro${NC}' project for ${WHITE}Debug${NC} (building)" + ( cmake --build . --config Debug -- -j${N_CORES} 2> build.log ) && ( echo "${GREEN}Build complete${NC}." ) || ( echo "${RED}Build finished with errors${NC}!"; exit 1; ) + + cd build_scripts/linux + + ./linux_clean_garbage.sh +fi + + +