Commit fd7129a5 authored by kra568's avatar kra568

FIX: streamlined use of commands under the windows system + fixed cmake scripts on linux systems

parent 563ecf83
......@@ -47,11 +47,12 @@ ubuntu_2:
- ./download_dependencies.sh
- cd external_dependencies/boost
- ./bootstrap.sh || cat bootstrap.log
- ./b2 --layout=system variant=release link=shared address-model=64
- ./b2 --layout=system variant=release link=shared address-model=64 --with-system --with-serialization --with-random
- cd ../..
- export TERM=xterm
script:
- './build-ci.sh'
- './run_tests.sh'
......@@ -7,6 +7,18 @@
# 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"
......@@ -16,5 +28,5 @@ if [ -z "$BUILD_TYPE" ] || [ -z "$CXX_COMPILER" ]; then
fi
$(pwd)/clean.sh
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} .
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;)
......@@ -32,25 +32,25 @@ set BUILD_SOMETHING_LIB=no
IF "%BUILD_LIB%"=="yes" (
echo Lib4neuro build type: Debug
echo Lib4neuro build architecture: x64
echo Lib4neuro will be built in 'build/lib/'
echo Lib4neuro will be built in 'build\lib\'
set BUILD_SOMETHING=yes
set BUILD_SOMETHING_LIB=yes
)
IF "%BUILD_TESTS%"=="yes" (
echo Lib4neuro unit tests will be built in 'build/unit-tests'
echo Lib4neuro unit tests will be built in 'build\unit-tests'
set BUILD_SOMETHING=yes
set BUILD_SOMETHING_LIB=yes
)
IF "%BUILD_EXAMPLES%"=="yes" (
echo Lib4neuro examples will be built in 'build/examples'
echo Lib4neuro examples will be built in 'build\examples'
set BUILD_SOMETHING=yes
set BUILD_SOMETHING_LIB=yes
)
IF "%REBUILD_BOOST%"=="yes" (
echo The required BOOST library will be recompiled in the directory 'external_dependencies/boost'
echo The required BOOST library will be recompiled in the directory 'external_dependencies\boost'
set BUILD_SOMETHING=yes
)
......@@ -62,16 +62,16 @@ IF "%BUILD_SOMETHING%"=="yes" (
rem Boost rebuild
IF "%REBUILD_BOOST%"=="yes" (
title Rebuilding 'BOOST' for Debug
cd ../../
cd ..\..
rmdir /s /q external_dependencies\boost\stage 2>NUL
rmdir /s /q external_dependencies\boost\bin.v2 2>NUL
cd external_dependencies/boost
cd external_dependencies\boost
.\b2 --layout=system variant=debug link=static address-model=64 --with-system --with-serialization --with-random
cd ../../build_scripts/windows
cd ..\..\build_scripts\windows
)
IF "%BUILD_SOMETHING_LIB%"=="yes" (
......@@ -96,16 +96,16 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
set MAKEFILE_GENERATOR="Visual Studio 15 2017 Win64"
cd ../../
cd ..\..
cmake -G "Visual Studio 15 2017 Win64" -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=build\lib .
title Building the 'lib4neuro' project for Debug (building)
(cmake --build . --config Debug > build.log) && (echo "Build complete.") || (echo "Build finished with errors!")
cd build_scripts/windows
cd build_scripts\windows
IF "%BUILD_LIB%"=="yes" (
cd ../../
cd ..\..
rem Moving LIB files around to have a neater structure
xcopy /y build\bin\Debug\lib4neuro.dll build\lib 2>NUL
......@@ -113,35 +113,35 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
rmdir /s /q "build\lib\Debug" 2> NUL
cd build_scripts/windows
cd build_scripts\windows
)
IF "%BUILD_EXAMPLES%"=="yes" (
cd ../../
cd ..\..
rem Moving EXAMPLE files around to have a neater structure
mkdir build\tmp
xcopy /y build\examples\bin\Debug\*.exe build\tmp 2>NUL
rmdir /s /q "build\examples" 2> NUL
mv build\tmp build\examples
move build\tmp build\examples
xcopy /y build\lib\*.dll build\examples 2>NUL
cd build_scripts/windows
cd build_scripts\windows
)
IF "%BUILD_TESTS%"=="yes" (
cd ../../
cd ..\..
rem Moving EXAMPLE files around to have a neater structure
mkdir build\tmp
xcopy /y build\unit-tests\bin\Debug\*.exe build\tmp 2>NUL
rmdir /s /q "build\unit-tests" 2> NUL
mv build\tmp build\unit-tests
move build\tmp build\unit-tests
xcopy /y build\lib\*.dll build\unit-tests 2>NUL
cd build_scripts/windows
cd build_scripts\windows
)
call win_clean_garbage.bat
......
......@@ -13,16 +13,16 @@ set "BUILD_SOMETHING_LIB="
rem call VsDevCmd.bat
rem Should we rebuild BOOST? (yes/no)
set REBUILD_BOOST=no
set REBUILD_BOOST=yes
rem Should we build the examples? (yes/no)
set BUILD_EXAMPLES=no
set BUILD_EXAMPLES=yes
rem Should we build the unit-tests? (yes/no)
set BUILD_TESTS=no
set BUILD_TESTS=yes
rem Should we build the lib4neuro library? (yes)
set BUILD_LIB=no
set BUILD_LIB=yes
rem **********************DO NOT CHANGE BEYOND THIS LINE****************************************
......@@ -32,25 +32,25 @@ set BUILD_SOMETHING_LIB=no
IF "%BUILD_LIB%"=="yes" (
echo Lib4neuro build type: Release
echo Lib4neuro build architecture: x64
echo Lib4neuro will be built in 'build/lib/'
echo Lib4neuro will be built in 'build\lib\'
set BUILD_SOMETHING=yes
set BUILD_SOMETHING_LIB=yes
)
IF "%BUILD_TESTS%"=="yes" (
echo Lib4neuro unit tests will be built in 'build/unit-tests'
echo Lib4neuro unit tests will be built in 'build\unit-tests'
set BUILD_SOMETHING=yes
set BUILD_SOMETHING_LIB=yes
)
IF "%BUILD_EXAMPLES%"=="yes" (
echo Lib4neuro examples will be built in 'build/examples'
echo Lib4neuro examples will be built in 'build\examples'
set BUILD_SOMETHING=yes
set BUILD_SOMETHING_LIB=yes
)
IF "%REBUILD_BOOST%"=="yes" (
echo The required BOOST library will be recompiled in the directory 'external_dependencies/boost'
echo The required BOOST library will be recompiled in the directory 'external_dependencies\boost'
set BUILD_SOMETHING=yes
)
......@@ -62,16 +62,16 @@ IF "%BUILD_SOMETHING%"=="yes" (
rem Boost rebuild
IF "%REBUILD_BOOST%"=="yes" (
title Rebuilding 'BOOST' for Release
cd ../../
cd ..\..
rmdir /s /q external_dependencies\boost\stage 2>NUL
rmdir /s /q external_dependencies\boost\bin.v2 2>NUL
cd external_dependencies/boost
cd external_dependencies\boost
.\b2 --layout=system variant=release link=static address-model=64 --with-system --with-serialization --with-random
cd ../../build_scripts/windows
cd ..\..\build_scripts\windows
)
IF "%BUILD_SOMETHING_LIB%"=="yes" (
......@@ -96,16 +96,16 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
set MAKEFILE_GENERATOR="Visual Studio 15 2017 Win64"
cd ../../
cd ..\..
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release -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=build\lib .
title Building the 'lib4neuro' project for Release (building)
(cmake --build . --config Release > build.log) && (echo "Build complete.") || (echo "Build finished with errors!")
cd build_scripts/windows
cd build_scripts\windows
IF "%BUILD_LIB%"=="yes" (
cd ../../
cd ..\..
rem Moving LIB files around to have a neater structure
xcopy /y build\bin\Release\lib4neuro.dll build\lib 2>NUL
......@@ -113,35 +113,35 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
rmdir /s /q "build\lib\Release" 2> NUL
cd build_scripts/windows
cd build_scripts\windows
)
IF "%BUILD_EXAMPLES%"=="yes" (
cd ../../
cd ..\..
rem Moving EXAMPLE files around to have a neater structure
mkdir build\tmp
xcopy /y build\examples\bin\Release\*.exe build\tmp 2>NUL
rmdir /s /q "build\examples" 2> NUL
mv build\tmp build\examples
move build\tmp build\examples
xcopy /y build\lib\*.dll build\examples 2>NUL
cd build_scripts/windows
cd build_scripts\windows
)
IF "%BUILD_TESTS%"=="yes" (
cd ../../
cd ..\..
rem Moving EXAMPLE files around to have a neater structure
mkdir build\tmp
xcopy /y build\unit-tests\bin\Release\*.exe build\tmp 2>NUL
rmdir /s /q "build\unit-tests" 2> NUL
mv build\tmp build\unit-tests
move build\tmp build\unit-tests
xcopy /y build\lib\*.dll build\unit-tests 2>NUL
cd build_scripts/windows
cd build_scripts\windows
)
call win_clean_garbage.bat
......
@echo off
title Cleaning up 'examples'
cd ../../
cd ..\..
rmdir /s /q "build\examples" 2>NUL
cd build_scripts/windows
\ No newline at end of file
cd build_scripts\windows
\ No newline at end of file
@echo off
title Cleaning up after the party!
cd ../../
cd ..\..
rem Deleting unnecessary files
rmdir /s /q Debug 2>NUL
......@@ -10,29 +10,29 @@ rmdir /s /q Win32 2>NUL
rmdir /s /q x64 2>NUL
del "ALL_BUILD.vcxproj.user" 2>NUL
del "Makefile" 2>NUL
del /s /q "docs/*" 2>NUL
del /s /q "docs\*" 2>NUL
del "src/*TestRunner*" 2>NUL
del "src/*.o src/*.mod" 2>NUL
del "src/funit.tmp" 2>NUL
del "src/*_fun.f90" 2>NUL
del "src/*.o src\*.mod" 2>NUL
del "src\funit.tmp" 2>NUL
del "src\*_fun.f90" 2>NUL
del CMakeCache.txt 2>NUL
del "cmake_install.cmake" 2>NUL
del "src/cmake_install.cmake" 2>NUL
del "src\cmake_install.cmake" 2>NUL
del /s /q CMakeFiles 2>NUL
del "*.vcxproj" 2>NUL
del "*.vcxproj.filters" 2>NUL
del "*.sln" 2>NUL
rmdir /s /q "CMakeFiles" 2>NUL
rmdir /s /q "src/CMakeFiles" 2>NUL
rmdir /s /q "src/examples/CMakeFiles" 2>NUL
rmdir /s /q "src/tests/CMakeFiles" 2>NUL
rmdir /s /q "src\CMakeFiles" 2>NUL
rmdir /s /q "src\examples\CMakeFiles" 2>NUL
rmdir /s /q "src\tests\CMakeFiles" 2>NUL
rmdir /s /q "build/CMakeFiles" 2>NUL
rmdir /s /q "build/lib4neuro.dir" 2>NUL
rmdir /s /q "build/libexprtk.dir" 2>NUL
rmdir /s /q "build/bin" 2>NUL
rmdir /s /q "build\CMakeFiles" 2>NUL
rmdir /s /q "build\lib4neuro.dir" 2>NUL
rmdir /s /q "build\libexprtk.dir" 2>NUL
rmdir /s /q "build\bin" 2>NUL
del /q "build\*vcxproj*" 2>NUL
del /q "build\*cmake*" 2>NUL
cd build_scripts/windows
\ No newline at end of file
cd build_scripts\windows
\ No newline at end of file
@echo off
title Cleaning up 'lib4neuro'
cd ../../
cd ..\..
rmdir /s /q "build\lib" 2>NUL
rmdir /s /q "build\bin\Debug" 2>NUL
rmdir /s /q "build\bin\Release" 2>NUL
cd build_scripts/windows
\ No newline at end of file
cd build_scripts\windows
\ No newline at end of file
@echo off
title Cleaning up 'unit-tests'
cd ../../
cd ..\..
rmdir /s /q "build\unit-tests" 2>NUL
cd build_scripts/windows
\ No newline at end of file
cd build_scripts\windows
\ No newline at end of file
......@@ -19,14 +19,14 @@ IF "%DOWNLOAD_DEP%"=="yes" (
rem Dependencies download
IF "%DOWNLOAD_DEP%"=="yes" (
cd ../..
cd ..\..
rmdir /s /q "external_dependencies" 2>NUL
git submodule init
git submodule update --remote
cd external_dependencies/boost
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
......@@ -42,5 +42,5 @@ IF "%DOWNLOAD_DEP%"=="yes" (
git submodule update --init
call bootstrap.bat
cd ../../build_scripts/windows
cd ..\..\build_scripts\windows
)
@echo off
title Running 'lib4neuro' unit-tests
cd ../../build/unit-tests
cd ..\..\build\unit-tests
rem Runs all the available Unit-Tests
for /r %%v in ("*_test.exe") do call %%v
cd ../../build_scripts/windows
\ No newline at end of file
cd ..\..\build_scripts\windows
\ No newline at end of file
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