diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index 5d64fa2..29a732b 100644 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -1,5 +1,15 @@ @rem Remember to source the compiler set MKLROOT=%CONDA_PREFIX% -%PYTHON% -m pip install --no-build-isolation --no-deps . -if errorlevel 1 exit 1 + +rem Build wheel package +if NOT "%WHEELS_OUTPUT_FOLDER%"=="" ( + %PYTHON% -m pip wheel --no-build-isolation --no-deps . + if errorlevel 1 exit 1 + copy mkl_random*.whl %WHEELS_OUTPUT_FOLDER% + if errorlevel 1 exit 1 +) ELSE ( + rem Build conda package + %PYTHON% -m pip install --no-build-isolation --no-deps . + if errorlevel 1 exit 1 +) diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index 55964cb..0909e03 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -1,5 +1,18 @@ #!/bin/bash -x export CFLAGS="-I$PREFIX/include $CFLAGS" +export LDFLAGS="-Wl,-rpath,\$ORIGIN/../.. -Wl,-rpath,\$ORIGIN/../../.. -L${PREFIX}/lib ${LDFLAGS}" export MKLROOT=$CONDA_PREFIX -$PYTHON -m pip install --no-build-isolation --no-deps . + +read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \ + | tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')" + +# Build wheel package +if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then + $PYTHON -m pip wheel --no-build-isolation --no-deps . + ${PYTHON} -m wheel tags --remove --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" mkl_random*.whl + cp mkl_random*.whl ${WHEELS_OUTPUT_FOLDER} +else + # Build conda package + $PYTHON -m pip install --no-build-isolation --no-deps . +fi diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml new file mode 100644 index 0000000..822fd77 --- /dev/null +++ b/conda-recipe/conda_build_config.yaml @@ -0,0 +1,16 @@ +c_compiler: # [linux] + - gcc # [linux] +cxx_compiler: # [linux] + - gxx # [linux] +cxx_compiler_version: # [linux] + - '14' # [linux] +c_stdlib: # [linux] + - sysroot # [linux] +c_stdlib_version: # [linux] + - '2.28' # [linux] +c_stdlib: # [win] + - vs # [win] +cxx_compiler: # [win] + - vs2022 # [win] +c_compiler: # [win] + - vs2022 # [win] diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index ff04c92..daa682f 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -10,6 +10,8 @@ source: build: number: {{buildnumber}} + script_env: + - WHEELS_OUTPUT_FOLDER ignore_run_exports: - blas @@ -17,6 +19,7 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} + - {{ stdlib('c') }} host: - python - setuptools >=77 @@ -24,6 +27,7 @@ requirements: - cython - numpy-base - pip + - wheel >=0.41.3 run: - python - {{ pin_compatible('mkl', min_pin="x.x", max_pin="x") }} @@ -43,3 +47,12 @@ about: license: BSD-3-Clause license_file: LICENSE.txt summary: NumPy-based implementation of random number generation sampling using Intel (R) Math Kernel Library, mirroring numpy.random, but exposing all choices of sampling algorithms available in MKL. + description: | + LEGAL NOTICE: Use of this software package is subject to the + software license agreement (as set forth above, in the license section of + the installed Conda package and/or the README file) and all notices, + disclaimers or license terms for third party or open source software + included in or with the software. +

+ EULA: BSD-3-Clause +