From 33990a9691742c9b0ef55e7d2ffcc5f71394e898 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 30 Nov 2019 23:37:47 -0500 Subject: [PATCH] Add URDE_VECTOR_ISA=native, update README.md with CMake options --- CMakeLists.txt | 5 ++++- README.md | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 204ed1b69..e2734e3a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,10 @@ else() #add_compile_definitions(_GLIBCXX_DEBUG=1) endif() - if(${URDE_VECTOR_ISA} STREQUAL "avx2") + if(${URDE_VECTOR_ISA} STREQUAL "native") + add_compile_options(-march=native) + message(STATUS "Building with native ISA") + elseif(${URDE_VECTOR_ISA} STREQUAL "avx2") add_compile_options(-mavx2) message(STATUS "Building with AVX2 Vector ISA") elseif(${URDE_VECTOR_ISA} STREQUAL "avx") diff --git a/README.md b/README.md index 3309b46fc..58ed52c53 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,14 @@ cd urde-build ```sh cmake -DCMAKE_BUILD_TYPE=Debug ../urde -make +make -j$(nproc) ``` +CMake options: +- Build release optimized (better runtime performance): `-DCMAKE_BUILD_TYPE=Release` +- Use clang+lld (faster linking): `-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++` +- Optimize for current CPU (resulting binaries are not portable): `-DURDE_VECTOR_ISA=native` + #### Qt Creator *(main development / debugging IDE)*