From 3288bb7601fe7cc0068367c4e13f9e7924e170a6 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 3 Aug 2021 12:17:53 -0700 Subject: [PATCH 01/53] updated 7z command in create package --- package/create_package.sh | 188 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100755 package/create_package.sh diff --git a/package/create_package.sh b/package/create_package.sh new file mode 100755 index 0000000..28560c6 --- /dev/null +++ b/package/create_package.sh @@ -0,0 +1,188 @@ +#!/bin/bash +args=("$@") + +# be wary of /i /s /q :: -n? (-s is subfolders?) (-q is no confirmation) + +set +v +# create package for Gpufit, assumes everything is compiled + +if [[ -z $1 ]]; +then + echo specify build base path + exit 3 +fi + + +if [[ -z $2 ]]; +then + echo specify version + exit 3 +fi + + +if [[ -z $3 ]]; +then + echo specify source base path + exit 3 +fi + + +# define paths + +export BUILD_BASE=${args[0]} +export VERSION=${args[1]} +export SOURCE_BASE=${args[2]} + +export OUTPUT_NAME=Gpufit_$VERSION +export ROOT_INSTALL=$BUILD_BASE/install +export PACKAGE_INSTALL=$BUILD_BASE/install/$OUTPUT_NAME +export OUTPUT_ZIP=$ROOT_INSTALL/${OUTPUT_NAME}_linux.zip +export OUTPUT_DEB=$ROOT_INSTALL/${OUTPUT_NAME}.deb + +export PERFORMANCE_TEST_INSTALL=$PACKAGE_INSTALL/gpufit_performance_test +export PYTHON_INSTALL=$PACKAGE_INSTALL/PYTHON +export x64_MATLAB_INSTALL=$PACKAGE_INSTALL/matlab64 +export x64_JAVA_INSTALL=$PACKAGE_INSTALL/java64 +export SDK_INSTALL_ROOT=$PACKAGE_INSTALL/gpufit_sdk +export DEB_ROOT=$PACKAGE_INSTALL + +export x64_BUILD=$BUILD_BASE +#export x64_BUILD_LIB=$BUILD_BASE/Gpufit + + +export x64_PYTHON_BUILD=$x64_BUILD/pyGpufit/dist + +export x64_MATLAB_BUILD=$x64_BUILD/matlab + +export x64_JAVA_BUILD=$x64_BUILD/java + +export EXAMPLES_SOURCE=$SOURCE_BASE/examples +export PYTHON_SOURCE=$SOURCE_BASE/Gpufit/python +export MATLAB_SOURCE=$SOURCE_BASE/Gpufit/matlab +export SDK_README_SOURCE=$SOURCE_BASE/package/sdk_readme.txt + +export MANUAL_SOURCE=$SOURCE_BASE/docs/_build/latex/Gpufit.pdf +export MANUAL_INSTALL=$PACKAGE_INSTALL/Gpufit_VERSION_Manual.pdf + +# clean up (if necessary) + +if [[ -e "$ROOT_INSTALL" ]]; +then + rm -r "$ROOT_INSTALL" +fi +#if [[ -e "$OUTPUT_ZIP" ]]; +#then +# rm "$OUTPUT_ZIP" +#fi +#if [[ -e "$OUTPUT_DEB" ]]; +#then +# rm "$OUTPUT_DEB" +#fi + +# create root folder + +echo create root directory +mkdir $ROOT_INSTALL +mkdir $PACKAGE_INSTALL + +# create .deb package +echo collect .deb files +mkdir $DEB_ROOT/DEBIAN +cp "$SOURCE_BASE/package/control" "$DEB_ROOT/DEBIAN" +sed -i "s/version_string/${VERSION}/" $DEB_ROOT/DEBIAN/control + +mkdir $DEB_ROOT/usr +mkdir $DEB_ROOT/usr/local +mkdir $DEB_ROOT/usr/lib +cp "$x64_BUILD/Gpufit/libGpufit.so" "$DEB_ROOT/usr/lib" +cp "$x64_BUILD/Cpufit/libCpufit.so" "$DEB_ROOT/usr/lib" + +mkdir $DEB_ROOT/usr/local/include +cp "$SOURCE_BASE/Gpufit/gpufit.h" "$DEB_ROOT/usr/local/include" + +mkdir $DEB_ROOT/usr/local/bin +cp "$x64_BUILD/Gpufit_Cpufit_Performance_Comparison" "$DEB_ROOT/usr/local/bin" + +echo creating .deb +(cd ${DEB_ROOT}/.. && dpkg-deb --build $OUTPUT_NAME) + +echo delete temp files +rm -r $DEB_ROOT +mkdir $PACKAGE_INSTALL +mv ${OUTPUT_DEB} ${PACKAGE_INSTALL} + +# copy main readme (is markdown, written as txt) and license. + +cp "$SOURCE_BASE/README.md" "$PACKAGE_INSTALL/README.txt" +cp "$SOURCE_BASE/LICENSE.txt" "$PACKAGE_INSTALL" + +# copy manual + +#if [[ ! -e "$MANUAL_SOURCE" ]]; +#then +# echo file $MANUAL_SOURCE required, does not exist +# exit 3 +#fi +# +#cp "$MANUAL_SOURCE" "$MANUAL_INSTALL" + +# copy performance test + +echo collect performance test application +mkdir $PERFORMANCE_TEST_INSTALL +cp "$EXAMPLES_SOURCE/Gpufit_Cpufit_Performance_Comparison_readme.txt" "$PERFORMANCE_TEST_INSTALL/README.txt" + +mkdir $PERFORMANCE_TEST_INSTALL/linux +cp "$x64_BUILD/Gpufit_Cpufit_Performance_Comparison" "$PERFORMANCE_TEST_INSTALL/linux" +cp "$x64_BUILD/Gpufit/libGpufit.so" "$PERFORMANCE_TEST_INSTALL/linux" +cp "$x64_BUILD/Cpufit/libCpufit.so" "$PERFORMANCE_TEST_INSTALL/linux" + + +# copy Python packages + +echo collect python +mkdir $PYTHON_INSTALL +cp "$x64_PYTHON_BUILD/pyGpufit-$VERSION-py2.py3-none-any.whl" "$PYTHON_INSTALL/pyGpufit-$VERSION-py2.py3-none-any.whl" +cp "$PYTHON_SOURCE/README.txt" "$PYTHON_INSTALL" +cp "$PYTHON_SOURCE/examples" "$PYTHON_INSTALL/examples" -n -r + + +# copy Matlab 64 bit + +echo collect matlab64 +mkdir $x64_MATLAB_INSTALL +cp "$x64_MATLAB_BUILD" "$x64_MATLAB_INSTALL" -r +cp "$MATLAB_SOURCE/examples" "$x64_MATLAB_INSTALL/examples" -n -r + + +# copy Java 64 bit + +echo collect java64 +mkdir $x64_JAVA_INSTALL +cp "$x64_JAVA_BUILD" "$x64_JAVA_INSTALL" -r + + +# copy SDK_INSTALL_ROOT + +echo collect SDK +mkdir $SDK_INSTALL_ROOT +cp "$SDK_README_SOURCE" "$SDK_INSTALL_ROOT/README.txt" + +mkdir $SDK_INSTALL_ROOT/include +cp "$SOURCE_BASE/Gpufit/gpufit.h" "$SDK_INSTALL_ROOT/include" + +mkdir $SDK_INSTALL_ROOT/linux +cp "$x64_BUILD/Gpufit/libGpufit.so" "$SDK_INSTALL_ROOT/linux" +#cp "$x64_BUILD_LIB/Gpufit.a" "$SDK_INSTALL_ROOT/linux" + + +# zip content of temp folder with 7-Zip if available +if 7z a -bso0 "${OUTPUT_ZIP}" "${PACKAGE_INSTALL}" +then + #it worked + echo Created ${OUTPUT_ZIP} +else + echo Packing ${OUTPUT_ZIP} failed +fi + + From 90383194f97b693c2ffd35faac1df77eb5004fb0 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Thu, 11 Jul 2019 11:32:38 -0700 Subject: [PATCH 02/53] Fixed CUBLAS linking on linux, static and dynamic --- Gpufit/CMakeLists.txt | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index e1d5d2d..ef5a08f 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -194,15 +194,29 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND CUDA_VERSION VERSION_GREATER "6.5") add_custom_command( TARGET Gpufit POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CUBLAS_DLL} $ ) + target_link_libraries( Gpufit ${CUDA_CUBLAS_LIBRARIES} ) else() - set( CUDA_CUBLAS_LIBRARIES - ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libcublas_static.a - ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libculibos.a ) - endif() - + set( STATIC_CUBLAS ON CACHE BOOL "ON | OFF") + if ( STATIC_CUBLAS ) + find_cuda_helper_libs(cublas_static) + find_cuda_helper_libs(cublasLt_static) + find_cuda_helper_libs(culibos) + + set( CUDA_CUBLAS_LIBRARIES + ${CUDA_cublas_static_LIBRARY} + ${CUDA_cublasLt_static_LIBRARY} + ${CUDA_cudart_static_LIBRARY} + ${CUDA_culibos_LIBRARY} + dl + pthread + rt ) + target_link_libraries( Gpufit ${CUDA_CUBLAS_LIBRARIES} ) + else () + # Dynamic Link can be done with a single function call + CUDA_ADD_CUBLAS_TO_TARGET( Gpufit ) + endif () + endif() add_definitions( -DUSE_CUBLAS ) - - target_link_libraries( Gpufit ${CUDA_CUBLAS_LIBRARIES} ) endif() elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 ) message( STATUS "CUBLAS: 32-bit architecture detected; USE_CUBLAS flag ignored." ) From 5787df2ff96842a804f6fec42f1b5f00ac94f486 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 10 Aug 2021 11:11:20 -0700 Subject: [PATCH 03/53] Added scripts for binary release, install, and testing in linux --- Gpufit/tests/CMakeLists.txt | 8 ++++++++ Gpufit/tests/test_all.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 Gpufit/tests/test_all.sh diff --git a/Gpufit/tests/CMakeLists.txt b/Gpufit/tests/CMakeLists.txt index 2f03749..cd31a99 100644 --- a/Gpufit/tests/CMakeLists.txt +++ b/Gpufit/tests/CMakeLists.txt @@ -10,3 +10,11 @@ add_boost_test( Gpufit Gauss_Fit_2D_Rotated ) add_boost_test( Gpufit Cauchy_Fit_2D_Elliptic ) add_boost_test( Gpufit Fletcher_Powell_Helix_Fit ) add_boost_test( Gpufit Brown_Dennis_Fit ) + +if( UNIX ) + # Copy over run tests script + file(COPY "${CMAKE_SOURCE_DIR}/Gpufit/tests/test_all.sh" + DESTINATION "${CMAKE_BINARY_DIR}" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) +endif() diff --git a/Gpufit/tests/test_all.sh b/Gpufit/tests/test_all.sh new file mode 100755 index 0000000..640f905 --- /dev/null +++ b/Gpufit/tests/test_all.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +printf "Gauss 2D Rotated\n" +./Gpufit_Test_Gauss_Fit_2D_Rotated + +printf "\nGauss 2D Elliptic\n" +./Gpufit_Test_Gauss_Fit_2D_Elliptic + +printf "\nGauss 2D\n" +./Gpufit_Test_Gauss_Fit_2D + +printf "\nGauss 1D\n" +./Gpufit_Test_Gauss_Fit_1D + +printf "\nLinear 1D\n" +./Gpufit_Test_Linear_Fit_1D + +printf "\nFletcher Powell Helix\n" +./Gpufit_Test_Fletcher_Powell_Helix_Fit + +printf "\nError Handling\n" +./Gpufit_Test_Error_Handling + +printf "\nCauchy Fit 2D Elliptic\n" +./Gpufit_Test_Cauchy_Fit_2D_Elliptic + +printf "\nBrown Dennis\n" +./Gpufit_Test_Brown_Dennis_Fit + +printf "\nTest Consistency\n" +./Cpufit_Gpufit_Test_Consistency + + + From 14f79f5d45c66db377b6e95c20c2319f8716b5a8 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 10 Aug 2021 11:24:37 -0700 Subject: [PATCH 04/53] added linux python install script --- CMakeLists.txt | 7 +++++++ package/install_gpufit_python.sh | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 package/install_gpufit_python.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 898353f..fb78d78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,13 @@ if( PYTHONINTERP_FOUND ) "${Python_WORKING_DIRECTORY}" ) endif() + if( UNIX ) + # Copy over install file for python integration + configure_file( "${CMAKE_SOURCE_DIR}/package/install_gpufit_python.sh" + "${CMAKE_BINARY_DIR}/install_gpufit_python.sh" + COPYONLY + ) + endif() endif() # Tests diff --git a/package/install_gpufit_python.sh b/package/install_gpufit_python.sh new file mode 100644 index 0000000..47fe32f --- /dev/null +++ b/package/install_gpufit_python.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +pip3 install pyGpufit/dist/pyGpufit-1.1.0-py2.py3-none-any.whl From f283f450b20cdd2da4964bda88f12e786c205f8c Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 10 Aug 2021 10:59:33 -0700 Subject: [PATCH 05/53] updated file permissions on copy for linux python install --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb78d78..c83065d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,9 +186,9 @@ if( PYTHONINTERP_FOUND ) endif() if( UNIX ) # Copy over install file for python integration - configure_file( "${CMAKE_SOURCE_DIR}/package/install_gpufit_python.sh" - "${CMAKE_BINARY_DIR}/install_gpufit_python.sh" - COPYONLY + file(COPY "${CMAKE_SOURCE_DIR}/package/install_gpufit_python.sh" + DESTINATION "${CMAKE_BINARY_DIR}" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() endif() From 95b136e8560a096f40b79f57e6403c5fdb9c35eb Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 10 Aug 2021 11:04:57 -0700 Subject: [PATCH 06/53] updated version in linus python install script --- package/install_gpufit_python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/install_gpufit_python.sh b/package/install_gpufit_python.sh index 47fe32f..d31584c 100644 --- a/package/install_gpufit_python.sh +++ b/package/install_gpufit_python.sh @@ -1,3 +1,3 @@ #!/bin/bash -pip3 install pyGpufit/dist/pyGpufit-1.1.0-py2.py3-none-any.whl +pip3 install pyGpufit/dist/pyGpufit-1.2.0-py2.py3-none-any.whl From 8a0f84559877f92a46badab71ad75dd9bacdc985 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Thu, 12 Aug 2021 14:30:16 -0700 Subject: [PATCH 07/53] use new cmake cuda tools, requires cmake 3.18 replaced depricated FindCuda with new LANGUAGES CUDA simplifies architecture and cublas --- CMakeLists.txt | 2 +- Gpufit/CMakeLists.txt | 179 ++++++++------------------------- Gpufit/examples/CMakeLists.txt | 2 +- 3 files changed, 44 insertions(+), 139 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a33a06..5745704 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required( VERSION 3.11 ) set_property( GLOBAL PROPERTY USE_FOLDERS ON ) if( NOT PROJECT_NAME ) - project( Gpufit VERSION 1.2.0 ) + project( Gpufit VERSION 1.2.0 LANGUAGES CUDA CXX) include( CTest ) endif() diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index 03572be..57b108d 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -1,135 +1,61 @@ # CUDA # -# Uses the following variables: -# -# CUDA_ARCHITECTURES (Default All) -# -- Argument passed to CUDA_SELECT_NVCC_ARCH_FLAGS(...) -# resulting in code_generation_flags -# (see http://cmake.org/cmake/help/v3.7/module/FindCUDA.html). -# CUDA_ARCHITECTURES: Auto | Common | All | ARCH_AND_PTX ... -# Auto: Detects local machine GPU architecture. -# Common: Covers common subset of architectures. -# All: Covers all known architectures. -# ARCH_AND_PTX: NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX -# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal -# NUM: Any number. -# Only those pairs are currently accepted by NVCC though: -# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 -# Examples: -# 2.1(2.0) results in -# -gencode;arch=compute_20,code=sm_21 -# Kepler+Tesla results in -# -gencode;arch=compute_37,code=sm_37 -# 6.2+PTX results in -# -gencode;arch=compute_62,code=sm_62;-gencode;arch=compute_62,code=compute_62 -# -# CUDA_NVCC_FLAGS (Default ${code_generation_flags}) -# -- Additional NVCC command line arguments -# (see http://cmake.org/cmake/help/v3.7/module/FindCUDA.html). -# NOTE that multiple arguments must be semi-colon delimited -# (e.g. --compiler-options;-Wall) -# -# Multiple CUDA versions installed, specify which version to use -# Set CUDA_BIN_PATH before running CMake or CUDA_TOOLKIT_ROOT_DIR after first configuration -# to installation folder of desired CUDA version - -find_package( CUDA 6.5 REQUIRED ) - -set( CUDA_ARCHITECTURES ${DEFAULT_CUDA_ARCH} CACHE STRING - "Auto | Common | All | ... see CUDA_SELECT_NVCC_ARCH_FLAGS(...)" ) - -if( CUDA_ARCHITECTURES STREQUAL Auto ) - - set( file ${PROJECT_BINARY_DIR}/detect_cuda_architectures.cpp ) - file( WRITE ${file} "" - "#include \n" - "#include \n" - "int main()\n" - "{\n" - " int count = 0;\n" - " if (cudaSuccess != cudaGetDeviceCount(&count)) return -1;\n" - " if (count == 0) return -1;\n" - " for (int device = 0; device < count; ++device)\n" - " {\n" - " cudaDeviceProp prop;\n" - " if (cudaSuccess == cudaGetDeviceProperties(&prop, device))\n" - " std::printf(\"%d.%d \", prop.major, prop.minor);\n" - " }\n" - " return 0;\n" - "}\n" - ) - try_run( run_result compile_result ${PROJECT_BINARY_DIR} ${file} - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}" - LINK_LIBRARIES ${CUDA_LIBRARIES} - RUN_OUTPUT_VARIABLE architectures - ) - if( run_result EQUAL 0 ) - string( REPLACE "2.1" "2.1(2.0)" architectures "${architectures}" ) - if( CUDA_VERSION VERSION_LESS "7.0" ) - string( REGEX REPLACE "3\\.[27]|5\\.[23]|6\\.[01]" "5.2+PTX" architectures "${architectures}" ) - elseif( CUDA_VERSION VERSION_LESS "8.0" ) - string( REGEX REPLACE "5\\.3|6\\.[01]" "5.3+PTX" architectures "${architectures}" ) - endif() - set( CUDA_ARCHITECTURES "${architectures}" ) - endif() - -elseif( CUDA_ARCHITECTURES STREQUAL All ) +# Uses the CMAKE standard CUDA tools + +cmake_minimum_required(VERSION 3.18) + +if(NOT DEFINED CMAKE_CUDA_STANDARD) + set(CMAKE_CUDA_STANDARD 14) + set(CMAKE_CUDA_STANDARD_REQUIRED ON) +endif() + + +message( STATUS "CMAKE_CUDA_COMPILER_VERSION=${CMAKE_CUDA_COMPILER_VERSION}") + # All does not include the latest PTX! - set( CUDA_ARCHITECTURES "" ) + set( CMAKE_CUDA_ARCHITECTURES_D "" ) - if( CUDA_VERSION VERSION_LESS "12.0" ) - list( INSERT CUDA_ARCHITECTURES 0 "3.5" "5.0" "5.2" ) + if( CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "12.0" ) + list( INSERT CMAKE_CUDA_ARCHITECTURES_D 0 35 50 52 ) endif() - if( CUDA_VERSION VERSION_LESS "11.0" ) - list( INSERT CUDA_ARCHITECTURES 0 "3.0" "3.2") + if( CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.0" ) + list( INSERT CMAKE_CUDA_ARCHITECTURES_D 0 30 32) endif() - if( CUDA_VERSION VERSION_LESS "9.0" ) - list( INSERT CUDA_ARCHITECTURES 0 "2.0" "2.1(2.0)" ) + if( CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "9.0" ) + list( INSERT CMAKE_CUDA_ARCHITECTURES_D 0 20 21 ) endif() - - if( CUDA_VERSION VERSION_GREATER "6.5" ) - list( APPEND CUDA_ARCHITECTURES "5.3" ) + + + if( CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "6.5" ) + list( APPEND CMAKE_CUDA_ARCHITECTURES_D 53 ) endif() - if( CUDA_VERSION VERSION_GREATER "7.5" ) - list( APPEND CUDA_ARCHITECTURES "6.0" "6.1" ) + if( CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "7.5" ) + list( APPEND CMAKE_CUDA_ARCHITECTURES_D 60 61 ) endif() - if( CUDA_VERSION VERSION_GREATER "8.0" ) - list( APPEND CUDA_ARCHITECTURES "7.0" "7.2") + if( CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "8.0" ) + list( APPEND CMAKE_CUDA_ARCHITECTURES_D 70 72) endif() - if( CUDA_VERSION VERSION_GREATER "9.2" ) - list( APPEND CUDA_ARCHITECTURES "7.5" ) + if( CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "9.2" ) + list( APPEND CMAKE_CUDA_ARCHITECTURES_D 75 ) endif() - if( CUDA_VERSION VERSION_GREATER "10.2" ) - list( APPEND CUDA_ARCHITECTURES "8.0" ) + if( CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "10.2" ) + list( APPEND CMAKE_CUDA_ARCHITECTURES_D 80 ) endif() - if( CUDA_VERSION VERSION_GREATER "11.0" ) - list( APPEND CUDA_ARCHITECTURES "8.6" ) + if( CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "11.0" ) + list( APPEND CMAKE_CUDA_ARCHITECTURES_D 86 ) endif() - - string( APPEND CUDA_ARCHITECTURES "+PTX" ) - -endif() +# string( APPEND CMAKE_CUDA_ARCHITECTURES "+PTX" ) + set( CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_D}" CACHE STRING "List of architectures to compile, default is all") -message( STATUS "CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES}" ) - -CUDA_SELECT_NVCC_ARCH_FLAGS( code_generation_flags "${CUDA_ARCHITECTURES}" ) -list( APPEND CUDA_NVCC_FLAGS ${code_generation_flags} ) - -message( STATUS "CUDA_NVCC_FLAGS=${code_generation_flags}" ) - -if( NOT WIN32 ) - list( APPEND CUDA_NVCC_FLAGS --std=c++11) -endif() # Gpufit - set( GpuHeaders gpufit.h constants.h @@ -177,7 +103,7 @@ source_group("CUDA Source Files" FILES ${GpuCudaSources}) source_group("CUDA Model Files" FILES ${GpuCudaModels}) source_group("CUDA Estimator Files" FILES ${GpuCudaEstimators}) -cuda_add_library( Gpufit SHARED +add_library( Gpufit SHARED ${GpuHeaders} ${GpuSources} ${GpuCudaHeaders} @@ -192,40 +118,19 @@ set_target_properties( Gpufit CXX_VISIBILITY_PRESET hidden ) -# USE_CUBLAS -if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND CUDA_VERSION VERSION_GREATER "6.5") +# USE_CUBLAS +if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "6.5") set( USE_CUBLAS ${DEFAULT_USE_CUBLAS} CACHE BOOL "ON | OFF") if( USE_CUBLAS ) - if ( WIN32 ) - set( CUBLAS_DLL - "${CUDA_TOOLKIT_ROOT_DIR}/bin/cublas64_${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}.dll" ) - add_custom_command( TARGET Gpufit POST_BUILD - COMMAND ${CMAKE_COMMAND} -E - copy_if_different ${CUBLAS_DLL} $ ) - target_link_libraries( Gpufit ${CUDA_CUBLAS_LIBRARIES} ) - else() + find_package(CUDAToolkit REQUIRED) set( STATIC_CUBLAS ON CACHE BOOL "ON | OFF") if ( STATIC_CUBLAS ) - find_cuda_helper_libs(cublas_static) - find_cuda_helper_libs(cublasLt_static) - find_cuda_helper_libs(culibos) - - set( CUDA_CUBLAS_LIBRARIES - ${CUDA_cublas_static_LIBRARY} - ${CUDA_cublasLt_static_LIBRARY} - ${CUDA_cudart_static_LIBRARY} - ${CUDA_culibos_LIBRARY} - dl - pthread - rt ) - target_link_libraries( Gpufit ${CUDA_CUBLAS_LIBRARIES} ) + target_link_libraries( Gpufit CUDA::cublas_static CUDA::cublasLt_static) else () - # Dynamic Link can be done with a single function call - CUDA_ADD_CUBLAS_TO_TARGET( Gpufit ) + target_link_libraries( Gpufit CUDA::cublas CUDA::cublasLt) endif () + add_definitions( -DUSE_CUBLAS ) endif() - add_definitions( -DUSE_CUBLAS ) - endif() elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 ) message( STATUS "CUBLAS: 32-bit architecture detected; USE_CUBLAS flag ignored." ) elseif( CUDA_VERSION VERSION_LESS "7.0" ) diff --git a/Gpufit/examples/CMakeLists.txt b/Gpufit/examples/CMakeLists.txt index d92178c..c59874c 100644 --- a/Gpufit/examples/CMakeLists.txt +++ b/Gpufit/examples/CMakeLists.txt @@ -8,7 +8,7 @@ function( add_example module name ) endfunction() function( add_cuda_example module name ) - cuda_add_executable( ${name} ${name}.cu ) + add_executable( ${name} ${name}.cu ) target_link_libraries( ${name} ${module} ) set_property( TARGET ${name} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}" ) From 664420e4cf335becb747065d30b81b45e0a65925 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 12:12:27 -0700 Subject: [PATCH 08/53] automated build with github actions (Windows only) --- .github/workflows/ci.yml | 96 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a504ff5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: Build + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + # explicit include-based build matrix of known valid options + matrix: + include: + # Windows2019 & VS 2019 supports cuda 10.1+ + - os: windows-2019 + cuda: "11.4.0" + visual_studio: "Visual Studio 16 2019" + python: "3.9" + + env: + build_dir: "build" + config: "Release" + + steps: + - uses: actions/checkout@v2 + + - name: Cache build + uses: actions/cache@v3 + with: + path: ${{github.workspace}}/build + key: ${{ matrix.os }}-build + restore-keys: ${{ matrix.os }}-build + + - name: Setup Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: "${{ matrix.python }}" + cache: "pip" # caching pip dependencies + + - name: Upgrade Pip and Install wheel + run: | + python.exe -m pip install --upgrade pip + pip install wheel + + - name: Install CUDA + uses: Jimver/cuda-toolkit@v0.2.8 + id: cuda-toolkit + with: + sub-packages: '["nvcc", "visual_studio_integration", "cublas", "curand", "nvrtc", "cudart"]' + cuda: ${{ matrix.cuda }} + method: network + use-github-cache: false + + - name: nvcc check + shell: powershell + run: | + nvcc -V + ls $env:CUDA_PATH + ls $env:CUDA_PATH\bin + ls $env:CUDA_PATH\include + + - name: cmake version + shell: bash + run: cmake --version + + - name: Configure CMake + id: configure + shell: bash + run: cmake source -B ${{ env.build_dir }} -G "${{ matrix.visual_studio }}" -A x64 + + - name: Configure Error Processing + if: ${{ (failure() && steps.configure.outcome == 'failure') || success() }} + working-directory: ${{ env.build_dir }} + shell: bash + run: | + if [[ -f "CMakeFiles/CMakeOutput.log" ]]; then + echo "---- CMakeFiles/CMakeOutput.log" + cat CMakeFiles/CMakeOutput.log + echo "----" + fi + if [[ -f "CMakeFiles/CMakeError.log" ]]; then + echo "---- CMakeFiles/CMakeError.log" + cat CMakeFiles/CMakeError.log + echo "----" + fi + + - name: Build + working-directory: ${{ env.build_dir }} + run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} + path: build/Release/**/* From d289462b582269128cb4fe70edf7c99aa17f6df5 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 12:27:15 -0700 Subject: [PATCH 09/53] source folder is current directory --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a504ff5..3cd3044 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Configure CMake id: configure shell: bash - run: cmake source -B ${{ env.build_dir }} -G "${{ matrix.visual_studio }}" -A x64 + run: cmake . -B ${{ env.build_dir }} -G "${{ matrix.visual_studio }}" -A x64 - name: Configure Error Processing if: ${{ (failure() && steps.configure.outcome == 'failure') || success() }} From 69dabd2010e6111f4989eefc17bf09b59a5c58db Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 12:56:54 -0700 Subject: [PATCH 10/53] don't install visual_studio_integration subpackage on linux --- .github/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cd3044..5349b9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: cuda: "11.4.0" visual_studio: "Visual Studio 16 2019" python: "3.9" + - os: ubuntu-20.04 + cuda: "11.4.0" + python: "3.9" env: build_dir: "build" @@ -43,15 +46,24 @@ jobs: python.exe -m pip install --upgrade pip pip install wheel - - name: Install CUDA + - name: Install CUDA (Windows) uses: Jimver/cuda-toolkit@v0.2.8 - id: cuda-toolkit + if: runner.os == 'Windows' with: sub-packages: '["nvcc", "visual_studio_integration", "cublas", "curand", "nvrtc", "cudart"]' cuda: ${{ matrix.cuda }} method: network use-github-cache: false + - name: Install CUDA (Linux) + uses: Jimver/cuda-toolkit@v0.2.8 + if: runner.os == 'Linux' + with: + sub-packages: '["nvcc", "curand", "nvrtc", "cudart"]' + cuda: ${{ matrix.cuda }} + method: network + use-github-cache: false + - name: nvcc check shell: powershell run: | From 5f3459b62496933a9b6e077ac24ec301ce0c776f Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 12:57:55 -0700 Subject: [PATCH 11/53] call python not python.exe for cross-platform support --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5349b9d..5532993 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: Upgrade Pip and Install wheel run: | - python.exe -m pip install --upgrade pip + python -m pip install --upgrade pip pip install wheel - name: Install CUDA (Windows) From 9b081f098bf6d160448dd8930f0dc56b564a2f3e Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 15:52:11 -0700 Subject: [PATCH 12/53] linux build improvements --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5532993..0c3f2a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,18 +59,18 @@ jobs: uses: Jimver/cuda-toolkit@v0.2.8 if: runner.os == 'Linux' with: - sub-packages: '["nvcc", "curand", "nvrtc", "cudart"]' + sub-packages: '["nvcc", "nvrtc", "cudart"]' cuda: ${{ matrix.cuda }} method: network use-github-cache: false - name: nvcc check - shell: powershell + shell: bash run: | nvcc -V - ls $env:CUDA_PATH - ls $env:CUDA_PATH\bin - ls $env:CUDA_PATH\include + ls "$CUDA_PATH" + ls "$CUDA_PATH/bin" + ls "$CUDA_PATH/include" - name: cmake version shell: bash From d6218fb9b6013a6dba523e3ec0bcc41fbd1f29c2 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:02:21 -0700 Subject: [PATCH 13/53] fix linux Configure CMake --- .github/workflows/ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c3f2a9..b53fd1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,10 +76,17 @@ jobs: shell: bash run: cmake --version - - name: Configure CMake - id: configure - shell: bash - run: cmake . -B ${{ env.build_dir }} -G "${{ matrix.visual_studio }}" -A x64 + + - name: Configure CMake + id: configure + shell: bash + run: | + if [ "${{ runner.os }}" -eq "Windows" ] + then + cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 + else + cmake . -B "${{ env.build_dir }}" + fi - name: Configure Error Processing if: ${{ (failure() && steps.configure.outcome == 'failure') || success() }} From 47fa46cc26492c5119cf4c5683522f934d210ef0 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:03:22 -0700 Subject: [PATCH 14/53] typo --- .github/workflows/ci.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b53fd1e..5bec705 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,17 +76,16 @@ jobs: shell: bash run: cmake --version - - - name: Configure CMake - id: configure - shell: bash - run: | - if [ "${{ runner.os }}" -eq "Windows" ] - then - cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 - else - cmake . -B "${{ env.build_dir }}" - fi + - name: Configure CMake + id: configure + shell: bash + run: | + if [ "${{ runner.os }}" -eq "Windows" ] + then + cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 + else + cmake . -B "${{ env.build_dir }}" + fi - name: Configure Error Processing if: ${{ (failure() && steps.configure.outcome == 'failure') || success() }} From 8dba739f0fd74dc2f74acf3bcfe91ccb4e82c665 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:10:00 -0700 Subject: [PATCH 15/53] Linux build command is simply make --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bec705..82d26ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,10 +103,16 @@ jobs: echo "----" fi - - name: Build + - name: Build (Windows) working-directory: ${{ env.build_dir }} run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose + - name: Build (Linux) + working-directory: ${{ env.build_dir }} + run: | + cd "${{ env.build_dir }}" + make + - name: Upload Artifacts uses: actions/upload-artifact@v3 with: From 207d073429078c107defb0dfbc268d18eea4d373 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:12:11 -0700 Subject: [PATCH 16/53] add conditionals --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82d26ec..65470ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,10 +104,12 @@ jobs: fi - name: Build (Windows) + if: runner.os == 'Windows' working-directory: ${{ env.build_dir }} run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose - name: Build (Linux) + if: runner.os == 'Linux' working-directory: ${{ env.build_dir }} run: | cd "${{ env.build_dir }}" From f41dd00f4b2d60685e6faa681f34409ba838ada2 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:15:27 -0700 Subject: [PATCH 17/53] create build directory --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65470ac..a5f1ce9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,7 @@ jobs: then cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 else + mkdir "${{ env.build_dir }}" cmake . -B "${{ env.build_dir }}" fi From 979626d9c96192df61257534cdfa066dff7904e9 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:17:56 -0700 Subject: [PATCH 18/53] fix paths --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5f1ce9..37cc876 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,6 @@ jobs: then cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 else - mkdir "${{ env.build_dir }}" cmake . -B "${{ env.build_dir }}" fi @@ -112,9 +111,7 @@ jobs: - name: Build (Linux) if: runner.os == 'Linux' working-directory: ${{ env.build_dir }} - run: | - cd "${{ env.build_dir }}" - make + run: make - name: Upload Artifacts uses: actions/upload-artifact@v3 From a6caf5f64a8617dad576b93fadf049f3d98ec66a Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:24:50 -0700 Subject: [PATCH 19/53] linux cmake -DCMAKE_BUILD_TYPE=RELEASE --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37cc876..a101043 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: then cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 else - cmake . -B "${{ env.build_dir }}" + cmake . -B "${{ env.build_dir }}" -DCMAKE_BUILD_TYPE=RELEASE fi - name: Configure Error Processing From e9c291901eb6072eadd52125da385c5082eda41a Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:28:06 -0700 Subject: [PATCH 20/53] upload entire build folder --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a101043..2661190 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,4 +117,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} - path: build/Release/**/* + path: build/**/* From cead996877cf4cc89ae773c662c465c1fb3b4257 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 16:48:26 -0700 Subject: [PATCH 21/53] separate steps for windows and linux artifacts --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2661190..0ecca16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,8 +113,17 @@ jobs: working-directory: ${{ env.build_dir }} run: make - - name: Upload Artifacts + - name: Upload Artifacts (Windows) uses: actions/upload-artifact@v3 + if: runner.os == 'Windows' + with: + name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} + path: build/Release/**/* + + - name: Upload Artifacts (Linux) + uses: actions/upload-artifact@v3 + if: runner.os == 'Windows' with: name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} path: build/**/* + \ No newline at end of file From c64e19d2260e17d58f9105f429f20efe644c6279 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Fri, 7 Oct 2022 23:13:32 -0700 Subject: [PATCH 22/53] fixed Linux artifact upload --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ecca16..6dfefe7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,7 @@ jobs: - name: Upload Artifacts (Linux) uses: actions/upload-artifact@v3 - if: runner.os == 'Windows' + if: runner.os == 'Linux' with: name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} path: build/**/* From 909a932e52ace0ba2f526b19a734302cc475d922 Mon Sep 17 00:00:00 2001 From: S Barnes Date: Thu, 5 Sep 2019 15:14:39 -0700 Subject: [PATCH 23/53] created .deb file for linux install --- package/control | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 package/control diff --git a/package/control b/package/control new file mode 100644 index 0000000..cc54910 --- /dev/null +++ b/package/control @@ -0,0 +1,10 @@ +Package: gpufit +Version: version_string +Section: base +Priority: optional +Architecture: amd64 +Depends: +Maintainer: Samuel Barnes +Description: GPU-accelerated Levenberg-Marquardt curve fitting toolkit, implemented in CUDA + Requires CUDA video card and driver + Python, Java, and Matlab bindings From 7525638d04b7dd4c085686a28972f3c341ef0e3f Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 11 Oct 2022 13:21:58 -0700 Subject: [PATCH 24/53] add cuda include dir to c++ compiles --- Gpufit/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index c29f8f0..d24c736 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -118,6 +118,8 @@ set_target_properties( Gpufit CXX_VISIBILITY_PRESET hidden ) +target_include_directories( Gpufit SYSTEM PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + # USE_CUBLAS if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER "6.5") set( USE_CUBLAS ${DEFAULT_USE_CUBLAS} CACHE BOOL "ON | OFF") From be45592d24a24aeb000ceb2eb2e029cb4cc76e19 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 11 Oct 2022 14:34:22 -0700 Subject: [PATCH 25/53] attempt to fix static linking with msvc --- CMakeLists.txt | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba4c83d..77464fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ cmake_minimum_required( VERSION 3.11 ) set_property( GLOBAL PROPERTY USE_FOLDERS ON ) +cmake_policy(SET CMP0091 NEW) if( NOT PROJECT_NAME ) project( Gpufit VERSION 1.2.0 LANGUAGES CUDA CXX) @@ -15,17 +16,17 @@ endif() if( NOT CMAKE_CXX_STANDARD ) set( CMAKE_CXX_STANDARD 14 ) endif() - -if( MSVC ) # link runtime statically with MSVC - foreach( type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} ) - string( TOUPPER ${type} TYPE ) - foreach( flags CMAKE_C_FLAGS_${TYPE} CMAKE_CXX_FLAGS_${TYPE} ) - get_property( help CACHE ${flags} PROPERTY HELPSTRING ) - string( REPLACE "/MD" "/MT" ${flags} "${${flags}}" ) - set( ${flags} "${${flags}}" CACHE STRING "${help}" FORCE ) - endforeach() - endforeach() -endif() + +#if( MSVC ) # link runtime statically with MSVC +# foreach( type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} ) +# string( TOUPPER ${type} TYPE ) +# foreach( flags CMAKE_C_FLAGS_${TYPE} CMAKE_CXX_FLAGS_${TYPE} ) +# get_property( help CACHE ${flags} PROPERTY HELPSTRING ) +# string( REPLACE "/MD" "/MT" ${flags} "${${flags}}" ) +# set( ${flags} "${${flags}}" CACHE STRING "${help}" FORCE ) +# endforeach() +# endforeach() +#endif() function( add_launcher target executable arguments working_directory ) if( MSVC12 OR MSVC14 ) @@ -144,6 +145,14 @@ add_subdirectory( Gpufit ) add_subdirectory( examples/c++/gpu_vs_cpu_profiling ) + +# link runtime statically with MSVC +set_property(TARGET Gpufit PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +set_property(TARGET Cpufit PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + + # Launcher # # Uses the following variables: From 42adefe158287b8a8a53b81b52025558f0c2ad39 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 10:21:47 -0700 Subject: [PATCH 26/53] added more version of cuda and ubuntu to test matrix --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dfefe7..2036713 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,15 @@ jobs: include: # Windows2019 & VS 2019 supports cuda 10.1+ - os: windows-2019 - cuda: "11.4.0" + cuda: ["10.1.243", "11.4.0", "11.7.0"] visual_studio: "Visual Studio 16 2019" python: "3.9" - os: ubuntu-20.04 - cuda: "11.4.0" - python: "3.9" + cuda: ["10.1.243","11.4.0","11.7.0"] + python: "3.8" + - os: ubuntu-22.04 + cuda: ["11.5.0","11.7.0"] + python: "3.10" env: build_dir: "build" @@ -126,4 +129,4 @@ jobs: with: name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} path: build/**/* - \ No newline at end of file + From 3636700f6251f52ab3055fd557033f829cf5bcc8 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 10:25:49 -0700 Subject: [PATCH 27/53] remove quotes in matrix --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2036713..de78ca1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,14 +14,14 @@ jobs: include: # Windows2019 & VS 2019 supports cuda 10.1+ - os: windows-2019 - cuda: ["10.1.243", "11.4.0", "11.7.0"] + cuda: [10.1.243, 11.4.0, 11.7.0] visual_studio: "Visual Studio 16 2019" python: "3.9" - os: ubuntu-20.04 - cuda: ["10.1.243","11.4.0","11.7.0"] + cuda: [10.1.243,11.4.0,11.7.0] python: "3.8" - os: ubuntu-22.04 - cuda: ["11.5.0","11.7.0"] + cuda: [11.5.0,11.7.0] python: "3.10" env: From 2bc1edd65852353969d2dff8a8b7a9d9942375f3 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 10:55:12 -0700 Subject: [PATCH 28/53] move cuda matrix --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de78ca1..39ba8bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,17 +11,15 @@ jobs: fail-fast: false # explicit include-based build matrix of known valid options matrix: + cuda: [10.1.243, 11.4.0, 11.7.0] include: # Windows2019 & VS 2019 supports cuda 10.1+ - os: windows-2019 - cuda: [10.1.243, 11.4.0, 11.7.0] visual_studio: "Visual Studio 16 2019" python: "3.9" - os: ubuntu-20.04 - cuda: [10.1.243,11.4.0,11.7.0] python: "3.8" - os: ubuntu-22.04 - cuda: [11.5.0,11.7.0] python: "3.10" env: From 9d0cf73ef40e8d5b7b9755582adafecfdb0a1181 Mon Sep 17 00:00:00 2001 From: Samuel Barnes Date: Wed, 12 Oct 2022 11:04:08 -0700 Subject: [PATCH 29/53] indentation errors --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39ba8bd..f6a8336 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false # explicit include-based build matrix of known valid options matrix: - cuda: [10.1.243, 11.4.0, 11.7.0] + cuda: [10.1.243, 11.4.0, 11.7.0] include: # Windows2019 & VS 2019 supports cuda 10.1+ - os: windows-2019 From 968e74d29de8902f22227cd23f52289afbe5affe Mon Sep 17 00:00:00 2001 From: Samuel Barnes Date: Wed, 12 Oct 2022 11:11:55 -0700 Subject: [PATCH 30/53] valid cuda-os combinations --- .github/workflows/ci.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6a8336..c3cf44f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,16 +11,32 @@ jobs: fail-fast: false # explicit include-based build matrix of known valid options matrix: - cuda: [10.1.243, 11.4.0, 11.7.0] include: # Windows2019 & VS 2019 supports cuda 10.1+ - os: windows-2019 + cuda: "10.1.243" visual_studio: "Visual Studio 16 2019" python: "3.9" + - os: windows-2019 + cuda: "11.4.0" + visual_studio: "Visual Studio 16 2019" + python: "3.9" + - os: windows-2019 + cuda: "11.7.0" + visual_studio: "Visual Studio 16 2019" + python: "3.9" + - os: ubuntu-20.04 + cuda: "10.1.243" + python: "3.8" + - os: ubuntu-20.04 + cuda: "11.4.0" + python: "3.8" - os: ubuntu-20.04 + cuda: "11.7.0" python: "3.8" - os: ubuntu-22.04 python: "3.10" + cuda: "11.7.0" env: build_dir: "build" From 46fc2294fff77c19c05a662f9cca90ce072795be Mon Sep 17 00:00:00 2001 From: Samuel Barnes Date: Wed, 12 Oct 2022 11:40:32 -0700 Subject: [PATCH 31/53] make pip verbose --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3cf44f..b22b189 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: - name: Upgrade Pip and Install wheel run: | python -m pip install --upgrade pip - pip install wheel + pip -v -v -v install wheel - name: Install CUDA (Windows) uses: Jimver/cuda-toolkit@v0.2.8 From 7becb298677cc60ddcddde565ccfe230cd7b4d37 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 11:50:09 -0700 Subject: [PATCH 32/53] cmake output python location --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b22b189..c3cf44f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: - name: Upgrade Pip and Install wheel run: | python -m pip install --upgrade pip - pip -v -v -v install wheel + pip install wheel - name: Install CUDA (Windows) uses: Jimver/cuda-toolkit@v0.2.8 diff --git a/CMakeLists.txt b/CMakeLists.txt index 77464fe..bab14ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,7 @@ endif() if( PYTHONINTERP_FOUND ) set( Python_WORKING_DIRECTORY "${home}" CACHE PATH "Python working directory" ) + message( STATUS "Python found at: " "${PYTHON_EXECUTABLE}" ) if( Python_WORKING_DIRECTORY ) add_custom_target( RUN_PYTHON ) set_property( TARGET RUN_PYTHON PROPERTY FOLDER CMakePredefinedTargets ) From 22446d845a70ec6b135042715e2d30649a8809cb Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 13:20:19 -0700 Subject: [PATCH 33/53] fix find python in cmake, drop old cuda from ubuntu replace depricated find pythong with new function --- .github/workflows/ci.yml | 3 --- CMakeLists.txt | 10 +++++----- Gpufit/python/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3cf44f..65611b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,9 +25,6 @@ jobs: cuda: "11.7.0" visual_studio: "Visual Studio 16 2019" python: "3.9" - - os: ubuntu-20.04 - cuda: "10.1.243" - python: "3.8" - os: ubuntu-20.04 cuda: "11.4.0" python: "3.8" diff --git a/CMakeLists.txt b/CMakeLists.txt index bab14ba..fb09aeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,14 +104,14 @@ endif() # Python -find_package( PythonInterp ) -if( PYTHONINTERP_FOUND ) +find_package( Python ) +if( Python_FOUND ) function( add_python_launcher target ) set( paths "${CMAKE_BINARY_DIR}/$(Configuration)" ${ARGN} ) list( GET paths -1 working_directory ) string( REPLACE ";" "')\nsys.path.append('" paths "${paths}" ) set( arguments "-i -c \"import sys\nsys.path.append('${paths}')\"" ) - add_launcher( ${target} "${PYTHON_EXECUTABLE}" "${arguments}" "${working_directory}" ) + add_launcher( ${target} "${Python_EXECUTABLE}" "${arguments}" "${working_directory}" ) endfunction() endif() @@ -182,9 +182,9 @@ if( Matlab_FOUND ) endif() endif() -if( PYTHONINTERP_FOUND ) +if( Python_FOUND ) set( Python_WORKING_DIRECTORY "${home}" CACHE PATH "Python working directory" ) - message( STATUS "Python found at: " "${PYTHON_EXECUTABLE}" ) + message( STATUS "Python found at: " "${Python_EXECUTABLE}" ) if( Python_WORKING_DIRECTORY ) add_custom_target( RUN_PYTHON ) set_property( TARGET RUN_PYTHON PROPERTY FOLDER CMakePredefinedTargets ) diff --git a/Gpufit/python/CMakeLists.txt b/Gpufit/python/CMakeLists.txt index 2300e04..d125142 100644 --- a/Gpufit/python/CMakeLists.txt +++ b/Gpufit/python/CMakeLists.txt @@ -40,7 +40,7 @@ add_custom_target( PYTHON_PACKAGE set_property( TARGET PYTHON_PACKAGE PROPERTY FOLDER CMakePredefinedTargets ) add_dependencies( PYTHON_PACKAGE Gpufit ) -if( NOT PYTHONINTERP_FOUND ) +if( NOT Python_FOUND ) message( STATUS "Python NOT found - skipping creation of Python wheel!" ) return() endif() From 540d0869983d2fe3c39a53079f100a7dc235a335 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 13:30:57 -0700 Subject: [PATCH 34/53] found another old python reference --- CMakeLists.txt | 2 +- Gpufit/python/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb09aeb..cae66dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,7 +184,7 @@ endif() if( Python_FOUND ) set( Python_WORKING_DIRECTORY "${home}" CACHE PATH "Python working directory" ) - message( STATUS "Python found at: " "${Python_EXECUTABLE}" ) + message( STATUS "Python found at: " "${PYTHON_EXECUTABLE}" ) if( Python_WORKING_DIRECTORY ) add_custom_target( RUN_PYTHON ) set_property( TARGET RUN_PYTHON PROPERTY FOLDER CMakePredefinedTargets ) diff --git a/Gpufit/python/CMakeLists.txt b/Gpufit/python/CMakeLists.txt index d125142..dc764f0 100644 --- a/Gpufit/python/CMakeLists.txt +++ b/Gpufit/python/CMakeLists.txt @@ -49,9 +49,9 @@ endif() add_custom_target( PYTHON_WHEEL ALL COMMAND ${CMAKE_COMMAND} -E - chdir ${build_directory} "${PYTHON_EXECUTABLE}" setup.py clean --all + chdir ${build_directory} "${Python_EXECUTABLE}" setup.py clean --all COMMAND ${CMAKE_COMMAND} -E - chdir ${build_directory} "${PYTHON_EXECUTABLE}" setup.py bdist_wheel + chdir ${build_directory} "${Python_EXECUTABLE}" setup.py bdist_wheel COMMENT "Preparing Python Wheel" ) set_property( TARGET PYTHON_WHEEL PROPERTY FOLDER CMakePredefinedTargets ) From 1832970de257032c087221b4f3ee084bd0fa9bfa Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 12 Oct 2022 14:14:04 -0700 Subject: [PATCH 35/53] delete redundant message --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cae66dd..b88a722 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,7 +184,6 @@ endif() if( Python_FOUND ) set( Python_WORKING_DIRECTORY "${home}" CACHE PATH "Python working directory" ) - message( STATUS "Python found at: " "${PYTHON_EXECUTABLE}" ) if( Python_WORKING_DIRECTORY ) add_custom_target( RUN_PYTHON ) set_property( TARGET RUN_PYTHON PROPERTY FOLDER CMakePredefinedTargets ) From 39cb33ac8a1cef9073e65f2f11e2ec962fbb4746 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 12:06:34 -0700 Subject: [PATCH 36/53] use jimkring/action-install-cuda-toolkit fork --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dfefe7..3cce05e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,8 @@ jobs: pip install wheel - name: Install CUDA (Windows) - uses: Jimver/cuda-toolkit@v0.2.8 +# uses: Jimver/cuda-toolkit@v0.2.8 + uses: jimkring/action-install-cuda-toolkit@master if: runner.os == 'Windows' with: sub-packages: '["nvcc", "visual_studio_integration", "cublas", "curand", "nvrtc", "cudart"]' @@ -126,4 +127,4 @@ jobs: with: name: ${{ matrix.os }}-x64-cuda-${{ matrix.cuda }} path: build/**/* - \ No newline at end of file + From 5ad294a2493f4b753005a3bcca1f07e5cf8545b5 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 12:12:31 -0700 Subject: [PATCH 37/53] Added cuda 11.3.0 --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ae864e..ef120cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: cuda: "10.1.243" visual_studio: "Visual Studio 16 2019" python: "3.9" + - os: windows-2019 + cuda: "11.3.0" + visual_studio: "Visual Studio 16 2019" - os: windows-2019 cuda: "11.4.0" visual_studio: "Visual Studio 16 2019" @@ -25,6 +28,9 @@ jobs: cuda: "11.7.0" visual_studio: "Visual Studio 16 2019" python: "3.9" + - os: ubuntu-20.04 + cuda: "11.3.0" + python: "3.8" - os: ubuntu-20.04 cuda: "11.4.0" python: "3.8" From cbd44bb35dbe95e93ecfc49400a793494fa76664 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 12:18:38 -0700 Subject: [PATCH 38/53] use jimkring/action-install-cuda-toolkit fork --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef120cb..88f84af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,8 @@ jobs: use-github-cache: false - name: Install CUDA (Linux) - uses: Jimver/cuda-toolkit@v0.2.8 +# uses: Jimver/cuda-toolkit@v0.2.8 + uses: jimkring/action-install-cuda-toolkit@master if: runner.os == 'Linux' with: sub-packages: '["nvcc", "nvrtc", "cudart"]' From c7501512502350c71545b9c207bb2caba1df68e8 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 12:31:06 -0700 Subject: [PATCH 39/53] test latest 11.3.x build 11.3.0 was failing --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88f84af..297a1d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: visual_studio: "Visual Studio 16 2019" python: "3.9" - os: windows-2019 - cuda: "11.3.0" + cuda: "11.3" visual_studio: "Visual Studio 16 2019" - os: windows-2019 cuda: "11.4.0" From a1a927407c28f6a85a85318570da8a9af2e3ddf1 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 12:35:53 -0700 Subject: [PATCH 40/53] try "11.3.1" since "11.3" didn't work --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 297a1d6..c2fd884 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: visual_studio: "Visual Studio 16 2019" python: "3.9" - os: windows-2019 - cuda: "11.3" + cuda: "11.3.1" visual_studio: "Visual Studio 16 2019" - os: windows-2019 cuda: "11.4.0" From 5befd0e717b93e46682cd724d137c7b305120bc8 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 14:14:43 -0700 Subject: [PATCH 41/53] added missing Python version --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2fd884..6598869 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: - os: windows-2019 cuda: "11.3.1" visual_studio: "Visual Studio 16 2019" + python: "3.9" - os: windows-2019 cuda: "11.4.0" visual_studio: "Visual Studio 16 2019" @@ -38,8 +39,8 @@ jobs: cuda: "11.7.0" python: "3.8" - os: ubuntu-22.04 - python: "3.10" cuda: "11.7.0" + python: "3.10" env: build_dir: "build" From 286fda084ad63cc08c9d57dac6dc3fc03d206a8f Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 14:18:26 -0700 Subject: [PATCH 42/53] Set build job name using matrix values --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6598869..6686784 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: jobs: build: + name: ${{ matrix.os }}, Cuda ${{ matrix.cuda }}, Python ${{ matrix.python }}, ${{ matrix.visual_studio }} runs-on: ${{ matrix.os }} strategy: fail-fast: false From fdb075713a433c8f15cb87bc7fbacf8daede9413 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 14:20:12 -0700 Subject: [PATCH 43/53] tweak build job name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6686784..655658b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: jobs: build: - name: ${{ matrix.os }}, Cuda ${{ matrix.cuda }}, Python ${{ matrix.python }}, ${{ matrix.visual_studio }} + name: ${{ matrix.os }} cuda-${{ matrix.cuda }} python-${{ matrix.python }} ${{ matrix.visual_studio }} runs-on: ${{ matrix.os }} strategy: fail-fast: false From a5b687e8e339d59acb581af7d7ec7f9bfd9811a9 Mon Sep 17 00:00:00 2001 From: Jim Kring Date: Sat, 15 Oct 2022 14:22:29 -0700 Subject: [PATCH 44/53] ubuntu 11.3.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 655658b..15da666 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: visual_studio: "Visual Studio 16 2019" python: "3.9" - os: ubuntu-20.04 - cuda: "11.3.0" + cuda: "11.3.1" python: "3.8" - os: ubuntu-20.04 cuda: "11.4.0" From 30da9a0ea10c5d05a490b45869a109e3bab1ca27 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Mon, 17 Oct 2022 14:35:27 -0700 Subject: [PATCH 45/53] update cxx version to 20 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b88a722..86c44cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ if( NOT PROJECT_NAME ) endif() if( NOT CMAKE_CXX_STANDARD ) - set( CMAKE_CXX_STANDARD 14 ) + set( CMAKE_CXX_STANDARD 20 ) endif() #if( MSVC ) # link runtime statically with MSVC From 84d50bba9eb4f90ffcd55c2115a0465da1df6ba2 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Mon, 17 Oct 2022 14:57:21 -0700 Subject: [PATCH 46/53] update cuda c++ standard to 20, cmake to 3.12 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86c44cb..c7822ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # CMake -cmake_minimum_required( VERSION 3.11 ) +cmake_minimum_required( VERSION 3.12 ) set_property( GLOBAL PROPERTY USE_FOLDERS ON ) cmake_policy(SET CMP0091 NEW) @@ -16,6 +16,9 @@ endif() if( NOT CMAKE_CXX_STANDARD ) set( CMAKE_CXX_STANDARD 20 ) endif() +if( NOT CMAKE_CUDA_STANDARD ) + set( CMAKE_CUDA_STANDARD 20 ) +endif() #if( MSVC ) # link runtime statically with MSVC # foreach( type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} ) From 5d8381d640594516523957732d7a711c7ef707e8 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Mon, 17 Oct 2022 16:48:59 -0700 Subject: [PATCH 47/53] moved cuda_standard 20 call, remove commented code --- CMakeLists.txt | 14 -------------- Gpufit/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7822ee..09d287b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,20 +16,6 @@ endif() if( NOT CMAKE_CXX_STANDARD ) set( CMAKE_CXX_STANDARD 20 ) endif() -if( NOT CMAKE_CUDA_STANDARD ) - set( CMAKE_CUDA_STANDARD 20 ) -endif() - -#if( MSVC ) # link runtime statically with MSVC -# foreach( type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} ) -# string( TOUPPER ${type} TYPE ) -# foreach( flags CMAKE_C_FLAGS_${TYPE} CMAKE_CXX_FLAGS_${TYPE} ) -# get_property( help CACHE ${flags} PROPERTY HELPSTRING ) -# string( REPLACE "/MD" "/MT" ${flags} "${${flags}}" ) -# set( ${flags} "${${flags}}" CACHE STRING "${help}" FORCE ) -# endforeach() -# endforeach() -#endif() function( add_launcher target executable arguments working_directory ) if( MSVC12 OR MSVC14 ) diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index d24c736..7d58a89 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.18) if(NOT DEFINED CMAKE_CUDA_STANDARD) - set(CMAKE_CUDA_STANDARD 14) + set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON) endif() From 0326ea9f50f935a6f80ff7486800e5ca37723b89 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Mon, 17 Oct 2022 16:58:50 -0700 Subject: [PATCH 48/53] removed cuda standard required for 20 --- Gpufit/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index 7d58a89..ab096e6 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.18) if(NOT DEFINED CMAKE_CUDA_STANDARD) set(CMAKE_CUDA_STANDARD 20) - set(CMAKE_CUDA_STANDARD_REQUIRED ON) +# set(CMAKE_CUDA_STANDARD_REQUIRED ON) endif() From a72f4a528ecc70d860056fbc647c8d29f15135a8 Mon Sep 17 00:00:00 2001 From: Samuel Barnes Date: Mon, 17 Oct 2022 18:27:42 -0700 Subject: [PATCH 49/53] only c++17 is supported by nvcc --- Gpufit/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index ab096e6..e45c138 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.18) if(NOT DEFINED CMAKE_CUDA_STANDARD) - set(CMAKE_CUDA_STANDARD 20) -# set(CMAKE_CUDA_STANDARD_REQUIRED ON) + set(CMAKE_CUDA_STANDARD 17) + set(CMAKE_CUDA_STANDARD_REQUIRED ON) endif() From 628e00daf37a303347302cf81daa016e39cd6d1f Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 21 Dec 2022 12:51:03 -0800 Subject: [PATCH 50/53] update required cmake version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09d287b..54eee11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # CMake -cmake_minimum_required( VERSION 3.12 ) +cmake_minimum_required( VERSION 3.18 ) set_property( GLOBAL PROPERTY USE_FOLDERS ON ) cmake_policy(SET CMP0091 NEW) From 3be149b4ed99fc7bb1037847e4bf767a721ca588 Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 21 Dec 2022 13:40:46 -0800 Subject: [PATCH 51/53] make c++ standard less restrictive --- CMakeLists.txt | 2 +- Gpufit/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54eee11..a24b835 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ if( NOT PROJECT_NAME ) endif() if( NOT CMAKE_CXX_STANDARD ) - set( CMAKE_CXX_STANDARD 20 ) + set( CMAKE_CXX_STANDARD 11 ) endif() function( add_launcher target executable arguments working_directory ) diff --git a/Gpufit/CMakeLists.txt b/Gpufit/CMakeLists.txt index e45c138..296385a 100644 --- a/Gpufit/CMakeLists.txt +++ b/Gpufit/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.18) if(NOT DEFINED CMAKE_CUDA_STANDARD) - set(CMAKE_CUDA_STANDARD 17) + set(CMAKE_CUDA_STANDARD 11) set(CMAKE_CUDA_STANDARD_REQUIRED ON) endif() From 605780e36ff29ab2277c285bde4ba33b17cd0a9c Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Tue, 27 Dec 2022 16:02:31 -0800 Subject: [PATCH 52/53] Delete CMakeCache.txt during workflow, and fixed bug in ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b787214..f64aea7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,8 @@ jobs: id: configure shell: bash run: | - if [ "${{ runner.os }}" -eq "Windows" ] + rm ${{ env.build_dir }}/CMakeCache.txt + if [ "${{ runner.os }}" = "Windows" ] then cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64 else From ce07db36eaf67acb0b520e0beb2f680f54a78e7c Mon Sep 17 00:00:00 2001 From: Sam Barnes Date: Wed, 28 Dec 2022 09:04:44 -0800 Subject: [PATCH 53/53] ignore error if CMakeCache does not exist --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f64aea7..6792dfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: id: configure shell: bash run: | - rm ${{ env.build_dir }}/CMakeCache.txt + rm -f ${{ env.build_dir }}/CMakeCache.txt if [ "${{ runner.os }}" = "Windows" ] then cmake . -B "${{ env.build_dir }}" -G "${{ matrix.visual_studio }}" -A x64