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

Merge branch 'tmp' of code.it4i.cz:bes0030/4Neuro

# Conflicts:
#	external_dependencies/boost
#	src/CMakeLists.txt
#	src/LearningMethods/ParticleSwarm.h
parents 606d6925 8d9a06ce
No related branches found
No related tags found
No related merge requests found
Showing
with 1841 additions and 2821 deletions
# Windows 10 with Boost and Exprtk
# downloaded and compiled locally as
# submodules
win_visual_studio:
# submodules and linked statically
win_visual_studio_static_deps:
tags:
- Win
......@@ -10,48 +10,111 @@ win_visual_studio:
- cd build_scripts\windows
- call win_download_dependencies.bat
- cd ..\..
script:
- cd build_scripts\windows
- set DEPENDENCIES_LINK_TYPE=static
- call win_VS_build_x64_debug.bat
- call win_run_tests.bat
- cd ..\..
# Latest Ubuntu with Boost and Exprtk
# in system directories
ubuntu_boost_system:
tags:
- centos7
image: martinbeseda/dockertest:latest
before_script:
- rm -rf external_dependencies
- git clone https://github.com/ArashPartow/exprtk.git
- cp exprtk/exprtk.hpp /usr/include
- export TERM=xterm
- ./build.sh
script:
- './ci_run_tests.sh'
- call win_run_tests.bat
# Windows 10 with Boost and Exprtk
# downloaded and compiled locally as
# submodules and link dynamically
#
# CURRENTLY NOT SUPPORTED!
#win_visual_studio_shared_deps:
# tags:
# - Win
#
# before_script:
# - call VsDevCmd.bat
# - cd build_scripts\windows
# - call win_download_dependencies.bat
# - cd ..\..
# - cd build_scripts\windows
# - set DEPENDENCIES_LINK_TYPE=shared
# - call win_VS_build_x64_debug.bat
#
# script:
# - call win_run_tests.bat
#
#
# Latest Ubuntu with Boost and Exprtk
# compiled locally as submodules
ubuntu_boost_local:
tags:
- centos7
image: martinbeseda/ubuntu-ci:latest
before_script:
- cd build_scripts/linux
- ./download_dependencies.sh
- cd ../..
script:
- cd build_scripts/linux
- ./linux_gcc_build_x64_debug.sh
- './linux_run_tests.sh'
- cd ../..
# in system directories, Boost
# installed from the official repository
# => only dynamical linking possible
#ubuntu_boost_system:
# tags:
# - centos7
#
# image: martinbeseda/dockertest:latest
#
# before_script:
# - rm -rf external_dependencies
# - git clone https://github.com/ArashPartow/exprtk.git
# - cp exprtk/exprtk.hpp /usr/include
# - export TERM=xterm
# - cd build_scripts/linux
# - export DEPENDENCIES_LINK_TYPE=shared
# - ./linux_gcc_build_x64_debug_system.sh
#
# script:
# - './linux_run_tests.sh'
#
## Latest Ubuntu with Boost and Exprtk
## compiled locally as submodules and
## linked statically
#ubuntu_boost_local_static_deps:
# tags:
# - centos7
#
# image: martinbeseda/ubuntu-ci:latest
#
# before_script:
# - cd build_scripts/linux
# - ./download_dependencies.sh
# - cd ../..
# - cd build_scripts/linux
# - export DEPENDENCIES_LINK_TYPE=static
# - ./linux_gcc_build_x64_debug_local.sh
#
# script:
# - './linux_run_tests.sh'
#
## Latest Ubuntu with Boost and Exprtk
## compiled locally as submodules and
## linked dynamically
#ubuntu_boost_local_dynamic_deps:
# tags:
# - centos7
#
# image: martinbeseda/ubuntu-ci:latest
#
# before_script:
# - cd build_scripts/linux
# - ./download_dependencies.sh
# - cd ../..
# - cd build_scripts/linux
# - export DEPENDENCIES_LINK_TYPE=shared
# - ./linux_gcc_build_x64_debug_local.sh
#
# script:
# - './linux_run_tests.sh'
#code_quality:
# image: docker:stable
# variables:
# DOCKER_DRIVER: overlay2
# allow_failure: true
# services:
# - docker:stable-dind
# script:
# - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
# - docker run
# --env SOURCE_CODE="$PWD"
# --volume "$PWD":/code
# --volume /var/run/docker.sock:/var/run/docker.sock
# "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
# artifacts:
# paths: [gl-code-quality-report.json]
Summary
(Summarize the bug encountered concisely)
(Summarize the task concisely)
Associated classes
(Classes, which need to be modified, if any)
/label ~bug ~reproduced ~needs-investigation
/label ~task
Summary
(Summarize the task concisely)
/label ~task ~todo
[submodule "external_dependencies/exprtk"]
path = external_dependencies/exprtk
url = https://github.com/ArashPartow/exprtk.git
[submodule "external_dependencies/boost"]
path = external_dependencies/boost
url = https://github.com/boostorg/boost.git
cmake_minimum_required(VERSION 3.0)
project(lib4neuro)
message("Using CMake ${CMAKE_VERSION}")
#TODO request newer version of CMake >=3.12
#TODO rewrite to use add_compile_definitions
if(WIN32)
ADD_DEFINITIONS("-DBOOST_ALL_NO_LIB")
add_compile_options("-DBOOST_ALL_NO_LIB")
else()
ADD_DEFINITIONS("-DBOOST_TEST_DYN_LINK")
add_compile_options("-DBOOST_TEST_DYN_LINK")
endif()
#cmake_policy(SET CMP0074 NEW)
#cmake_policy(SET CMP0060 NEW)
#if(WIN32)
# message("Setting no library prefixes...")
# set(CMAKE_STATIC_LIBRARY_PREFIX "")
# set(CMAKE_SHARED_LIBRARY_PREFIX "")
# set(CMAKE_SHARED_MODULE_PREFIX "")
# set(CMAKE_IMPORT_LIBRARY_PREFIX "")
# set(PREFIX "")
# set(IMPORT_PREFIX "")
#endif()
#-------------------------------#
# Default installation location #
#-------------------------------#
# Linux: /usr/local
# Windows: c:/Program Files
#------------#
# Build type #
#------------#
# Default: Release
# Others: None, Debug
# Release / None / Debug
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: None Debug Release."
FORCE)
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: None Debug Release."
FORCE)
elseif("CMAKE_BUILD_TYPE" STREQUAL "Debug")
#TODO rewrite to use add_compile_definitions
add_compile_options(-DDEBUG)
endif (NOT CMAKE_BUILD_TYPE)
#------------------------#
# Dependencies link type #
#------------------------#
if(NOT DEPENDENCIES_LINK_TYPE AND NOT ENV{DEPENDENCIES_LINK_TYPE})
message(FATAL_ERROR "Please, set the variable DEPENDENCIES_LINK_TYPE to either 'static' or 'shared'!")
endif()
#--------------------------------#
# Setting C++ compiler flags #
#--------------------------------#
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost" )
elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0 /bigobj")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
#--------------------#
......@@ -60,17 +60,33 @@ endif()
message("Looking for external libraries...")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# TODO Instead use better FIND BOOST !!!
set(Boost_USE_MULTITHREADED ON)
set(Boost_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/boost)
set(Boost_LIBRARY_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/boost/stage/lib)
set(Boost_DEBUG ON)
message("Boost INCLUDE DIR: ${Boost_INCLUDE_DIR}")
message("Boost LIB DIR: ${Boost_LIBRARY_DIRS}")
message("lib4neuro LIB DIR: ${LIB4NEURO_DIR}")
set(CMAKE_INCLUDE_PATH ${BOOST_INCLUDEDIR} "${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost" ${CMAKE_INCLUDE_PATH})
set(CMAKE_LIBRARY_PATH ${BOOST_LIBRARYDIR} "${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost/stage/lib" ${CMAKE_LIBRARY_PATH})
message("CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}")
message("CMAKE_LIBRARY_PATH: ${CMAKE_LIBRARY_PATH}")
include_directories(${Boost_INCLUDE_DIR} ${Boost_INCLUDEDIR} ${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS} ${LIB4NEURO_DIR})
find_package(
Boost
COMPONENTS
system
serialization
random
)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost was NOT found! Specify variables BOOST_INCLUDEDIR and BOOST_LIBRARYDIR!")
endif()
message("Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
message("Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}")
message("Boost_LIBRARIES: ${Boost_LIBRARIES}")
message("lib4neuro LIB DIR: ${LIB4NEURO_DIR}")
find_package(exprtk)
......@@ -92,24 +108,16 @@ endif()
#---------------#
# Set variables #
#---------------#
set(SRC_DIR src)
set(PROJECT_BINARY_DIR build)
set(ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
set(SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src)
set(PROJECT_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
#
# Dependencies for the lib4neuro library
#
if(WIN32)
set(LINK_DEP_LIB4NEURO libboost_serialization libboost_system libboost_random libboost_unit_test libexprtk)
else()
set(LINK_DEP_LIB4NEURO boost_serialization boost_system boost_random boost_unit_test exprtk)
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
include_directories(include ${SRC_DIR})
message(" Running CMake in: ${SRC_DIR} ${PROJECT_BINARY_DIR}")
#----------------------------------------#
# Dependencies for the lib4neuro library #
#----------------------------------------#
message("Running CMake in: ${SRC_DIR} ${PROJECT_BINARY_DIR}")
add_subdirectory(${SRC_DIR} ${PROJECT_BINARY_DIR})
This diff is collapsed.
......@@ -15,15 +15,17 @@ FIND_PATH(
NAMES
exprtk.hpp
HINTS
$ENV{EXPRTK_INCLUDE_DIR}
$ENV{EXPRTK_INCLUDE_DIR}
$ENV{EXPRTK_ROOT}
${EXPRTK_ROOT}
${EXPRTK_INCLUDE_DIR}
external_dependencies/exprtk
PATHS
/home
/usr/local
/usr
/opt/local
external_dependencies/exprtk
PATH_SUFFIXES
include
)
......
......@@ -10,6 +10,7 @@
BUILD_TESTS=yes
BUILD_EXAMPLES=yes
BUILD_LIB=yes
DEPENDENCIES_LINK_TYPE=shared # shared/static
# Build type (Release/Debug)
BUILD_TYPE=Debug
......@@ -25,5 +26,11 @@ fi
$(pwd)/clean.sh
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DCMAKE_C_COMPILER=${C_COMPILER} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_LIB=${BUILD_LIB} -DLIB4NEURO_DIR=$(pwd)/build/lib .
cmake --build . --config ${BUILD_TYPE} -- -j${N_CORES} && (tput setaf 2; echo "Build complete."; echo "For examples have a look at the folder build/examples/bin."; tput sgr 0; ) || (tput setaf 1; echo "Build finished with errors!"; tput sgr 0; exit 1;)
#
# For ExprTk download
#
git submodule init
git submodule update --remote
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DCMAKE_C_COMPILER=${C_COMPILER} -DBUILD_TESTS=${BUILD_TESTS} -DBUILD_EXAMPLES=${BUILD_EXAMPLES} -DBUILD_LIB=${BUILD_LIB} -DLIB4NEURO_DIR=$(pwd)/build/lib -DDEPENDENCIES_LINK_TYPE=${DEPENDENCIES_LINK_TYPE} .
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/bash
CYAN='\033[0;36m'
NC='\033[0m' # No Color
echo "Building '${CYAN}BOOST${NC}' for ${WHITE}Debug${NC}"
cd ../..
cd external_dependencies/boost
./b2 cxxflags="-fPIC" --layout=system variant=debug link=${DEPENDENCIES_LINK_TYPE} address-model=64 --with-system --with-serialization --with-random
cd ../../build_scripts/linux
#!/bin/sh
rm ../../external_dependencies/boost/*
rm ../../external_dependencies/exprtk/*
......@@ -12,9 +12,9 @@ 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
#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
cd build_scripts/linux
......@@ -58,6 +58,7 @@ fi
if [ $REBUILD_BOOST = "yes" ]
then
echo "The required '${CYAN}BOOST${NC}' library will be recompiled in the directory '${YELLOW}external_dependencies/boost${NC}'"
rm -rf ../../external_dependencies/boost/stage/lib/*
BUILD_SOMETHING=yes
BUILD_SOMETHING_LIB=yes
fi
......@@ -66,19 +67,7 @@ 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
./build_boost_gcc.sh
fi
if [ $BUILD_SOMETHING_LIB = "yes" ]
......@@ -99,21 +88,18 @@ 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 .
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} .
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; )
( cmake --build . --config Debug -- -j${N_CORES} ) && ( 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
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 ../../external_dependencies/boost/*
rm -rf ../../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_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} .
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; )
cd build_scripts/linux
./linux_clean_garbage.sh
fi
......@@ -68,9 +68,11 @@ IF "%REBUILD_BOOST%"=="yes" (
rmdir /s /q external_dependencies\boost\bin.v2 2>NUL
cd external_dependencies\boost
echo "DEPENDENCIES_LINK_TYPE %DEPENDENCIES_LINK_TYPE%"
.\b2 --layout=system variant=debug link=static address-model=64 --with-system --with-serialization --with-random
.\b2 --layout=system variant=debug link=%DEPENDENCIES_LINK_TYPE% address-model=64 --with-system --with-serialization --with-random || exit 1
cd ..\..\build_scripts\windows
)
......@@ -97,10 +99,10 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
set MAKEFILE_GENERATOR="Visual Studio 15 2017 Win64"
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 .
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 -DDEPENDENCIES_LINK_TYPE=%DEPENDENCIES_LINK_TYPE% . || exit 1
title Building the 'lib4neuro' project for Debug (building)
(cmake --build . --config Debug > build.log) && (echo "Build complete.") || (echo "Build finished with errors!")
(cmake --build . --config Debug) && (echo "Build complete.") || exit 1
cd build_scripts\windows
......
......@@ -18,5 +18,10 @@
#include "../src/Neuron/NeuronBinary.h"
#include "../src/Neuron/NeuronLinear.h"
#include "../src/Neuron/NeuronLogistic.h"
#include "../src/Solvers/DESolver.h"
#include "../src/constants.h"
#include "../src/settings.h"
#include "../src/message.h"
#endif //INC_4NEURO_4NEURO_H
This diff is collapsed.
......@@ -26,14 +26,56 @@ if ("${BUILD_LIB}" STREQUAL "yes")
LearningMethods/ILearningMethods.cpp
)
if(WIN32)
add_library(libboost_unit_test STATIC boost_test_lib_dummy.cpp)
add_library(libexprtk STATIC exprtk.cpp)
target_link_libraries(lib4neuro ${LINK_DEP_LIB4NEURO})
else()
add_library(boost_unit_test SHARED boost_test_lib_dummy.cpp)
add_library(exprtk SHARED exprtk.cpp)
target_link_libraries(lib4neuro ${LINK_DEP_LIB4NEURO})
target_link_libraries(
lib4neuro
PRIVATE
${Boost_LIBRARIES}
)
target_include_directories(
lib4neuro
#TODO Boost_INCLUDE_DIRS should be PRIVATE - rewrite code accordingly!
PUBLIC
${Boost_INCLUDE_DIRS}
${ROOT_DIR}/include
PRIVATE
${SRC_DIR}
# ${Boost_INCLUDE_DIRS}
)
set_target_properties(
lib4neuro
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin"
)
set(PREFIX "")
if(WIN32)
# set(PREFIX "lib")
endif()
if(WIN32 AND "${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared")
message(FATAL_ERROR "Only static linking of external dependencies is supported for Windows systems now!")
elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "static")
add_library(${PREFIX}boost_unit_test STATIC boost_test_lib_dummy.cpp)
add_library(${PREFIX}exprtk STATIC exprtk.cpp)
elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared")
add_library(${PREFIX}boost_unit_test SHARED boost_test_lib_dummy.cpp)
add_library(${PREFIX}exprtk SHARED exprtk.cpp)
endif()
target_include_directories(
${PREFIX}boost_unit_test
PRIVATE
${Boost_INCLUDE_DIRS}
)
endif ()
......@@ -19,9 +19,9 @@
#include <iterator>
#include <algorithm>
#include "Network/NeuralNetwork.h"
#include "DataSet/DataSet.h"
#include "ErrorFunction/ErrorFunctions.h"
#include "../Network/NeuralNetwork.h"
#include "../DataSet/DataSet.h"
#include "../ErrorFunction/ErrorFunctions.h"
#include "ILearningMethods.h"
......
......@@ -625,14 +625,14 @@ void NeuralNetwork::add_inward_connection(size_t s, size_t t, size_t con_idx) {
if(!this->inward_adjacency->at(s)){
this->inward_adjacency->at(s) = new std::vector<std::pair<size_t, size_t>>(0);
}
this->inward_adjacency->at(s)->push_back(std::pair(t, con_idx));
this->inward_adjacency->at(s)->push_back(std::pair<size_t, size_t>(t, con_idx));
}
void NeuralNetwork::add_outward_connection(size_t s, size_t t, size_t con_idx) {
if(!this->outward_adjacency->at(s)){
this->outward_adjacency->at(s) = new std::vector<std::pair<size_t, size_t>>(0);
}
this->outward_adjacency->at(s)->push_back(std::pair(t, con_idx));
this->outward_adjacency->at(s)->push_back(std::pair<size_t, size_t>(t, con_idx));
}
void NeuralNetwork::analyze_layer_structure() {
......@@ -787,4 +787,4 @@ void NeuralNetwork::save_text(std::string filepath) {
oa << *this;
ofs.close();
}
}
\ No newline at end of file
}
......@@ -32,13 +32,13 @@
#include <boost/serialization/vector.hpp>
#include <boost/serialization/utility.hpp>
#include "Neuron/Neuron.h"
#include "Neuron/NeuronConstant.h"
#include "Neuron/NeuronBinary.h"
#include "Neuron/NeuronLinear.h"
#include "Neuron/NeuronLogistic.h"
#include "NetConnection/ConnectionFunctionGeneral.h"
#include "NetConnection/ConnectionFunctionIdentity.h"
#include "../Neuron/Neuron.h"
#include "../Neuron/NeuronConstant.h"
#include "../Neuron/NeuronBinary.h"
#include "../Neuron/NeuronLinear.h"
#include "../Neuron/NeuronLogistic.h"
#include "../NetConnection/ConnectionFunctionGeneral.h"
#include "../NetConnection/ConnectionFunctionIdentity.h"
......
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