Skip to content
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

Switch to new files: include/exclude capability #283

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
16 changes: 15 additions & 1 deletion recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,19 @@ if %ERRORLEVEL% neq 0 exit 1
REM bin\opt -S -vector-library=SVML -mcpu=haswell -O3 %RECIPE_DIR%\numba-3016.ll | bin\FileCheck %RECIPE_DIR%\numba-3016.ll
REM if %ERRORLEVEL% neq 0 exit 1

cd ..\llvm\test
pushd ..\llvm\test
python ..\..\build\bin\llvm-lit.py -vv Transforms ExecutionEngine Analysis CodeGen/X86
popd

:: install everything (will be sliced & diced in meta.yaml)
cmake --install . --prefix=%LIBRARY_PREFIX%
if %ERRORLEVEL% neq 0 exit 1

:: upstream picks up diaguids.lib from the windows image, see
:: https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/lib/DebugInfo/PDB/CMakeLists.txt#L17
:: which ultimately derives from VSINSTALLDIR, see
:: https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/cmake/config-ix.cmake#L516
:: and gets hardcoded by CMake to point to the path in our windows image.
:: This makes it non-portable between image versions (e.g. 2019 vs 2022), so replace
:: the hardcoded path with a variable again
sed -i "s,C:/Program Files/Microsoft Visual Studio/2022/Enterprise,$ENV{VSINSTALLDIR},g" %LIBRARY_LIB%\cmake\llvm\LLVMExports.cmake
20 changes: 20 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,23 @@ if [[ "$target_platform" == "linux-64" ]]; then
cd ../llvm/test
python ../../build/bin/llvm-lit -vv Transforms ExecutionEngine Analysis CodeGen/X86
fi

# install everything (will be sliced & diced in meta.yaml)
cmake --install . --prefix=$PREFIX

# install again in separate folder so we can handle llvm binaries
# separately from whatever else is already in $PREFIX/bin
mkdir temp_prefix
cmake --install . --prefix=./temp_prefix

IFS='.' read -ra VER_ARR <<< "$PKG_VERSION"

cd ./temp_prefix
for f in bin/*; do
# remove already installed binary
rm $PREFIX/bin/$(basename $f)
# version the binary
mv $f $PREFIX/bin/$(basename $f)-${VER_ARR[0]}
# create symlink from unversioned to versioned
ln -sf $PREFIX/bin/$(basename $f)-${VER_ARR[0]} $PREFIX/bin/$(basename $f)
done
36 changes: 0 additions & 36 deletions recipe/install_llvm.bat

This file was deleted.

59 changes: 0 additions & 59 deletions recipe/install_llvm.sh

This file was deleted.

122 changes: 54 additions & 68 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ requirements:
- cmake
- ninja
- python >=3
- m2-sed # [win]
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
Expand All @@ -44,31 +45,23 @@ requirements:
outputs:
# Contains everything
- name: llvmdev
script: install_llvm.sh # [unix]
script: install_llvm.bat # [win]
build:
activate_in_script: true
files:
include:
# everything not already in other outputs
- "*"
requirements:
build:
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
- python >=3
- m2-sed # [win]
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }}
- {{ pin_subpackage("libllvm-c" + major_ver, exact=True) }} # [win]
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }}
- {{ pin_subpackage("libllvm-c" ~ major_ver, exact=True) }} # [win]
- {{ pin_subpackage("llvm-tools-" ~ major_ver, exact=True) }} # [unix]
- {{ pin_subpackage("llvm-tools", exact=True) }}
- libxml2
- zlib
- zstd
run:
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }}
- {{ pin_subpackage("libllvm-c" + major_ver, exact=True) }} # [win]
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }}
- {{ pin_subpackage("libllvm-c" ~ major_ver, exact=True) }} # [win]
- {{ pin_subpackage("llvm-tools", exact=True) }}
# we need to do this manually because clang_bootstrap has no run-export
- libcxx >={{ cxx_compiler_version }} # [osx]
run_constrained:
- llvm {{ version }}
Expand Down Expand Up @@ -96,25 +89,27 @@ outputs:
# Contains the shared libraries. To make different LLVM libraries co-installable
# soversion is appended to the package name.
- name: libllvm{{ major_ver }}
script: install_llvm.sh # [not win]
build:
activate_in_script: true
run_exports: # [not win]
- {{ pin_subpackage("libllvm" + major_ver, max_pin="x.x") }} # [not win]
- {{ pin_subpackage("libllvm" ~ major_ver, max_pin="x.x") }} # [not win]
files:
include:
- lib/lib* # [unix]
exclude:
# separate output, see below
- lib/libLLVM-C.* # [unix]
- Library/**/libLLVM-C.* # [win]
requirements:
build:
# for run-exports
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- ninja # [not win]
- cmake # [not win]
- python >=3 # [not win]
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
- libxml2
- libxml2 # [unix]
- zlib
- zstd
run:
# we need to do this manually because clang_bootstrap has no run-export
- libcxx >={{ cxx_compiler_version }} # [osx]
test:
commands:
Expand All @@ -130,16 +125,16 @@ outputs:
- name: llvm
build:
run_exports: # [not win]
- {{ pin_subpackage("libllvm" + major_ver, max_pin="x.x") }} # [not win]
- {{ pin_subpackage("libllvm" ~ major_ver, max_pin="x.x") }} # [not win]
requirements:
build:
host:
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }} # [not win]
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }} # [not win]
- libxml2
- zlib
- zstd
run: # [not win]
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }} # [not win]
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }} # [not win]
run_constrained:
- llvmdev {{ version }}
- llvm-tools {{ version }}
Expand All @@ -151,29 +146,30 @@ outputs:

# Contains LLVM tools with a version suffix
- name: llvm-tools-{{ major_ver }}
script: install_llvm.sh # [unix]
script: install_llvm.bat # [win]
build:
activate_in_script: true
# On Windows there are no symlinks and copying will create a new package
# that is 300MB+
skip: true # [win]
files:
include:
- bin/*-{{ major_ver }} # [unix]
exclude:
# belongs into llvmdev
- bin/llvm-config* # [unix]
requirements:
build:
# for run-exports
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
- python >=3
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }}
- libxml2
- zlib
- zstd
run:
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }}
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }}
# we need to do this manually because clang_bootstrap has no run-export
- libcxx >={{ cxx_compiler_version }} # [osx]
test:
commands:
- $PREFIX/bin/llc-{{ major_ver }} -version # [not win]
Expand All @@ -186,27 +182,26 @@ outputs:

# Contains LLVM tools
- name: llvm-tools
script: install_llvm.sh # [unix]
script: install_llvm.bat # [win]
build:
activate_in_script: true
files:
include:
# opt-viewer tool is in share
- bin/* # [unix]
- share/* # [unix]
- Library/bin/*.exe # [win]
- Library/share/* # [win]
exclude:
# belongs into llvmdev
- bin/llvm-config* # [unix]
- Library/bin/llvm-config* # [win]
requirements:
build:
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
- python >=3
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }}
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }}
- {{ pin_subpackage("llvm-tools-" ~ major_ver, exact=True) }} # [not win]
- libxml2
- libxml2 # [win]
- zlib
- zstd
run:
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }}
- {{ pin_subpackage("libllvm" ~ major_ver, exact=True) }}
- {{ pin_subpackage("llvm-tools-" ~ major_ver, exact=True) }} # [not win]
run_constrained:
- llvm {{ version }}
Expand All @@ -225,34 +220,25 @@ outputs:

# Contains LLVM-C shared library
- name: libllvm-c{{ major_ver }}
script: install_llvm.sh # [unix]
script: install_llvm.bat # [win]
build:
run_exports:
- {{ pin_subpackage("libllvm-c" + major_ver, max_pin="x.x") }}
activate_in_script: true
- {{ pin_subpackage("libllvm-c" ~ major_ver, max_pin="x.x") }}
# not supported on linux, see
# https://github.com/llvm/llvm-project/blob/llvmorg-16.0.6/llvm/tools/llvm-shlib/CMakeLists.txt#L82-L85
# osx currently fails as well, see https://github.com/llvm/llvm-project/issues/64657
skip: true # [not win]
files:
include:
- Library/bin/libLLVM-C.dll # [win]
- Library/lib/libLLVM-C.lib # [win]
requirements:
build:
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- cmake
- ninja
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
- {{ pin_subpackage("libllvm" + major_ver, exact=True) }}
- libxml2
- zlib
- zstd
run_constrained:
- llvmdev {{ version }}
test:
commands:
- test -f $PREFIX/lib/libLLVM-C.{{ major_ver }}.dylib # [osx]
- if not exist %LIBRARY_BIN%\LLVM-C.dll exit 1 # [win]
- if not exist %LIBRARY_LIB%\LLVM-C.lib exit 1 # [win]

Expand Down
Loading