简体   繁体   中英

Using conda build to build win32 and win64 packages in 1 go

My pure python scripts are 32 bits or 64 bits agnostic but my dependencies are not. I want to use cython to speed up some functions making the package not pure python. And I want to use them on windows with python 32 bits or 64 bits.

Is there a way to build with 1 conda recipe a conda python package for win32 and win64 platforms?

One would assume that runtime dependencies (eg Numpy, etc.) are available for both platforms. Setup could either start from a miniconda 32 or 64 bits installation.

I have read the documentation differentiating the build , host requirements in meta.yaml, the conda build variants, and the architecture virtual packages but I am struggling to see if a clever combination of these functionalities would allow me to build both packages in one go.

Thanks!

Edit: This doesn't work


Is there a way to build with 1 conda recipe a conda python package for win32 and win64 platforms?

conda convert --platform all for the lazy execution, or build it on 64-bit and conda convert --platform win-32 to get just the two builds you ask for.

https://docs.conda.io/projects/conda-build/en/latest/resources/commands/conda-convert.html

This is technically two steps (build and convert) but it could be wrapped into another script to do in one go.

After a few experimentations, I found the solution to my question. If you put the following in conda_build_config.yaml :

target_platform:
  - win-32
  - win-64

And make sure you're using the Jinja compiler functions in the requirements/build: section of the recipe meta.yaml :

build:
  - {{ compiler('c')  }}
  - {{ compiler('cxx')  }}

then conda build will build both win-32 and win-64 packages in one go. (I used conda-build 64 bits but i do not think it matters).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM