Skip to content

Commit 82c3223

Browse files
Merge pull request #1213 from IntelPython/use-conda-forge-instead-of-main
Use conda-forge channel instead of main channel as source of deps…
2 parents a469906 + 39d6a97 commit 82c3223

File tree

5 files changed

+80
-14
lines changed

5 files changed

+80
-14
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2+
# file Copyright.txt or https://cmake.org/licensing for details.
3+
4+
5+
# This module is shared by multiple languages; use include blocker.
6+
if(__WINDOWS_INTEL_LLVM)
7+
return()
8+
endif()
9+
set(__WINDOWS_INTEL_LLVM 1)
10+
11+
# Platform/Windows-MSVC adds some linking options icx/ifx do not understand,
12+
# but that need to be passed to the linker. Wrap all the linking options from
13+
# Platform/Windows-MSVC so that the compiler will hand them off to the linker
14+
# without interpreting them.
15+
16+
# Save original CMAKE_${t}_LINKER_FLAGS_INIT
17+
foreach(t EXE SHARED MODULE STATIC)
18+
set(_saved_cmake_${t}_linker_flags_init ${CMAKE_${t}_LINKER_FLAGS_INIT})
19+
set(CMAKE_${t}_LINKER_FLAGS_INIT "")
20+
endforeach()
21+
include(Platform/Windows-MSVC)
22+
# Wrap linker flags from Windows-MSVC
23+
set(_IntelLLVM_LINKER_WRAPPER_FLAG "/Qoption,link,")
24+
set(_IntelLLVM_LINKER_WRAPPER_FLAG_SEP ",")
25+
foreach(t EXE SHARED MODULE STATIC)
26+
set(_wrapped_linker_flags "")
27+
foreach(flag ${CMAKE_${t}_LINKER_FLAGS_INIT})
28+
string(STRIP ${flag} flag)
29+
list(APPEND _wrapped_linker_flags "${_IntelLLVM_LINKER_WRAPPER_FLAG}${flag}")
30+
endforeach()
31+
set(CMAKE_${t}_LINKER_FLAGS_INIT "")
32+
list(APPEND CMAKE_${t}_LINKER_FLAGS_INIT
33+
${_saved_cmake_${t}_linker_flags_init} ${_wrapped_linker_flags})
34+
endforeach()
35+
36+
macro(__windows_compiler_intel lang)
37+
__windows_compiler_msvc(${lang})
38+
39+
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "${_IntelLLVM_LINKER_WRAPPER_FLAG}")
40+
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP "${_IntelLLVM_LINKER_WRAPPER_FLAG_SEP}")
41+
set(CMAKE_${lang}_CREATE_WIN32_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:windows")
42+
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:console")
43+
set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/DEF:")
44+
set(CMAKE_LIBRARY_PATH_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/LIBPATH:")
45+
46+
# Features for LINK_LIBRARY generator expression
47+
if(MSVC_VERSION GREATER "1900")
48+
## WHOLE_ARCHIVE: Force loading all members of an archive
49+
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:<LIBRARY>")
50+
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
51+
endif()
52+
53+
set(CMAKE_${lang}_LINK_EXECUTABLE
54+
"${_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}")
55+
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
56+
"${_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}")
57+
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
58+
if (NOT "${lang}" STREQUAL "Fortran" OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1)
59+
# The Fortran driver does not support -fuse-ld=llvm-lib before compiler version 2022.1
60+
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
61+
"<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}")
62+
endif()
63+
64+
set(CMAKE_DEPFILE_FLAGS_${lang} "-QMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
65+
set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
66+
endmacro()

.github/workflows/conda-package.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: conda install conda-build
4545
- name: Build conda package
4646
run: |
47-
CHANNELS="-c dppy/label/tools -c intel -c main --override-channels"
47+
CHANNELS="-c intel -c conda-forge --override-channels"
4848
VERSIONS="--python ${{ matrix.python }}"
4949
TEST="--no-test"
5050
conda build \
@@ -72,7 +72,6 @@ jobs:
7272
fetch-depth: 0
7373
- uses: conda-incubator/setup-miniconda@v2
7474
with:
75-
use-only-tar-bz2: true
7675
auto-activate-base: true
7776
conda-build-version: "*"
7877
activate-environment: true
@@ -90,7 +89,7 @@ jobs:
9089
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
9190
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
9291
- name: Build conda package
93-
run: conda build --no-test --python ${{ matrix.python }} -c intel -c main --override-channels conda-recipe
92+
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
9493
- name: Upload artifact
9594
uses: actions/upload-artifact@v3
9695
with:
@@ -108,7 +107,7 @@ jobs:
108107
runner: [ubuntu-20.04]
109108
continue-on-error: ${{ matrix.experimental }}
110109
env:
111-
CHANNELS: -c intel -c main --override-channels
110+
CHANNELS: -c intel -c conda-forge --override-channels
112111

113112
steps:
114113
- name: Download artifact
@@ -192,7 +191,7 @@ jobs:
192191
continue-on-error: ${{ matrix.experimental }}
193192
env:
194193
workdir: '${{ github.workspace }}'
195-
CHANNELS: -c intel -c main --override-channels
194+
CHANNELS: -c intel -c conda-forge --override-channels
196195

197196
steps:
198197
- name: Download artifact
@@ -201,7 +200,6 @@ jobs:
201200
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
202201
- uses: conda-incubator/setup-miniconda@v2
203202
with:
204-
use-only-tar-bz2: true
205203
auto-update-conda: true
206204
conda-build-version: '*'
207205
miniconda-version: 'latest'
@@ -355,7 +353,7 @@ jobs:
355353
runner: [ubuntu-20.04]
356354
continue-on-error: ${{ matrix.experimental }}
357355
env:
358-
CHANNELS: -c intel -c main --override-channels
356+
CHANNELS: -c intel -c conda-forge --override-channels
359357

360358
steps:
361359
- name: Install conda-build
@@ -408,12 +406,12 @@ jobs:
408406
conda install -n examples -y ninja $CHANNELS || exit 1
409407
conda install -n examples -y pybind11 cython scikit-build $CHANNELS || exit 1
410408
conda install -n examples -y mkl-dpcpp mkl-devel-dpcpp dpcpp_cpp_rt $CHANNELS || exit 1
411-
conda create -y -n build_env -c intel gcc_linux-64 gxx_linux-64 dpcpp_linux-64
409+
conda create -y -n build_env $CHANNELS gcc_linux-64 gxx_linux-64 dpcpp_linux-64 sysroot_linux-64">=2.28"
412410
- name: Install dpctl
413411
shell: bash -l {0}
414412
run: |
415413
source $CONDA/etc/profile.d/conda.sh
416-
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c main --override-channels"
414+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels"
417415
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
418416
conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
419417
- name: Build and run examples of pybind11 extensions
@@ -498,7 +496,7 @@ jobs:
498496
runner: [ubuntu-20.04]
499497
continue-on-error: ${{ matrix.experimental }}
500498
env:
501-
CHANNELS: -c intel -c main --override-channels
499+
CHANNELS: -c intel -c conda-forge --override-channels
502500
steps:
503501
- name: Cache array API tests
504502
id: cache-array-api-tests

conda-recipe/bld.bat

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
66
"%PYTHON%" setup.py clean --all
77
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
88

9-
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16) DO @(
9+
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
1010
REM set DIR_HINT if directory exists
1111
IF EXIST "%BUILD_PREFIX%\Library\lib\clang\%%V\" (
1212
SET "SYCL_INCLUDE_DIR_HINT=%BUILD_PREFIX%\Library\lib\clang\%%V"
1313
)
1414
)
1515

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

1920
rem Save the original file, and copy patched file to
@@ -22,7 +23,7 @@ if EXIST "%PLATFORM_DIR%" (
2223
dir "%PLATFORM_DIR%\%FN%"
2324
copy /Y "%PLATFORM_DIR%\%FN%" .
2425
if errorlevel 1 exit 1
25-
copy /Y .github\workflows\Windows-IntelLLVM.cmake "%PLATFORM_DIR%"
26+
copy /Y ".github\workflows\Windows-IntelLLVM_%PATCHED_CMAKE_VERSION%.cmake" "%PLATFORM_DIR%\%FN%"
2627
if errorlevel 1 exit 1
2728
)
2829

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

4142
if EXIST "%PLATFORM_DIR%" (
4243
rem copy back
43-
copy /Y "%FN%" "%PLATFORM_DIR%"
44+
copy /Y "%FN%" "%PLATFORM_DIR%\%FN%"
4445
if errorlevel 1 exit 1
4546
)

conda-recipe/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ requirements:
3030
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
3131
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }} # [py<=39]
3232
- dpcpp-cpp-rt >=2023.1 # [py>39]
33+
- level-zero # [linux]
3334

3435
test:
3536
requires:

0 commit comments

Comments
 (0)