Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raising build errors if cargo is required and not found #393

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Dec 6, 2023

The runtime requires an installation of cargo to build qir-stdlib from source (on macOS or by developer requires via the BUILD_QIR_STDLIB_FROM_SRC=ON CMake flag). Currently, if the developer forget to install cargo or the llvm rustup component, the build will be failed with the following error message:

catalyst/runtime/include/RuntimeCAPI.h:21:10: fatal error: 'qir_stdlib.h' file not found
#include "qir_stdlib.h"

This PR updates the build system of the runtime to throw errors at the proper build step with a clear message:

-- Building qir-stdlib from source.
CMake Error at CMakeLists.txt:74 (message):
  Missing cargo installation

  Please install "Rust" and the "llvm-tools-preview" rustup component for
  building qir-stdlib from source.  See the installation guideline for
  details:
  https://docs.pennylane.ai/projects/catalyst/en/stable/dev/installation.html

@maliasadi maliasadi added the runtime Pull requests that update the runtime label Dec 6, 2023
@maliasadi maliasadi requested a review from dime10 December 6, 2023 19:14
Copy link
Contributor

github-actions bot commented Dec 6, 2023

Hello. You may have forgotten to update the changelog!
Please edit doc/changelog.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

runtime/CMakeLists.txt Outdated Show resolved Hide resolved
runtime/CMakeLists.txt Outdated Show resolved Hide resolved
@maliasadi maliasadi requested a review from dime10 December 6, 2023 21:12
Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@maliasadi maliasadi merged commit de8a59f into main Dec 6, 2023
24 checks passed
@maliasadi maliasadi deleted the maa/notfound-cargo branch December 6, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime Pull requests that update the runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants