Skip to content
Snippets Groups Projects
Commit b1e56809 authored by Michal Kravcenko's avatar Michal Kravcenko
Browse files

FIX: fixed compilation under LINUX

parent b2a16705
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
clear
RED='\033[0;31m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo "Downloading '${CYAN}lib4neuro${NC}' project dependencies"
# Should we download BOOST? (yes/no)
DOWNLOAD_DEP=yes
if [ $DOWNLOAD_DEP = "yes" ]
then
echo "The required libraries will be downloaded from the official repositories into the directory '${YELLOW}external_dependencies${NC}'"
cd ../..
rm -r external_dependencies
git submodule init
git submodule update --remote
cd external_dependencies/boost
git submodule update --init
./bootstrap.sh
cd ../../build_scripts/linux
echo "${GREEN}External dependencies download \& bootstrapping finished${NC}"
fi
#!/bin/sh
cd ../..
rm -r build/examples
cd build_scripts/linux
\ No newline at end of file
#!/bin/sh
cd ../..
rm -rf Makefile
rm -rf docs/*
rm -f src/*TestRunner*
rm -f src/*.o src/*.mod
rm -f src/funit.tmp src/*_fun.f90
rm -f CMakeCache.txt
rm -f cmake_install.cmake src/cmake_install.cmake
rm -rf CMakeFiles src/CMakeFiles src/examples/CMakeFiles src/tests/CMakeFiles build/CMakeFiles build/examples/CMakeFiles build/unit-tests/CMakeFiles
rm -f build/Makefile build/examples/Makefile build/unit-tests/Makefile build/cmake_install.cmake build/examples/cmake_install.cmake build/unit-tests/cmake_install.cmake
mv build/examples/bin/* build/examples
mv build/unit-tests/bin/* build/unit-tests
rm -rf build/examples/bin build/unit-tests/bin
cd build_scripts/linux
\ No newline at end of file
#!/bin/sh
cd ../..
rm -r build/lib
cd build_scripts/linux
\ No newline at end of file
#!/bin/sh
cd ../..
rm -rf build/unit-tests
cd build_scripts/linux
\ No newline at end of file
#!/bin/sh
clear
# Should we rebuild BOOST? (yes/no)
REBUILD_BOOST=yes
# 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
# Boost rebuild
if [ $REBUILD_BOOST = "yes" ]
then
clear
echo "Rebuilding '${CYAN}BOOST${NC}' for ${WHITE}Debug${NC}"
cd ../..
rm -r external_dependencies/boost/stage
rm -r external_dependencies/boost/bin.v2
cd external_dependencies/boost
./b2 --layout=system variant=debug link=shared 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
fi
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
#!/bin/sh
cd ../..
##############
# UNIT TESTS #
##############
for f in build/unit-tests/*_test; do
${f} || exit -1
done
cd build_scripts/linux
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment