diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index becc8af..3a1cbb8 100644 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -1,3 +1,13 @@ set MKLROOT=%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_fft*.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 d2a9c69..f55643d 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -2,4 +2,17 @@ export MKLROOT=$PREFIX export CFLAGS="-I$PREFIX/include $CFLAGS" -$PYTHON -m pip install --no-build-isolation --no-deps . +export LDFLAGS="-Wl,-rpath,\$ORIGIN/../.. -Wl,-rpath,\$ORIGIN/../../.. -L${PREFIX}/lib ${LDFLAGS}" + +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_fft*.whl + cp mkl_fft*.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..d6b54bb --- /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] + - vs2017 # [win] +c_compiler: # [win] + - vs2017 # [win] diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 05222b1..e73556e 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -10,19 +10,24 @@ source: build: number: {{ buildnumber }} + script_env: + - WHEELS_OUTPUT_FOLDER ignore_run_exports: - blas requirements: build: - {{ compiler('c') }} + - {{ stdlib('c') }} host: - python + - pip - setuptools >=77 - mkl-devel - mkl-devel 2024.2.* # [py==39] - cython - numpy-base + - wheel >=0.41.3 run: - python - mkl-service