From 6875c3f2c3cde367424d66b931c7152582a6fd92 Mon Sep 17 00:00:00 2001 From: Suresh Parthasarathy Date: Thu, 16 Nov 2017 15:45:24 +0530 Subject: [PATCH] changes to cmake files --- CMakeLists.txt | 28 ++++++++++++++++---------- drivers/ProtoNN/trainer/CMakeLists.txt | 9 ++++++--- run_BonsaiPredict_usps10.sh | 2 +- run_BonsaiTrain_usps10.sh | 4 ++-- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd5731bc..75cbd3a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,20 +26,26 @@ endif() #define variables for mkl include directories #set your MKL_ROOT here -set(MKL_ROOT "C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl") -set(MKL_INCLUDE_DIR ${MKL_ROOT}/include) -include_directories(${MKL_INCLUDE_DIR}) -link_directories(${MKL_ROOT}/lib/intel64_win) -link_directories(${MKL_ROOT}/../compiler/lib/intel64_win) -#set(MKL_ROOT "/opt/intel/mkl/") -#set(MKL_INCLUDE_DIR ${MKL_ROOT}/include) -#include_directories(${MKL_INCLUDE_DIR}) -#link_directories(${MKL_ROOT}/lib/intel64_lin) -#link_directories(${MKL_ROOT}/../compiler/lib/intel64_lin) +if(MSVC) + set(MKL_ROOT "C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl") + set(MKL_INCLUDE_DIR ${MKL_ROOT}/include) + include_directories(${MKL_INCLUDE_DIR}) + link_directories(${MKL_ROOT}/lib/intel64_win) + link_directories(${MKL_ROOT}/../compiler/lib/intel64_win) +ENDIF(MSVC) + +IF(CMAKE_COMPILER_IS_GNUCC) + set(MKL_ROOT "/opt/intel/mkl/") + set(MKL_INCLUDE_DIR ${MKL_ROOT}/include) + include_directories(${MKL_INCLUDE_DIR}) + link_directories(${MKL_ROOT}/lib/intel64_lin) + link_directories(${MKL_ROOT}/../compiler/lib/intel64_lin) +ENDIF(CMAKE_COMPILER_IS_GNUCC) # add debug definitions to compiler flags -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLIGHT_LOGGER") #-DLOGGER #-DTIMER -DCONCISE #-DSTDERR_ONSCREEN #-DLIGHT_LOGGER -DVERBOSE #-DDUMP #-DVERIFY +#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLIGHT_LOGGER") #-DLOGGER #-DTIMER -DCONCISE #-DSTDERR_ONSCREEN #-DLIGHT_LOGGER -DVERBOSE #-DDUMP #-DVERIFY +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLIGHT_LOGGER -DSTDERR_ONSCREEN -DVERBOSE -DDUMP -DVERIFY") #-DLOGGER #-DTIMER -DCONCISE #-DSTDERR_ONSCREEN #-DLIGHT_LOGGER -DVERBOSE #-DDUMP #-DVERIFY set(CONFIG_FLAGS "-DSINGLE") #-DXML -DZERO_BASED_IO diff --git a/drivers/ProtoNN/trainer/CMakeLists.txt b/drivers/ProtoNN/trainer/CMakeLists.txt index 9b218587..1cd0e683 100644 --- a/drivers/ProtoNN/trainer/CMakeLists.txt +++ b/drivers/ProtoNN/trainer/CMakeLists.txt @@ -4,8 +4,11 @@ set (src ProtoNNTrainDriver.cpp) source_group("src" FILES ${src}) -set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}) -set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}) +#set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}) +#set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}) + +set (GLOBAL_BIN_DIR ${CMAKE_BINARY_DIR}/bin) +set (EXECUTABLE_OUTPUT_PATH ${GLOBAL_BIN_DIR}) add_executable(${tool_name} ${src} ${include}) target_include_directories(${tool_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/ProtoNN) @@ -18,4 +21,4 @@ IF(NOT CMAKE_COMPILER_IS_GNUCC) target_link_libraries(${tool_name} common ProtoNN mkl_intel_ilp64 mkl_intel_thread mkl_core libiomp5md) ENDIF (NOT CMAKE_COMPILER_IS_GNUCC) -set_property(TARGET ${tool_name} PROPERTY FOLDER "drivers/ProtoNN") \ No newline at end of file +set_property(TARGET ${tool_name} PROPERTY FOLDER "drivers/ProtoNN") diff --git a/run_BonsaiPredict_usps10.sh b/run_BonsaiPredict_usps10.sh index 3258f14d..fdb7e10c 100644 --- a/run_BonsaiPredict_usps10.sh +++ b/run_BonsaiPredict_usps10.sh @@ -25,7 +25,7 @@ ntest="-N 2007" #gdb=" gdb --args" executable="./BonsaiPredict" command=$gdb" "$executable" "$input_format" "$ntest" "$input_dir" "$model_dir -echo "Running Bonsai with following command: " +echo "Running Bonsai predict with following command: " echo $command echo "" exec $command diff --git a/run_BonsaiTrain_usps10.sh b/run_BonsaiTrain_usps10.sh index 6537d949..9abc054b 100644 --- a/run_BonsaiTrain_usps10.sh +++ b/run_BonsaiTrain_usps10.sh @@ -48,9 +48,9 @@ iters="-I 100" ######################################################## #gdb=" gdb --args" -executable="./Bonsai" +executable="./BonsaiTrain" command=$gdb" "$executable" "$input_format" "$num_features" "$num_labels" "$ntrain" "$ntest" "$projection_dimension" "$tree_depth" "$sigma" "$reg_W" "$reg_Z" "$reg_Theta" "$reg_V" "$sparse_Z" "$sparse_Theta" "$sparse_V" "$sparse_W" "$batch_factor" "$iters" "$input_dir -echo "Running Bonsai with following command: " +echo "Running Bonsai train with following command: " echo $command echo "" exec $command