Commit f42df3ab authored by kra568's avatar kra568

FIX: fixed build on windows

parent b1e56809
#!/bin/sh
#------------#------------------------------------------------------------
# Parameters #
#------------#
# Build type (Release/Debug)
BUILD_TYPE=Debug
# Should the unit-tests be rebuilt? (yes/no)
BUILD_TESTS=yes
# Should the examples be rebuilt? (yes/no)
BUILD_EXAMPLES=yes
# Should the library itself be rebuilt? (yes/no)
BUILD_LIB=yes
# Location of the lib4neuro library file? (in case it was already compiled somewhere)
LIB4NEURO_BIN_DIR=build/lib
# C++ compiler
CXX_COMPILER="g++-8"
if [ -z "$BUILD_TYPE" ] || [ -z "$CXX_COMPILER" ]; then
(>&2 echo "Set, please, both BUILD_TYPE and CXX_COMPILER variables in the 'build.sh' script.")
exit 2
fi
$(pwd)/clean.sh
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=${LIB4NEURO_BIN_DIR} .
cmake --build . --config ${BUILD_TYPE} -- -j${N_CORES} && (tput setaf 2; echo "Build complete."; echo "For examples have a look at the folder build/bin/examples."; tput sgr 0; ) || (tput setaf 1; echo "Build finished with errors!"; tput sgr 0; exit 1;)
#!/bin/sh
#------------#------------------------------------------------------------
# Parameters #
#------------#
# Build type (Release/Debug)
BUILD_TYPE=Release
# C++ compiler
CXX_COMPILER=g++
if [ -z "$BUILD_TYPE" ] || [ -z "$CXX_COMPILER" ]; then
(>&2 echo "Set, please, both BUILD_TYPE and CXX_COMPILER variables in the 'build.sh' script.")
exit 2
fi
$(pwd)/clean.sh
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} .
cmake --build . --config ${BUILD_TYPE} -- -j${N_CORES} && (tput setaf 2; echo "Build complete."; echo "For examples have a look at the folder build/bin/examples."; tput sgr 0; ) || (tput setaf 1; echo "Build finished with errors!"; tput sgr 0; exit 1;)
......@@ -69,7 +69,7 @@ IF "%REBUILD_BOOST%"=="yes" (
cd external_dependencies\boost
.\b2 --layout=system variant=debug link=static address-model=64 --with-system --with-serialization --with-random --with-test
.\b2 --layout=system variant=debug link=static address-model=64 --with-system --with-serialization --with-random
cd ..\..\build_scripts\windows
)
......@@ -112,6 +112,7 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
xcopy /y build\lib\Debug\lib4neuro.lib build\lib 2>NUL
rmdir /s /q "build\lib\Debug" 2> NUL
rmdir /s /q "build\libboost_unit_test.dir" 2> NUL
cd build_scripts\windows
)
......
......@@ -69,7 +69,7 @@ IF "%REBUILD_BOOST%"=="yes" (
cd external_dependencies\boost
.\b2 --layout=system variant=release link=static address-model=64 --with-system --with-serialization --with-random --with-test
.\b2 --layout=system variant=release link=static address-model=64 --with-system --with-serialization --with-random
cd ..\..\build_scripts\windows
)
......
......@@ -6,5 +6,7 @@ cd ..\..
rmdir /s /q "build\lib" 2>NUL
rmdir /s /q "build\bin\Debug" 2>NUL
rmdir /s /q "build\bin\Release" 2>NUL
rmdir /s /q "build\libboost_unit_test.dir" 2>NUL
cd build_scripts\windows
\ No newline at end of file
@echo off
mytitle="Downloading 'lib4neuro' project dependencies"
echo -e '\033]2;'$mytitle'\007'
title Downloading 'lib4neuro' project dependencies
cls
......@@ -20,38 +18,29 @@ IF "%DOWNLOAD_DEP%"=="yes" (
rem Dependencies download
IF "%DOWNLOAD_DEP%"=="yes" (
echo %cd%
cd /d ..\..
echo %cd%
cd ..\..
rmdir /s /q "external_dependencies" 2>NUL
git submodule init
git submodule update --remote
git submodule init
git submodule update --remote
cd external_dependencies\boost
rem Submodules containing headers included in lib4neuro directly, but not required by serialization, system nor random
rem set BOOST_DEPENDENCIES_LIB4NEURO=libs/algorithm libs/range libs/concept_check libs/test libs/timer libs/exception
rem Submodules required by linked libraries serialization, system or random
rem set BOOST_DEPENDENCIES=libs/bind libs/container_hash libs/type_index libs/function libs/array libs/optional libs/integer libs/utility libs/move libs/detail libs/throw_exception tools/build libs/config libs/assert libs/predef libs/io libs/spirit libs/smart_ptr libs/static_assert libs/type_traits libs/mpl libs/core libs/preprocessor libs/iterator libs/winapi
rem Submodules required by lib4neuro
rem set BOOST_REQUIRED_LIBS=libs/serialization libs/system libs/random
rem echo Running 'submodule update --init %BOOST_DEPENDENCIES_LIB4NEURO% %BOOST_DEPENDENCIES% %BOOST_REQUIRED_LIBS%'
rem git submodule update --init libs/algorithm libs/exception libs/range libs/concept_check libs/test libs/timer libs/bind libs/container_hash libs/type_index libs/function libs/array libs/optional libs/integer libs/utility libs/move libs/detail libs/throw_exception tools/build libs/config libs/assert libs/predef libs/io libs/spirit libs/smart_ptr libs/static_assert libs/type_traits libs/mpl libs/core libs/preprocessor libs/iterator libs/winapi libs/serialization libs/system libs/random
git submodule update --init
echo %cd%
rem Submodules containing headers included in lib4neuro directly, but not required by serialization, system nor random
rem set BOOST_DEPENDENCIES_LIB4NEURO=libs/algorithm libs/range libs/concept_check libs/test libs/timer libs/exception
rem Submodules required by linked libraries serialization, system or random
rem set BOOST_DEPENDENCIES=libs/bind libs/container_hash libs/type_index libs/function libs/array libs/optional libs/integer libs/utility libs/move libs/detail libs/throw_exception tools/build libs/config libs/assert libs/predef libs/io libs/spirit libs/smart_ptr libs/static_assert libs/type_traits libs/mpl libs/core libs/preprocessor libs/iterator libs/winapi
rem Submodules required by lib4neuro
rem set BOOST_REQUIRED_LIBS=libs/serialization libs/system libs/random
rem echo Running 'submodule update --init %BOOST_DEPENDENCIES_LIB4NEURO% %BOOST_DEPENDENCIES% %BOOST_REQUIRED_LIBS%'
rem git submodule update --init libs/algorithm libs/exception libs/range libs/concept_check libs/test libs/timer libs/bind libs/container_hash libs/type_index libs/function libs/array libs/optional libs/integer libs/utility libs/move libs/detail libs/throw_exception tools/build libs/config libs/assert libs/predef libs/io libs/spirit libs/smart_ptr libs/static_assert libs/type_traits libs/mpl libs/core libs/preprocessor libs/iterator libs/winapi libs/serialization libs/system libs/random
git submodule update --init
echo %cd%
call bootstrap.bat
call bootstrap.bat
cd ..\..\build_scripts\windows
)
#!/bin/bash
rm -rf build
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
#!/bin/sh
rm -rf external_dependencies/boost/*
rm -rf external_dependencies/exprtk/*
#!/bin/sh
git submodule init
git submodule update --remote
cd external_dependencies/boost
git submodule init
git submodule update
cd ../..
#!/bin/bash
##############
# UNIT TESTS #
##############
for f in build/bin/unit-tests/*_test; do
${f} || exit -1
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment