diff -Naur -x .git easea.old/CMakeLists.txt easea.new/CMakeLists.txt --- easea.old/CMakeLists.txt 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/CMakeLists.txt 2022-02-05 13:55:35.508857292 +0100 @@ -6,8 +6,7 @@ set(PROJECT_VER_MAJOR 2) set(PROJECT_VER_MINOR 20) set(PROJECT_VER_PATCH 0) -#CONFIGURE_FILE(config.h.in libeasea/include/config.h) -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/libeasea/include) message("-- PROJECT NAME: ${PROJECT_NAME}") message("-- PROJECT VERSION: ${PROJECT_VER}") @@ -16,10 +15,9 @@ SET(CMAKE_STATIC_LIBRARY_PREFIX="") INCLUDE_DIRECTORIES(${PROJECT_BINARY_BIN}) -INCLUDE_DIRECTORIES(libeasea/include cxxopts) +INCLUDE_DIRECTORIES(libeasea/include) INCLUDE_DIRECTORIES(libeasna/include) - -set(OMP_NUM_THREADS 1) +INCLUDE_DIRECTORIES(cxxopts) option(USE_OPENMP "If available, use OpenMP for parallelization." ON) @@ -34,9 +32,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") endif () -CONFIGURE_FILE(config.h.in libeasea/include/config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_DIR}) - SET(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "" FORCE) # Creation of a static library for EASEA that will be linked to the main program easena @@ -67,22 +62,22 @@ FIND_PACKAGE(BISON) FLEX_TARGET( EaseaLexer compiler/EaseaLex.l - compiler/EaseaLex.cpp + ${CMAKE_SOURCE_DIR}/compiler/EaseaLex.cpp ) BISON_TARGET( EaseaParser compiler/EaseaParse.y - compiler/EaseaParse.cpp + ${CMAKE_SOURCE_DIR}/compiler/EaseaParse.cpp COMPILE_FLAGS -d DEFINES_FILE compiler/EaseaParse.hpp ) FLEX_TARGET( NeuralLexer compiler/NeuralLex.l - compiler/NeuralLex.cpp + ${CMAKE_SOURCE_DIR}/compiler/NeuralLex.cpp DEFINES_FILE compiler/NeuralLex.h ) BISON_TARGET( NeuralParser compiler/NeuralParse.y - compiler/NeuralParse.cpp + ${CMAKE_SOURCE_DIR}/compiler/NeuralParse.cpp COMPILE_FLAGS -d DEFINES_FILE compiler/NeuralParse.hpp ) @@ -102,6 +97,8 @@ SET_TARGET_PROPERTIES(easena PROPERTIES COMPILE_FLAGS "-std=c++14 -w -Wno-deprecated -Wno-write-strings -fmessage-length=0") TARGET_LINK_LIBRARIES(easena libeasea libeasna) ADD_CUSTOM_COMMAND(TARGET easena POST_BUILD + COMMAND $(CMAKE_COMMAND) -E make_directory libeasna + COMMAND $(CMAKE_COMMAND) -E make_directory libeasea COMMAND $(CMAKE_COMMAND) -E copy libeasea.a libeasea/ COMMAND $(CMAKE_COMMAND) -E copy libeasna.a libeasna/ ) @@ -122,6 +119,8 @@ ADD_SUBDIRECTORY(Test/xor_mnist) +CONFIGURE_FILE(config.h.in libeasea/include/config.h) + ## OUTDATED ! ## IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") ## INCLUDE(InstallRequiredSystemLibraries) diff -Naur -x .git easea.old/Test/xor_mnist/main.cpp easea.new/Test/xor_mnist/main.cpp --- easea.old/Test/xor_mnist/main.cpp 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/Test/xor_mnist/main.cpp 2022-02-05 13:35:21.053789455 +0100 @@ -18,6 +18,7 @@ #include #include #include +#include #include "mnist/mnist_reader.hpp" diff -Naur -x .git easea.old/compiler/Easea.h easea.new/compiler/Easea.h --- easea.old/compiler/Easea.h 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/compiler/Easea.h 2022-02-05 13:35:21.053789455 +0100 @@ -81,6 +81,31 @@ extern unsigned iMAX_INIT_TREE_D,iMIN_INIT_TREE_D,iMAX_TREE_D,iNB_GPU,iPRG_BUF_SIZE,iMAX_TREE_DEPTH,iNO_FITNESS_CASES; // Prototypes -extern int mystricmp(const char *, const char *); +static inline char mytolower(char c) { + return ((c>=65)&&(c<=90)) ? c+=32:c; +} + +static inline int mystricmp(const char *string1, const char *string2){ + int i; + for (i=0; string1[i]&&string2[i];i++){ + if (mytolower(string1[i])mytolower(string2[i])) return i+1; + } + if (string2[i]) return -(i+1); + if (string1[i]) return i+1; + return 0; +} + +static inline int isLetter(char c){ + if (((c>=65)&&(c<=90))||((c>=97)&&(c<=122))) return 1; + if ((c==45)||(c==46)||(c==95)) return 1; + return 0; +} + +static inline int isFigure(char c){ + if ((c>=48)&&(c<=57)) return 1; + return 0; +} + #endif diff -Naur -x .git easea.old/compiler/EaseaLex.l easea.new/compiler/EaseaLex.l --- easea.old/compiler/EaseaLex.l 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/compiler/EaseaLex.l 2022-02-05 13:35:21.053789455 +0100 @@ -2475,33 +2475,6 @@ %% ///////////////////////////////////////////////////////////////////////////// - -inline char mytolower(char c) { - return ((c>=65)&&(c<=90)) ? c+=32:c; -} - -inline int mystricmp(const char *string1, const char *string2){ - int i; - for (i=0; string1[i]&&string2[i];i++){ - if (mytolower(string1[i])mytolower(string2[i])) return i+1; - } - if (string2[i]) return -(i+1); - if (string1[i]) return i+1; - return 0; -} - -inline int isLetter(char c){ - if (((c>=65)&&(c<=90))||((c>=97)&&(c<=122))) return 1; - if ((c==45)||(c==46)||(c==95)) return 1; - return 0; -} - -inline int isFigure(char c){ - if ((c>=48)&&(c<=57)) return 1; - return 0; -} - ///////////////////////////////////////////////////////////////////////////// // EASEALexer commands diff -Naur -x .git easea.old/compiler/EaseaSym.cpp easea.new/compiler/EaseaSym.cpp --- easea.old/compiler/EaseaSym.cpp 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/compiler/EaseaSym.cpp 2022-02-05 13:35:21.053789455 +0100 @@ -42,19 +42,6 @@ // else pHead=new CListItem(pCurrent,NewObject); // } -template CListItem *CLList::walkToNextItem() -{ - if (pNextItem==NULL) return NULL; - if (pNextItem==pHead) - { - pNextItem=pHead->pNext; - return pHead; - } - pCurrentObject=pNextItem; - pNextItem=pNextItem->pNext; - return pCurrentObject; -} - ///////////////////////////////////////////////////////////////////////////// // symbol construction/destruction diff -Naur -x .git easea.old/compiler/EaseaSym.h easea.new/compiler/EaseaSym.h --- easea.old/compiler/EaseaSym.h 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/compiler/EaseaSym.h 2022-02-05 13:35:21.053789455 +0100 @@ -67,6 +67,21 @@ CListItem *remove(T *p); }; +/* Need to be defined in Header !! */ +template CListItem *CLList::walkToNextItem() +{ + if (pNextItem==NULL) return NULL; + if (pNextItem==pHead) + { + pNextItem=pHead->pNext; + return pHead; + } + pCurrentObject=pNextItem; + pNextItem=pNextItem->pNext; + return pCurrentObject; +} + + ///////////////////////////////////////////////////////////////////////////// // Symbol diff -Naur -x .git easea.old/config.h.in easea.new/config.h.in --- easea.old/config.h.in 2022-02-05 13:24:40.355807186 +0100 +++ easea.new/config.h.in 2022-02-05 13:54:17.444992052 +0100 @@ -6,9 +6,6 @@ #cmakedefine PROJECT_VER_MINOR @PROJECT_VER_MINOR@ #cmakedefine PROJECT_VER_PATCH @PROJECT_VER_PATCH@ -#cmakedefine OMP_NUM_THREADS @OMP_NUM_THREADS@ - - #cmakedefine USE_OPENMP #ifdef USE_OPENMP diff -Naur -x .git easea.old/libeasea/include/third_party/cxxopts/cxxopts.hpp easea.new/libeasea/include/third_party/cxxopts/cxxopts.hpp --- easea.old/libeasea/include/third_party/cxxopts/cxxopts.hpp 2022-02-05 13:25:32.186148420 +0100 +++ easea.new/libeasea/include/third_party/cxxopts/cxxopts.hpp 2022-02-05 13:35:21.053789455 +0100 @@ -37,6 +37,7 @@ #include #include #include +#include #ifdef __cpp_lib_optional #include