From 66f7ccc3e7ed63ea418f9db6f319245ff9737b00 Mon Sep 17 00:00:00 2001 From: wallentx Date: Tue, 30 May 2023 14:22:59 -0500 Subject: [PATCH 1/3] adding gencode fix for linker --- BladebitCUDA.cmake | 4 +++- Config.cmake | 4 +++- Harvester.cmake | 20 +++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/BladebitCUDA.cmake b/BladebitCUDA.cmake index da9a4c81..1fc668fa 100644 --- a/BladebitCUDA.cmake +++ b/BladebitCUDA.cmake @@ -46,9 +46,11 @@ target_compile_options(bladebit_cuda PRIVATE > ) +target_link_options(bladebit_cuda PRIVATE $) + target_link_libraries(bladebit_cuda PRIVATE bladebit_core CUDA::cudart_static)# CUDA::cuda_driver) -set_target_properties(bladebit_cuda PROPERTIES +set_target_properties(bladebit_cuda PROPERTIES MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug> CUDA_RUNTIME_LIBRARY Static CUDA_SEPARABLE_COMPILATION ON diff --git a/Config.cmake b/Config.cmake index 84537b1b..ce59cbbe 100644 --- a/Config.cmake +++ b/Config.cmake @@ -123,6 +123,8 @@ set(preinclude_pch $<${is_msvc_c_cpp}:/FIpch.h> ) +# See: https://gitlab.kitware.com/cmake/cmake/-/issues/18265 +cmake_policy(SET CMP0105 NEW) set(cuda_archs $<${is_cuda_release}: @@ -137,4 +139,4 @@ set(cuda_archs -arch=native # -gencode=arch=compute_52,code=sm_52 # Maxwell > -) \ No newline at end of file +) diff --git a/Harvester.cmake b/Harvester.cmake index b92578fa..1d80a89b 100644 --- a/Harvester.cmake +++ b/Harvester.cmake @@ -19,7 +19,7 @@ add_library(bladebit_harvester SHARED src/fse/hist.h src/fse/huf.h src/fse/mem.h - + src/b3/blake3.c src/b3/blake3_dispatch.c src/b3/blake3.h @@ -38,7 +38,7 @@ add_library(bladebit_harvester SHARED src/b3/blake3_sse41_x86-64_unix.S > > - + src/util/Log.cpp src/util/Util.cpp @@ -99,8 +99,8 @@ add_library(bladebit_harvester SHARED > ) -set_property(TARGET bladebit_harvester PROPERTY PUBLIC_HEADER - src/harvesting/GreenReaper.h +set_property(TARGET bladebit_harvester PROPERTY PUBLIC_HEADER + src/harvesting/GreenReaper.h src/harvesting/GreenReaperPortable.h) install(TARGETS bladebit_harvester @@ -119,14 +119,16 @@ target_compile_definitions(bladebit_harvester PRIVATE GR_EXPORT=1 ) -target_compile_options(bladebit_harvester PRIVATE +target_compile_options(bladebit_harvester PRIVATE ${preinclude_pch} # $<${have_cuda}:${cuda_archs}> ) -target_link_libraries(bladebit_harvester PRIVATE - bladebit_config +target_link_options(bladebit_harvester PRIVATE $) + +target_link_libraries(bladebit_harvester PRIVATE + bladebit_config Threads::Threads $<${have_cuda}:CUDA::cudart_static> @@ -139,7 +141,7 @@ target_link_libraries(bladebit_harvester PRIVATE ) if(CUDAToolkit_FOUND) - set_target_properties(bladebit_harvester PROPERTIES + set_target_properties(bladebit_harvester PROPERTIES EXCLUDE_FROM_ALL ON MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug> CUDA_RUNTIME_LIBRARY Static @@ -151,7 +153,7 @@ endif() # Disable blake3 conversion loss of data warnings if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") - set_source_files_properties( + set_source_files_properties( src/b3/blake3_avx2.c src/b3/blake3_avx512.c src/b3/blake3_sse41.c From 13c22fdfec9f19314a46704be29f8946fa101cba Mon Sep 17 00:00:00 2001 From: wallentx Date: Tue, 30 May 2023 14:46:52 -0500 Subject: [PATCH 2/3] I AM LINTER --- Config.cmake | 1 + Harvester.cmake | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Config.cmake b/Config.cmake index ce59cbbe..ad38cce1 100644 --- a/Config.cmake +++ b/Config.cmake @@ -125,6 +125,7 @@ set(preinclude_pch # See: https://gitlab.kitware.com/cmake/cmake/-/issues/18265 cmake_policy(SET CMP0105 NEW) + set(cuda_archs $<${is_cuda_release}: diff --git a/Harvester.cmake b/Harvester.cmake index 1d80a89b..8fe46f0b 100644 --- a/Harvester.cmake +++ b/Harvester.cmake @@ -19,7 +19,7 @@ add_library(bladebit_harvester SHARED src/fse/hist.h src/fse/huf.h src/fse/mem.h - + src/b3/blake3.c src/b3/blake3_dispatch.c src/b3/blake3.h @@ -38,7 +38,7 @@ add_library(bladebit_harvester SHARED src/b3/blake3_sse41_x86-64_unix.S > > - + src/util/Log.cpp src/util/Util.cpp @@ -99,8 +99,8 @@ add_library(bladebit_harvester SHARED > ) -set_property(TARGET bladebit_harvester PROPERTY PUBLIC_HEADER - src/harvesting/GreenReaper.h +set_property(TARGET bladebit_harvester PROPERTY PUBLIC_HEADER + src/harvesting/GreenReaper.h src/harvesting/GreenReaperPortable.h) install(TARGETS bladebit_harvester @@ -119,16 +119,17 @@ target_compile_definitions(bladebit_harvester PRIVATE GR_EXPORT=1 ) -target_compile_options(bladebit_harvester PRIVATE +target_compile_options(bladebit_harvester PRIVATE ${preinclude_pch} # $<${have_cuda}:${cuda_archs}> ) -target_link_options(bladebit_harvester PRIVATE $) +target_link_options(bladebit_harvester PRIVATE $) -target_link_libraries(bladebit_harvester PRIVATE - bladebit_config +target_link_libraries(bladebit_harvester PRIVATE + bladebit_config Threads::Threads $<${have_cuda}:CUDA::cudart_static> @@ -141,7 +142,7 @@ target_link_libraries(bladebit_harvester PRIVATE ) if(CUDAToolkit_FOUND) - set_target_properties(bladebit_harvester PROPERTIES + set_target_properties(bladebit_harvester PROPERTIES EXCLUDE_FROM_ALL ON MSVC_RUNTIME_LIBRARY MultiThreaded$<$:Debug> CUDA_RUNTIME_LIBRARY Static @@ -153,7 +154,7 @@ endif() # Disable blake3 conversion loss of data warnings if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") - set_source_files_properties( + set_source_files_properties( src/b3/blake3_avx2.c src/b3/blake3_avx512.c src/b3/blake3_sse41.c From f6a915a6c20473bcfaf02f15aefbfe2084ebbb19 Mon Sep 17 00:00:00 2001 From: wallentx Date: Tue, 30 May 2023 14:53:40 -0500 Subject: [PATCH 3/3] argg keyboard --- Harvester.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Harvester.cmake b/Harvester.cmake index 8fe46f0b..f521632a 100644 --- a/Harvester.cmake +++ b/Harvester.cmake @@ -125,8 +125,7 @@ target_compile_options(bladebit_harvester PRIVATE # $<${have_cuda}:${cuda_archs}> ) -target_link_options(bladebit_harvester PRIVATE $) +target_link_options(bladebit_harvester PRIVATE $) target_link_libraries(bladebit_harvester PRIVATE bladebit_config