Newer
Older
Martin Beseda
committed
#!/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
Martin Beseda
committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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 ../../external_dependencies/boost/*
rm -rf ../../external_dependencies/exprtk/*
Martin Beseda
committed
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_LIBRARYDIR=${BOOST_LIBRARYDIR} -DBOOST_INCLUDEDIR=${BOOST_INCLUDEDIR} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_LIB=${BUILD_LIB} -DLIB4NEURO_DIR=${PWD}/build/lib -DDEPENDENCIES_LINK_TYPE=${DEPENDENCIES_LINK_TYPE} .
Martin Beseda
committed
echo "Building the '${CYAN}lib4neuro${NC}' project for ${WHITE}Debug${NC} (building)"
( cmake --build . --config Debug -- -j${N_CORES} ) && ( echo "${GREEN}Build complete${NC}." ) || ( echo "${RED}Build finished with errors${NC}!"; exit 1; )
Martin Beseda
committed
cd build_scripts/linux
./linux_clean_garbage.sh
fi