Skip to content

Use conda-forge channel instead of main channel as source of deps… #1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
66 changes: 66 additions & 0 deletions .github/workflows/Windows-IntelLLVM_3.26.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.


# This module is shared by multiple languages; use include blocker.
if(__WINDOWS_INTEL_LLVM)
return()
endif()
set(__WINDOWS_INTEL_LLVM 1)

# Platform/Windows-MSVC adds some linking options icx/ifx do not understand,
# but that need to be passed to the linker. Wrap all the linking options from
# Platform/Windows-MSVC so that the compiler will hand them off to the linker
# without interpreting them.

# Save original CMAKE_${t}_LINKER_FLAGS_INIT
foreach(t EXE SHARED MODULE STATIC)
set(_saved_cmake_${t}_linker_flags_init ${CMAKE_${t}_LINKER_FLAGS_INIT})
set(CMAKE_${t}_LINKER_FLAGS_INIT "")
endforeach()
include(Platform/Windows-MSVC)
# Wrap linker flags from Windows-MSVC
set(_IntelLLVM_LINKER_WRAPPER_FLAG "/Qoption,link,")
set(_IntelLLVM_LINKER_WRAPPER_FLAG_SEP ",")
foreach(t EXE SHARED MODULE STATIC)
set(_wrapped_linker_flags "")
foreach(flag ${CMAKE_${t}_LINKER_FLAGS_INIT})
string(STRIP ${flag} flag)
list(APPEND _wrapped_linker_flags "${_IntelLLVM_LINKER_WRAPPER_FLAG}${flag}")
endforeach()
set(CMAKE_${t}_LINKER_FLAGS_INIT "")
list(APPEND CMAKE_${t}_LINKER_FLAGS_INIT
${_saved_cmake_${t}_linker_flags_init} ${_wrapped_linker_flags})
endforeach()

macro(__windows_compiler_intel lang)
__windows_compiler_msvc(${lang})

set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "${_IntelLLVM_LINKER_WRAPPER_FLAG}")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP "${_IntelLLVM_LINKER_WRAPPER_FLAG_SEP}")
set(CMAKE_${lang}_CREATE_WIN32_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:windows")
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:console")
set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/DEF:")
set(CMAKE_LIBRARY_PATH_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/LIBPATH:")

# Features for LINK_LIBRARY generator expression
if(MSVC_VERSION GREATER "1900")
## WHOLE_ARCHIVE: Force loading all members of an archive
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:<LIBRARY>")
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
endif()

set(CMAKE_${lang}_LINK_EXECUTABLE
"${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} <LINK_FLAGS> <LINK_LIBRARIES> /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"${_CMAKE_VS_LINK_DLL}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD <LINK_FLAGS> <LINK_LIBRARIES> -link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
if (NOT "${lang}" STREQUAL "Fortran" OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1)
# The Fortran driver does not support -fuse-ld=llvm-lib before compiler version 2022.1
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
"<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o <TARGET> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
endif()

set(CMAKE_DEPFILE_FLAGS_${lang} "-QMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
endmacro()
18 changes: 8 additions & 10 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: conda install conda-build
- name: Build conda package
run: |
CHANNELS="-c dppy/label/tools -c intel -c main --override-channels"
CHANNELS="-c intel -c conda-forge --override-channels"
VERSIONS="--python ${{ matrix.python }}"
TEST="--no-test"
conda build \
Expand Down Expand Up @@ -72,7 +72,6 @@ jobs:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
with:
use-only-tar-bz2: true
auto-activate-base: true
conda-build-version: "*"
activate-environment: true
Expand All @@ -90,7 +89,7 @@ jobs:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
- name: Build conda package
run: conda build --no-test --python ${{ matrix.python }} -c intel -c main --override-channels conda-recipe
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -108,7 +107,7 @@ jobs:
runner: [ubuntu-20.04]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c main --override-channels
CHANNELS: -c intel -c conda-forge --override-channels

steps:
- name: Download artifact
Expand Down Expand Up @@ -192,7 +191,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
env:
workdir: '${{ github.workspace }}'
CHANNELS: -c intel -c main --override-channels
CHANNELS: -c intel -c conda-forge --override-channels

steps:
- name: Download artifact
Expand All @@ -201,7 +200,6 @@ jobs:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
- uses: conda-incubator/setup-miniconda@v2
with:
use-only-tar-bz2: true
auto-update-conda: true
conda-build-version: '*'
miniconda-version: 'latest'
Expand Down Expand Up @@ -355,7 +353,7 @@ jobs:
runner: [ubuntu-20.04]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c main --override-channels
CHANNELS: -c intel -c conda-forge --override-channels

steps:
- name: Install conda-build
Expand Down Expand Up @@ -408,12 +406,12 @@ jobs:
conda install -n examples -y ninja $CHANNELS || exit 1
conda install -n examples -y pybind11 cython scikit-build $CHANNELS || exit 1
conda install -n examples -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
conda create -y -n build_env -c intel gcc_linux-64 gxx_linux-64 dpcpp_linux-64
conda create -y -n build_env $CHANNELS gcc_linux-64 gxx_linux-64 dpcpp_linux-64 sysroot_linux-64">=2.28"
- name: Install dpctl
shell: bash -l {0}
run: |
source $CONDA/etc/profile.d/conda.sh
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c main --override-channels"
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
- name: Build and run examples of pybind11 extensions
Expand Down Expand Up @@ -498,7 +496,7 @@ jobs:
runner: [ubuntu-20.04]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c intel -c main --override-channels
CHANNELS: -c intel -c conda-forge --override-channels
steps:
- name: Cache array API tests
id: cache-array-api-tests
Expand Down
9 changes: 5 additions & 4 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
"%PYTHON%" setup.py clean --all
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"

FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16) DO @(
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
REM set DIR_HINT if directory exists
IF EXIST "%BUILD_PREFIX%\Library\lib\clang\%%V\" (
SET "SYCL_INCLUDE_DIR_HINT=%BUILD_PREFIX%\Library\lib\clang\%%V"
)
)

set "PLATFORM_DIR=%PREFIX%\Library\share\cmake-3.22\Modules\Platform"
set "PATCHED_CMAKE_VERSION=3.26"
set "PLATFORM_DIR=%PREFIX%\Library\share\cmake-%PATCHED_CMAKE_VERSION%\Modules\Platform"
set "FN=Windows-IntelLLVM.cmake"

rem Save the original file, and copy patched file to
Expand All @@ -22,7 +23,7 @@ if EXIST "%PLATFORM_DIR%" (
dir "%PLATFORM_DIR%\%FN%"
copy /Y "%PLATFORM_DIR%\%FN%" .
if errorlevel 1 exit 1
copy /Y .github\workflows\Windows-IntelLLVM.cmake "%PLATFORM_DIR%"
copy /Y ".github\workflows\Windows-IntelLLVM_%PATCHED_CMAKE_VERSION%.cmake" "%PLATFORM_DIR%\%FN%"
if errorlevel 1 exit 1
)

Expand All @@ -40,6 +41,6 @@ if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (

if EXIST "%PLATFORM_DIR%" (
rem copy back
copy /Y "%FN%" "%PLATFORM_DIR%"
copy /Y "%FN%" "%PLATFORM_DIR%\%FN%"
if errorlevel 1 exit 1
)
1 change: 1 addition & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ requirements:
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }} # [py<=39]
- dpcpp-cpp-rt >=2023.1 # [py>39]
- level-zero # [linux]

test:
requires:
Expand Down