diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index d609fcd..204327b 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -24,7 +24,7 @@ jobs: scriptSource: inline script: | import urllib.request - url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe' path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" urllib.request.urlretrieve(url, path) diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 15d2866..bfe3161 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,9 +1,9 @@ c_stdlib: - sysroot c_stdlib_version: -- '2.12' +- '2.17' cdt_name: -- cos6 +- cos7 channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 target_platform: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index 67a520f..619ccff 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 target_platform: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index ee3d1ab..0e7c317 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 target_platform: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index f0cea66..34c924e 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -11,9 +11,9 @@ channel_sources: channel_targets: - conda-forge main cxx_compiler: -- clangxx +- clang_bootstrap cxx_compiler_version: -- '16' +- '17' macos_machine: - x86_64-apple-darwin13.4.0 target_platform: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index cd017af..10181f5 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -13,7 +13,7 @@ channel_targets: cxx_compiler: - clang_bootstrap cxx_compiler_version: -- '16' +- '17' macos_machine: - arm64-apple-darwin20.0.0 target_platform: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 78caf41..3144b4b 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -10,3 +10,5 @@ target_platform: - win-64 zlib: - '1' +zstd: +- '1.5' diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index a5836e8..ba4b251 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -72,7 +72,6 @@ else --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( startgroup "Inspecting artifacts" ) 2> /dev/null # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index ba0c879..420f051 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -11,7 +11,7 @@ MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} ( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" -MINIFORGE_FILE="Mambaforge-MacOSX-$(uname -m).sh" +MINIFORGE_FILE="Miniforge3-MacOSX-$(uname -m).sh" curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" rm -rf ${MINIFORGE_HOME} bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} diff --git a/README.md b/README.md index b2f0947..b847e90 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-libmlir-green.svg)](https://anaconda.org/conda-forge/libmlir) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libmlir.svg)](https://anaconda.org/conda-forge/libmlir) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libmlir.svg)](https://anaconda.org/conda-forge/libmlir) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libmlir.svg)](https://anaconda.org/conda-forge/libmlir) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-libmlir18-green.svg)](https://anaconda.org/conda-forge/libmlir18) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libmlir18.svg)](https://anaconda.org/conda-forge/libmlir18) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libmlir18.svg)](https://anaconda.org/conda-forge/libmlir18) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libmlir18.svg)](https://anaconda.org/conda-forge/libmlir18) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libmlir19-green.svg)](https://anaconda.org/conda-forge/libmlir19) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libmlir19.svg)](https://anaconda.org/conda-forge/libmlir19) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libmlir19.svg)](https://anaconda.org/conda-forge/libmlir19) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libmlir19.svg)](https://anaconda.org/conda-forge/libmlir19) | | [![Conda Recipe](https://img.shields.io/badge/recipe-mlir-green.svg)](https://anaconda.org/conda-forge/mlir) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/mlir.svg)](https://anaconda.org/conda-forge/mlir) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/mlir.svg)](https://anaconda.org/conda-forge/mlir) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/mlir.svg)](https://anaconda.org/conda-forge/mlir) | Installing mlir @@ -95,16 +95,16 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `libmlir, libmlir18, mlir` can be installed with `conda`: +Once the `conda-forge` channel has been enabled, `libmlir, libmlir19, mlir` can be installed with `conda`: ``` -conda install libmlir libmlir18 mlir +conda install libmlir libmlir19 mlir ``` or with `mamba`: ``` -mamba install libmlir libmlir18 mlir +mamba install libmlir libmlir19 mlir ``` It is possible to list all of the versions of `libmlir` available on your platform with `conda`: diff --git a/build-locally.py b/build-locally.py index e0d408d..8ac9b84 100755 --- a/build-locally.py +++ b/build-locally.py @@ -1,13 +1,16 @@ -#!/usr/bin/env python3 +#!/bin/sh +"""exec' "python3" "$0" "$@" #""" # fmt: off # fmt: on # # This file has been generated by conda-smithy in order to build the recipe # locally. # -import os +# The line above this comment is a bash / sh / zsh guard +# to stop people from running it with the wrong interpreter import glob +import os +import platform import subprocess from argparse import ArgumentParser -import platform def setup_environment(ns): diff --git a/conda-forge.yml b/conda-forge.yml index a40f3fa..4a6ba4a 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,8 +1,11 @@ -build_platform: {osx_arm64: osx_64, linux_ppc64le: linux_64, linux_aarch64: linux_64} +build_platform: + linux_aarch64: linux_64 + linux_ppc64le: linux_64 + osx_arm64: osx_64 +conda_build: + pkg_format: '2' conda_forge_output_validation: true github: branch_name: main tooling_branch_name: main -conda_build: - pkg_format: '2' test: native_and_emulated diff --git a/recipe/build.sh b/recipe/build.sh index 612dc9c..61207e5 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,17 +1,25 @@ #!/bin/bash - set -euxo pipefail +PARALLEL="" if [[ "${target_platform}" == "linux-ppc64le" ]]; then export CFLAGS="${CFLAGS//-fno-plt/}" export CXXFLAGS="${CXXFLAGS//-fno-plt/}" +elif [[ "${target_platform}" == "linux-aarch64" ]]; then + # reduce parallelism on aarch to avoid OOM + PARALLEL="-j2" elif [[ "${target_platform}" == osx-* ]]; then - CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_LIBCXX=ON" + CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_LIBCXX=ON" fi if [[ "${CONDA_BUILD_CROSS_COMPILATION:-0}" == "1" ]]; then CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_TABLEGEN_EXE=$BUILD_PREFIX/bin/llvm-tblgen -DNATIVE_LLVM_DIR=$BUILD_PREFIX/lib/cmake/llvm" - CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD;-DCMAKE_C_FLAGS=-O2;-DCMAKE_CXX_FLAGS=-O2;-DCMAKE_EXE_LINKER_FLAGS=\"-L$BUILD_PREFIX/lib\";-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=;-DCMAKE_STATIC_LINKER_FLAGS=;-DCMAKE_AR=$(which ${AR});-DCMAKE_RANLIB=$(which ${RANLIB});-DCMAKE_PREFIX_PATH=${BUILD_PREFIX}" + NATIVE_FLAGS="-DCMAKE_C_COMPILER=$CC_FOR_BUILD;-DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD" + NATIVE_FLAGS="${NATIVE_FLAGS};-DCMAKE_C_FLAGS=-O2;-DCMAKE_CXX_FLAGS=-O2" + NATIVE_FLAGS="${NATIVE_FLAGS};-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${BUILD_PREFIX}/lib" + NATIVE_FLAGS="${NATIVE_FLAGS};-DCMAKE_MODULE_LINKER_FLAGS=;-DCMAKE_SHARED_LINKER_FLAGS=" + NATIVE_FLAGS="${NATIVE_FLAGS};-DCMAKE_STATIC_LINKER_FLAGS=;-DCMAKE_PREFIX_PATH=${BUILD_PREFIX}" + CMAKE_ARGS="${CMAKE_ARGS} -DCROSS_TOOLCHAIN_FLAGS_NATIVE=${NATIVE_FLAGS}" else rm -rf $BUILD_PREFIX/bin/llvm-tblgen fi @@ -29,4 +37,4 @@ cmake ${CMAKE_ARGS} \ -GNinja \ ../mlir -ninja +ninja ${PARALLEL} diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 27fcede..9de62ab 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,4 +1,4 @@ -c_compiler: # [osx and arm64] - - clang_bootstrap # [osx and arm64] -cxx_compiler: # [osx and arm64] - - clang_bootstrap # [osx and arm64] +c_compiler: # [osx] + - clang_bootstrap # [osx] +cxx_compiler: # [osx] + - clang_bootstrap # [osx] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bf3c3a8..512bb34 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,9 +1,9 @@ -{% set version = "18.1.8" %} +{% set version = "19.1.0" %} {% set major_version = version.split(".")[0] %} {% set maj_min = major_version ~ "." ~ version.split(".")[1] %} -# as of LLVM 17, we expect an "rc" suffix for the release candidates -{% set extra = "rc" if version.split(".")[-1] not in "0123456789" else "" %} +# as of LLVM 19, we expect an "-rcX" suffix for the release candidates +{% set extra = "-" ~ version.split(".")[-1] if version.split(".")[-1] not in "0123456789" else "" %} {% set extra = "git" if version.split(".")[-1] == "dev0" else extra %} package: @@ -12,7 +12,7 @@ package: source: - url: https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-{{ version.replace(".rc", "-rc") }}.tar.gz - sha256: 09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856 + sha256: 0a08341036ca99a106786f50f9c5cb3fbe458b3b74cab6089fd368d0edb2edfe patches: # https://reviews.llvm.org/D99470 - patches/0001-Support-cross-compiling-standalone-MLIR.patch @@ -37,6 +37,10 @@ outputs: - name: mlir script: install_mlir.sh # [unix] script: install_mlir.bat # [win] + build: + ignore_run_exports_from: + # the build fails if it doesn't find zlib, but it's not used + - zlib # [unix] requirements: build: - {{ stdlib('c') }} @@ -49,9 +53,12 @@ outputs: - llvmdev {{ version }} - llvm {{ version }} - zlib + - zstd # [win] run: - - {{ pin_subpackage("libmlir", exact=True) }} - llvmdev {{ version }} + - {{ pin_subpackage("libmlir" ~ major_version, exact=True) }} # [unix] + # we need to do this manually because clang_bootstrap has no run-export + - libcxx >={{ cxx_compiler_version }} # [osx] test: commands: # static library @@ -84,7 +91,9 @@ outputs: host: - llvmdev {{ version }} - llvm {{ version }} - - zlib + run: + # we need to do this manually because clang_bootstrap has no run-export + - libcxx >={{ cxx_compiler_version }} # [osx] test: commands: # presence of versioned libraries @@ -118,14 +127,16 @@ outputs: host: - llvmdev {{ version }} - llvm {{ version }} - - zlib - {{ pin_subpackage("libmlir" ~ major_version, exact=True) }} # [unix] run: - {{ pin_subpackage("libmlir" ~ major_version, exact=True) }} # [unix] + # we need to do this manually because clang_bootstrap has no run-export + - libcxx >={{ cxx_compiler_version }} # [osx] test: commands: # presence of unversioned libraries - test -f $PREFIX/lib/libMLIR${SHLIB_EXT} # [unix] + # nothing on windows (package currently empty) - if exist %LIBRARY_BIN%\libmlir.dll exit 1 # [win] about: