diff --git a/OPTYap/CMakeLists.txt b/OPTYap/CMakeLists.txt index c4695c2f3..549cf86a1 100644 --- a/OPTYap/CMakeLists.txt +++ b/OPTYap/CMakeLists.txt @@ -38,33 +38,42 @@ if (WITH_TABLING) include_directories (OPTYap) endif(WITH_TABLING) - option (WITH_YAPOR "Experimental Support for Or-parallelism" OFF) -CMAKE_DEPENDENT_OPTION (WITH_YAPOR_COPY "Copy-based Or-parallelism" ON - "WITH_YAPOR" OFF) +OPTION (WITH_YAPOR_COPY "Copy-based Or-parallelism" OFF) if (WITH_YAPOR_COPY) - set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_COPY=1) + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_COPY=1;USE_DL_MALLOC=1) + set(WITH_YAPOR ON) endif (WITH_YAPOR_COPY) - -CMAKE_DEPENDENT_OPTION (WITH_YAPOR_THOR "Thread-based Or-parallelism" OFF - "WITH_OR_PARALLELISM;WITH_THREADS;NOT WITH_YAPOR" OFF) + +OPTION (WITH_YAPOR_THOR "Thread-based Or-parallelism" OFF) if (WITH_YAPOR_THOR) - set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_THREADS=1) + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_THREADS=1;USE_SYSTEM_MALLOC=1) + set(WITH_YAPOR ON) endif (WITH_YAPOR_THOR) -CMAKE_DEPENDENT_OPTION (WITH_YAPOR_ACOW "Process-based Copy-On-Write Or-parallelism" OFF - "WITH_OR_PARALLELISM;NOT WITH_YAPOR;NOT WITH_THOR" OFF) +OPTION (WITH_YAPOR_ACOW "Process-based Copy-On-Write Or-parallelism" OFF) if (WITH_YAPOR_ACOW) - set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_COW=1) + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_COW=1;USE_SYSTEM_MALLOC=1) + set(WITH_YAPOR ON) endif (WITH_YAPOR_ACOW) -CMAKE_DEPENDENT_OPTION (WITH_YAPOR_SBA "Sparse Bind Array-based Or-parallelism" OFF - "WITH_OR_PARALLELISM;NOT WITH_YAPOR;NOT WITH_THOR;NOT WITH_ACOW" OFF) +OPTION (WITH_YAPOR_SBA "Sparse Bind Array-based Or-parallelism" OFF) if (WITH_YAPOR_SBA) - set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_SBA=1) + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR_SBA=1;USE_SYSTEM_MALLOC=1) + set(WITH_YAPOR ON) endif (WITH_YAPOR_SBA) + + +if (WITH_YAPOR) + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR=1) +else() + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS USE_SYSTEM_MALLOC=1) +endif () + + + set (POSITION_INDEPENDENT_CODE TRUE) add_library (libOPTYap OBJECT diff --git a/OPTYap/tab.insts.h b/OPTYap/tab.insts.h index 9eee28561..7559c3643 100644 --- a/OPTYap/tab.insts.h +++ b/OPTYap/tab.insts.h @@ -22,7 +22,7 @@ #define store_low_level_trace_info(CP, TAB_ENT) #endif /* LOW_LEVEL_TRACER */ -#define TABLING_ERROR_CHECKING_STACK \ +#define TABLING_ERROR_CHECKING_STACK \ TABLING_ERROR_CHECKING(store_node, Unsigned(H) + 1024 > Unsigned(B)); \ TABLING_ERROR_CHECKING(store_node, Unsigned(H_FZ) + 1024 > Unsigned(B)) @@ -377,7 +377,7 @@ -> we need a shared data structure to avoid redundant computations! UNLOCK_OR_FRAME(LOCAL_top_or_fr); #else - Sfprintf(Serror, "PROBLEM: cp_last_answer field is local to the cp!\n"); + fprintf(stderr, "PROBLEM: cp_last_answer field is local to the cp!\n"); exit(1); #endif }