From 119a0e9139ee8b66258707de03afff9f78102b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ege=20=C3=87etin?= <64282645+egecetin@users.noreply.github.com> Date: Sun, 16 Oct 2022 17:37:38 +0300 Subject: [PATCH] Add benchmark (#3) * m should be added for linux * update * fix * minor fixes --- CMakeLists.txt | 12 ++++++++++++ README.md | 16 ++++++++++++---- data/ac-synin-out.jpg | Bin 214764 -> 216496 bytes src/jpeg-utils/jpeg-utils.c | 2 +- src/kaleidoscope-cmd.c | 25 +++++++++++++++++++++---- src/kaleidoscope.c | 2 +- 6 files changed, 47 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35510e4..4352f25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,18 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) # Compile add_library(kaleidoscope-static ${KaleidoscopeSources}) +if(CMAKE_C_COMPILER_ID MATCHES "GNU" + OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" + OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + target_link_libraries(kaleidoscope-static m) +endif() add_executable(kaleidoscope-cmd ${CMAKE_CURRENT_SOURCE_DIR}/src/kaleidoscope-cmd.c) target_link_libraries(kaleidoscope-cmd kaleidoscope-static turbojpeg-static) +if(CMAKE_C_COMPILER_ID MATCHES "GNU" + OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" + OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + target_link_libraries(kaleidoscope-cmd m) +endif() diff --git a/README.md b/README.md index 7feb742..9485984 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Use the following commands, ``` mkdir build && cd build -cmake -DNDEBUG .. +cmake -DCMAKE_BUILD_TYPE=Release -DNDEBUG=1 .. cmake --build . ``` @@ -33,7 +33,15 @@ Alternatively you can directly use the command line program to create kaleidosco You can see an example below for ```N=8```