qir-alliance / pyqir

PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).
https://qir-alliance.github.io/pyqir
MIT License
54 stars 24 forks source link

Problem and Solution for Consolidating Build Setup - Suggested contribution #228

Open owen-oqc opened 1 year ago

owen-oqc commented 1 year ago

Is your feature request related to a problem? Please describe.

The build instructions differ significantly from OS to OS and require a number of automated installation steps.

Describe the solution you had in mind

I have worked through your build instructions and generated a conda env that pulls all the requirements together. That would make the setup steps looks like.

conda env create -f pyqir.yaml && conda activate pyqir

Which can bring in cmake, rust, python 3.9, ....

This works well on my OSX M1 env

Additional context

As I have done this i'd gladly make the contribution directly if you wanted it.

idavis commented 1 year ago

Hi @owen-oqc, I'd be happy to look a potential setup with conda. If you would like to submit a PR or post your environment file here, we can take a look and discuss.

ausbin commented 3 months ago

If anyone else is not interested in installing PowerShell, it seems you can build and test the Python extension as follows (assuming llvm-config for your LLVM build is in your $PATH):

$ python3 -m venv venv
$ . venv/bin/activate
$ cd pyqir
$ pip install -v --config-settings=build-args='-F qirlib/llvm14-0 -F pyqir/llvm14-0' .[test]
$ pytest

Works for me on Debian bookworm