Skip to content

Commit

Permalink
Switch to Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
junrushao committed Aug 4, 2023
1 parent 8ee979d commit d8efe81
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
environment-file: conda/build-environment.yaml
auto-activate-base: false
use-only-tar-bz2: true
python-version: 3.7
python-version: 3.11
condarc-file: conda/condarc
- uses: conda-incubator/setup-miniconda@v2
if: steps.conda1.outcome == 'failure'
Expand All @@ -26,7 +26,7 @@ runs:
environment-file: conda/build-environment.yaml
auto-activate-base: false
use-only-tar-bz2: true
python-version: 3.7
python-version: 3.11
condarc-file: conda/condarc
- name: Conda info
shell: pwsh
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ include(cmake/modules/OpenMP.cmake)
include(cmake/modules/Vulkan.cmake)
include(cmake/modules/Metal.cmake)
include(cmake/modules/ROCM.cmake)
include(cmake/modules/Findzstd.cmake)
include(cmake/modules/LLVM.cmake)
include(cmake/modules/Micro.cmake)
include(cmake/modules/contrib/EthosN.cmake)
Expand Down
47 changes: 47 additions & 0 deletions cmake/modules/Findzstd.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Try to find the zstd library
#
# If successful, the following variables will be defined:
# zstd_INCLUDE_DIR
# zstd_LIBRARY
# zstd_STATIC_LIBRARY
# zstd_FOUND
#
# Additionally, one of the following import targets will be defined:
# zstd::libzstd_static
if(MSVC)
set(zstd_STATIC_LIBRARY_SUFFIX "_static\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
else()
set(zstd_STATIC_LIBRARY_SUFFIX "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
endif()

find_path(zstd_INCLUDE_DIR NAMES zstd.h)
find_library(zstd_LIBRARY NAMES zstd zstd_static)
find_library(zstd_STATIC_LIBRARY NAMES zstd_static
"${CMAKE_STATIC_LIBRARY_PREFIX}zstd${CMAKE_STATIC_LIBRARY_SUFFIX}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
zstd DEFAULT_MSG
zstd_LIBRARY zstd_INCLUDE_DIR
)

if(zstd_FOUND)
message(STATUS "Found zstd_LIBRARY: ${zstd_LIBRARY}")
message(STATUS "Found zstd_STATIC_LIBRARY: ${zstd_STATIC_LIBRARY}")
message(STATUS "Found zstd_INCLUDE_DIR: ${zstd_INCLUDE_DIR}")
if(zstd_STATIC_LIBRARY MATCHES "${zstd_STATIC_LIBRARY_SUFFIX}$" AND
NOT TARGET zstd::libzstd_static)
message(STATUS "-- zstd_LIBRARY: ${zstd_LIBRARY}")
message(STATUS "-- zstd_STATIC_LIBRARY: ${zstd_STATIC_LIBRARY}")
message(STATUS "-- zstd_INCLUDE_DIR: ${zstd_INCLUDE_DIR}")
add_library(zstd::libzstd_static STATIC IMPORTED)
set_target_properties(zstd::libzstd_static PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}"
IMPORTED_LOCATION "${zstd_STATIC_LIBRARY}")
add_library(zstd::libzstd_shared SHARED IMPORTED)
endif()
endif()

unset(zstd_STATIC_LIBRARY_SUFFIX)

mark_as_advanced(zstd_INCLUDE_DIR zstd_LIBRARY zstd_STATIC_LIBRARY)
8 changes: 1 addition & 7 deletions cmake/utils/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@ macro(find_llvm use_llvm)
list(APPEND LLVM_LIBS "ZLIB::ZLIB")
elseif("${__flag}" STREQUAL "-lzstd" OR ("${__flag}" STREQUAL "zstd.dll.lib"))
find_package(zstd REQUIRED)
if (TARGET "zstd::libzstd_static")
message(STATUS "LLVM links against static zstd")
list(APPEND LLVM_LIBS "zstd::libzstd_static")
else()
message(STATUS "LLVM links against shared zstd")
list(APPEND LLVM_LIBS "zstd::libzstd_shared")
endif()
list(APPEND LLVM_LIBS "zstd::libzstd_static")
elseif("${__flag}" STREQUAL "-lxml2")
message(STATUS "LLVM links against xml2")
list(APPEND LLVM_LIBS "-lxml2")
Expand Down
18 changes: 10 additions & 8 deletions conda/build-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ name: tvm-build

# The conda channels to lookup the dependencies
channels:
- anaconda
- conda-forge
- anaconda

# The packages to install to the environment
dependencies:
- python=3.7 # or 3.8. See https://github.com/apache/tvm/issues/8577 for more details on >= 3.9
- conda-build
- python=3.11
- llvmdev>=15
- cmake>=3.24
- zlib
- zstd
- git
- llvmdev >=11
- conda-build
- anaconda-client
- numpy
- pytest
- cython
- cmake
- bzip2
- make
- scipy
- pillow
- pip
- cython
4 changes: 1 addition & 3 deletions conda/recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
# under the License.

python:
- 3.6
- 3.7
- 3.8
- 3.11

cuda:
- False

0 comments on commit d8efe81

Please sign in to comment.