0

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 (e.g. 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!

dj K
  • 180
  • 2
  • 11

2 Answers2

0

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.

Matt Thompson
  • 641
  • 3
  • 14
0

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).

dj K
  • 180
  • 2
  • 11