diff --git a/.github/workflows/build_upload_test.yaml b/.github/workflows/build_upload_test.yaml index 1106551..c40783e 100644 --- a/.github/workflows/build_upload_test.yaml +++ b/.github/workflows/build_upload_test.yaml @@ -52,6 +52,12 @@ jobs: if: ${{ matrix.os_base == 'macos'}} run: sudo xcode-select --switch /Applications/Xcode_11.5.app/Contents/Developer + - name: Install CUDA (Windows) + if: ${{matrix.os_base == 'windows'}} + uses: Jimver/cuda-toolkit@v0.2.1 + with: + cuda: '11.2.2' + - name: Build SplinePSF (UNIX) if: ${{ matrix.os_base == 'ubuntu' || matrix.os_base == 'macos'}} run: | @@ -59,15 +65,31 @@ jobs: conda-build -c conda-forge spline conda-build -c conda-forge spline --output > $FILENAMES - + - name: Build SplinePSF (Windows) if: ${{ matrix.os_base == 'windows' }} run: | Set-Location -Path .\dist_tools\conda - + $env:VSCMD_DEBUG=3 conda-build -c conda-forge spline conda-build -c conda-forge spline --output > $Env:FILENAMES + - name: Upload CMake error log + uses: actions/upload-artifact@v2 + with: + name: CMakeError.log + path: | + C:/Miniconda/envs/test/conda-bld/*/work/python/build/temp.win-amd64-3.*/Release/CMakeFiles/CMakeError.log + C:/Miniconda/envs/test/conda-bld/*/work/python/build/temp.win-amd64-3.*/Release/CMakeFiles/CMakeOutput.log + + - name: Upload other CMake error log + uses: actions/upload-artifact@v2 + with: + name: Other_CmakeError.log + path: | + **/python/build/**/Release/CMakeFiles/CMakeError.log + **/python/build/**/Release/CMakeFiles/CMakeOutput.log + - name: Change anaconda label on release if: github.event.release run: | diff --git a/cpp_cuda_c/CMakeLists.txt b/cpp_cuda_c/CMakeLists.txt index 99a0358..84af0a0 100644 --- a/cpp_cuda_c/CMakeLists.txt +++ b/cpp_cuda_c/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15 FATAL_ERROR) +cmake_minimum_required(VERSION 3.17 FATAL_ERROR) #cmake_policy(SET CMP0094 NEW) project(SplinePSF LANGUAGES CXX C) @@ -8,9 +8,9 @@ check_language(CUDA) find_package(Python COMPONENTS Interpreter Development) find_package(pybind11 REQUIRED) -find_package(CUDA) +find_package(CUDAToolkit) -if(CMAKE_CUDA_COMPILER AND NOT CUDA_DISABLED) # the latter is a user definable variable +if(CUDAToolkit_FOUND AND NOT CUDA_DISABLED) # the latter is a user definable variable enable_language(CUDA) add_compile_definitions(CUDA_ENABLED) @@ -28,14 +28,14 @@ target_include_directories(spline_psf_cpu_impl PUBLIC include) target_compile_features(spline_psf_cpu_impl PUBLIC c_std_99) set_property(TARGET spline_psf_cpu_impl PROPERTY POSITION_INDEPENDENT_CODE ON) -if(CMAKE_CUDA_COMPILER AND NOT CUDA_DISABLED) +if(CUDAToolkit_FOUND AND NOT CUDA_DISABLED) add_library(spline_psf_cu_impl STATIC src/spline_psf_gpu.cu) target_include_directories(spline_psf_cu_impl PUBLIC include) target_compile_features(spline_psf_cu_impl PUBLIC cxx_std_11) set_target_properties(spline_psf_cu_impl PROPERTIES CUDA_SEPARABLE_COMPILATION ON POSITION_INDEPENDENT_CODE ON) - link_directories(/usr/local/cuda/lib64) - include_directories("${CUDA_INCLUDE_DIRS}") + # link_directories(/usr/local/cuda/lib64) + # include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}") pybind11_add_module(spline src/pybind_spline.cpp) target_link_libraries(spline PRIVATE spline_psf_cu_impl spline_psf_cpu_impl) diff --git a/cpp_cuda_c/src/spline_psf_gpu.cu b/cpp_cuda_c/src/spline_psf_gpu.cu index 0967837..b9d74cf 100644 --- a/cpp_cuda_c/src/spline_psf_gpu.cu +++ b/cpp_cuda_c/src/spline_psf_gpu.cu @@ -522,17 +522,17 @@ auto kernel_roi(spline *sp, float *rois, const int npx, const int npy, const flo float phot = phot_[r]; /* Compute delta. Will be the same for all following px */ - x0 = (int)floor(xc); + x0 = (int)floorf(xc); x_delta = xc - x0; - y0 = (int)floor(yc); + y0 = (int)floorf(yc); y_delta = yc - y0; - z0 = (int)floor(zc); + z0 = (int)floorf(zc); z_delta = zc - z0; int n_threads = min(1024, npx * npy); // max number of threads per block - int n_blocks = ceil(static_cast(npx * npy) / static_cast(n_threads)); + int n_blocks = ceilf(static_cast(npx * npy) / static_cast(n_threads)); fAt3Dj<<>>(sp, rois, r, npx, npy, x0, y0, z0, phot, x_delta, y_delta, z_delta); @@ -555,17 +555,17 @@ auto kernel_derivative_roi(spline *sp, float *rois, float *drv_rois, const int n float bg = bg_[r]; /* Compute delta. Will be the same for all following px */ - x0 = (int)floor(xc); + x0 = (int)floorf(xc); x_delta = xc - x0; - y0 = (int)floor(yc); + y0 = (int)floorf(yc); y_delta = yc - y0; - z0 = (int)floor(zc); + z0 = (int)floorf(zc); z_delta = zc - z0; int n_threads = min(1024, npx * npy); // max number of threads per block - int n_blocks = ceil(static_cast(npx * npy) / static_cast(n_threads)); + int n_blocks = ceilf(static_cast(npx * npy) / static_cast(n_threads)); kernel_derivative<<>>(sp, rois, drv_rois, r, npx, npy, x0, y0, z0, phot, bg, x_delta, y_delta, z_delta, add_bg); diff --git a/dist_tools/conda/conda_build_config.yaml b/dist_tools/conda/conda_build_config.yaml index 9120aac..b040bae 100644 --- a/dist_tools/conda/conda_build_config.yaml +++ b/dist_tools/conda/conda_build_config.yaml @@ -2,11 +2,11 @@ c_compiler: - clang # [osx] - gcc # [linux] - - vs2017 # [win] + - vs2019 # [win] cxx_compiler: - clangxx # [osx] - gxx # [linux] - - vs2017 # [win] + - vs2019 # [win] target_platform: - osx-64 # [osx] - linux-64 # [linux] diff --git a/dist_tools/conda/spline/meta.yaml b/dist_tools/conda/spline/meta.yaml index b274754..b56ba52 100644 --- a/dist_tools/conda/spline/meta.yaml +++ b/dist_tools/conda/spline/meta.yaml @@ -13,7 +13,7 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} - python - - cmake =3.15 + - cmake =3.17 - ninja - setuptools diff --git a/python/environment.yml b/python/environment.yml index bedaf3e..6f7f8c2 100755 --- a/python/environment.yml +++ b/python/environment.yml @@ -4,7 +4,7 @@ channels: dependencies: - bump2version - python=3.7 - - cmake=3.15 + - cmake=3.17 - ninja - setuptools - numpy