diff --git a/.gitmodules b/.gitmodules index 0cc6a91e81d7cbf0edb2f13ce8012dc5c775aeb8..6ce7b0ac039af32106c354aa9e1ada2716c2e6bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "external_dependencies/boost"] path = external_dependencies/boost url = https://github.com/boostorg/boost.git +[submodule "external_dependencies/turtle"] + path = external_dependencies/turtle + url = https://github.com/mat007/turtle.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d419611d3c15c44c235f9c83b8dedd68516481de..f26dfbd4b0e6759e53e8968b0d7c1dbe30fcfdea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,8 @@ message("lib4neuro LIB DIR: ${LIB4NEURO_DIR}") find_package(exprtk) +find_package(Turtle) + #------------------------------------------# # Detect maximum available number of cores # # and set corresponding build options # diff --git a/FindBoost.cmake b/FindBoost.cmake index 5b730564b5e1fa4a38734430d77fccb763080460..342d2612f1abd22a311b92fe1ea3a15350b0dfe4 100644 --- a/FindBoost.cmake +++ b/FindBoost.cmake @@ -57,13 +57,8 @@ find_path( # as Boost headers are supposed to be included like # #include<boost/...> according to the documentation set(TMP "") -#if(WIN32) -# string(REPLACE "\\boost\\boost" "\\boost" TMP ${Boost_INCLUDE_DIRS}) -# list(APPEND Boost_INCLUDE_DIRS ${TMP}) -#else() - string(REPLACE "/boost/boost" "/boost" TMP ${Boost_INCLUDE_DIRS}) - list(APPEND Boost_INCLUDE_DIRS ${TMP}) -#endif() +string(REPLACE "/boost/boost" "/boost" TMP ${Boost_INCLUDE_DIRS}) +list(APPEND Boost_INCLUDE_DIRS ${TMP}) if(NOT Boost_INCLUDE_DIRS) message(FATAL_ERROR "Boost include directory was not found! Please, set variable BOOST_INCLUDEDIR to the correct path.") diff --git a/FindTurtle.cmake b/FindTurtle.cmake new file mode 100644 index 0000000000000000000000000000000000000000..38b5818b737b6ded93fcc22206015ea24cd63724 --- /dev/null +++ b/FindTurtle.cmake @@ -0,0 +1,40 @@ +# Find headers and libraries +FIND_PATH( + TURTLE_INCLUDE_DIR + NAMES + mock.hpp + HINTS + $ENV{TURTLE_INCLUDE_DIR} + ${TURTLE_INCLUDE_DIR} + external_dependencies/turtle + + PATHS + /home + /usr/local + /usr + /opt/local + PATH_SUFFIXES + include/turtle +) +# Set TURTLE_FOUND honoring the QUIET and REQUIRED arguments +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + turtle + "Turtle was NOT found!" + TURTLE_INCLUDE_DIR) + +# Output variables +IF(TURTLE_FOUND) + # Include dirs + SET(TURTLE_INCLUDE_DIRS ${TURTLE_INCLUDE_DIR}) +ELSE() + MESSAGE(FATAL_ERROR "Set, please, the environmental variable TURTLE_INCLUDE_DIR to the folder, where 'mock.hpp' is located...") +ENDIF(TURTLE_FOUND) + +# Add path only to the 'include' folder +set(TMP "") +string(REPLACE "/include/turtle" "/include" TMP ${TURTLE_INCLUDE_DIR}) +list(APPEND TURTLE_INCLUDE_DIR ${TMP}) + +# Advanced options for not cluttering the cmake UIs: +MARK_AS_ADVANCED(TURTLE_INCLUDE_DIR) diff --git a/external_dependencies/boost b/external_dependencies/boost index b587bd3bbfb42520838ccd516dabc8684fbdd8a8..7ff9ae132ba8e8d9ecc329788a55b6e54139068b 160000 --- a/external_dependencies/boost +++ b/external_dependencies/boost @@ -1 +1 @@ -Subproject commit b587bd3bbfb42520838ccd516dabc8684fbdd8a8 +Subproject commit 7ff9ae132ba8e8d9ecc329788a55b6e54139068b diff --git a/external_dependencies/turtle b/external_dependencies/turtle new file mode 160000 index 0000000000000000000000000000000000000000..e92f52821da312c5e30b447c8046893e576aefca --- /dev/null +++ b/external_dependencies/turtle @@ -0,0 +1 @@ +Subproject commit e92f52821da312c5e30b447c8046893e576aefca diff --git a/src/General/ExprtkWrapper.cpp b/src/General/ExprtkWrapper.cpp index b0c29360c4fc3b3faa5a9e5a5ca20bc36fe417d3..0b3c3920a03d0a9a845b4fdd97d40da3cab226ac 100644 --- a/src/General/ExprtkWrapper.cpp +++ b/src/General/ExprtkWrapper.cpp @@ -39,7 +39,6 @@ ExprtkWrapper::ExprtkWrapper( std::string expression_string ) { this->p_impl->parser->compile(this->p_impl->expression_str, *this->p_impl->expression ); } - ExprtkWrapper::~ExprtkWrapper() { if( this->p_impl->expression ){ diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index cd7d4ad4c8ab865dba0d047e6ead66b756e624bf..eea78435adbedd5baf35f2a988155181fe7781ad 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -4,55 +4,55 @@ add_executable(linear_neuron_test NeuronLinear_test.cpp) target_link_libraries(linear_neuron_test lib4neuro boost_unit_test) -target_include_directories(linear_neuron_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(linear_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(constant_neuron_test NeuronConstant_test.cpp) target_link_libraries(constant_neuron_test lib4neuro boost_unit_test) -target_include_directories(constant_neuron_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(constant_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(binary_neuron_test NeuronBinary_test.cpp) target_link_libraries(binary_neuron_test lib4neuro boost_unit_test) -target_include_directories(binary_neuron_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(binary_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(logistic_neuron_test NeuronLogistic_test.cpp) target_link_libraries(logistic_neuron_test lib4neuro boost_unit_test) -target_include_directories(logistic_neuron_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(logistic_neuron_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(connectionFunctionGeneral_test ConnectionFunctionGeneral_test.cpp) target_link_libraries(connectionFunctionGeneral_test lib4neuro boost_unit_test) -target_include_directories(connectionFunctionGeneral_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(connectionFunctionGeneral_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(neural_network_test NeuralNetwork_test.cpp) target_link_libraries(neural_network_test lib4neuro boost_unit_test) -target_include_directories(neural_network_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(neural_network_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(connection_Function_identity_test ConnectionFunctionIdentity_test.cpp) target_link_libraries(connection_Function_identity_test lib4neuro boost_unit_test) -target_include_directories(connection_Function_identity_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(connection_Function_identity_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(dataset_test DataSet_test.cpp) target_link_libraries(dataset_test lib4neuro boost_unit_test) -target_include_directories(dataset_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(dataset_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(errorfunction_test ErrorFunctions_test.cpp) target_link_libraries(errorfunction_test lib4neuro boost_unit_test) -target_include_directories(errorfunction_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(errorfunction_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(particle_swarm_test ParticleSwarm_test.cpp) target_link_libraries(particle_swarm_test lib4neuro boost_unit_test) -target_include_directories(particle_swarm_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(particle_swarm_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(particle_test Particle_test.cpp) target_link_libraries(particle_test lib4neuro boost_unit_test) -target_include_directories(particle_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(particle_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(NeuralNetworkSum_test NeuralNetworkSum_test.cpp) target_link_libraries(NeuralNetworkSum_test lib4neuro boost_unit_test) -target_include_directories(NeuralNetworkSum_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(NeuralNetworkSum_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) add_executable(DESolver_test DESolver_test.cpp) target_link_libraries(DESolver_test lib4neuro boost_unit_test) -target_include_directories(DESolver_test PRIVATE ${Boost_INCLUDE_DIRS}) +target_include_directories(DESolver_test PRIVATE ${Boost_INCLUDE_DIRS} ${TURTLE_INCLUDE_DIR}) set_target_properties( linear_neuron_test