Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

The examples/QIR/Development is not updated for Rust Q#RT. #1568

Closed
kuzminrobin opened this issue Oct 26, 2022 · 0 comments · Fixed by #1578
Closed

The examples/QIR/Development is not updated for Rust Q#RT. #1568

kuzminrobin opened this issue Oct 26, 2022 · 0 comments · Fixed by #1578
Labels
enhancement New request or suggestion for an improvement needs triage An initial review by a maintainer is needed

Comments

@kuzminrobin
Copy link
Contributor

kuzminrobin commented Oct 26, 2022

The dir examples/QIR/Development build fails like this:

       BuildExecutable:
         Copying file from "/home/vsts/.nuget/packages/microsoft.quantum.simulators/0.27.236950/runtimes/linux-x64/native/libMicrosoft.Quantum.Simulator.Runtime.so" to "/home/vsts/work/1/s/examples/QIR/Development/build/libMicrosoft.Quantum.Simulator.Runtime.so".
         clang --version
         Ubuntu clang version 11.0.0-2~ubuntu20.04.1
         Target: x86_64-pc-linux-gnu
         Thread model: posix
         InstalledDir: /usr/bin
         clang -std=c++17 -Wno-override-module -fseh-exceptions -lstdc++ -o /home/vsts/work/1/s/examples/QIR/Development/build/Development /home/vsts/work/1/s/examples/QIR/Development/qir/Development.ll /home/vsts/work/1/s/examples/QIR/Development/build/Main.cpp -I/home/vsts/work/1/s/examples/QIR/Development/build -L/home/vsts/work/1/s/examples/QIR/Development/build -lMicrosoft.Quantum.Qir.Runtime -lMicrosoft.Quantum.Qir.QSharp.Core -lMicrosoft.Quantum.Qir.QSharp.Foundation
         /home/vsts/work/1/s/examples/QIR/Development/build/Main.cpp:1:10: fatal error: 'QirContext.hpp' file not found
         #include "QirContext.hpp"
                  ^~~~~~~~~~~~~~~~
         1 error generated.
     2>/home/vsts/work/1/s/examples/QIR/Development/Development.csproj(139,5): error MSB3073: The command "clang -std=c++17 -Wno-override-module -fseh-exceptions -lstdc++ -o /home/vsts/work/1/s/examples/QIR/Development/build/Development /home/vsts/work/1/s/examples/QIR/Development/qir/Development.ll /home/vsts/work/1/s/examples/QIR/Development/build/Main.cpp -I/home/vsts/work/1/s/examples/QIR/Development/build -L/home/vsts/work/1/s/examples/QIR/Development/build -lMicrosoft.Quantum.Qir.Runtime -lMicrosoft.Quantum.Qir.QSharp.Core -lMicrosoft.Quantum.Qir.QSharp.Foundation" exited with code 1.
     2>Done Building Project "/home/vsts/work/1/s/examples/QIR/Development/Development.csproj" (default targets) -- FAILED.
     1>Done Building Project "/home/vsts/work/1/s/examples/QIR/QIR.sln" (default targets) -- FAILED.

upon update to a newer QDK ver like this in examples/QIR/Development/Development.csproj.

The update is needed in Q# compiler for generating build/Main.cpp.


Also pay attention that clang version 11.0.0 is used on Linux instead of 14 or newer.


If the examples/QIR/Development/Development.csproj is kept at the older QDK version (0.25.228311) then we get a version conflict between different .csproj projects of examples\QIR\QIR.sln like this (see extract below). The whole QIR.sln has to stay at an older QDK version:

     1>/home/vsts/work/1/s/examples/QIR/Development/Development.csproj : error NU1605: Detected package downgrade: Microsoft.Quantum.Simulators from 0.27.236950 to 0.25.228311. Reference the package directly from the project to select a different version.  [/home/vsts/work/1/s/examples/QIR/QIR.sln]
/home/vsts/work/1/s/examples/QIR/Development/Development.csproj : error NU1605:  Development -> Microsoft.Quantum.QSharp.Core 0.27.236950 -> Microsoft.Quantum.Simulators (>= 0.27.236950)  [/home/vsts/work/1/s/examples/QIR/QIR.sln]
/home/vsts/work/1/s/examples/QIR/Development/Development.csproj : error NU1605:  Development -> Microsoft.Quantum.Simulators (>= 0.25.228311) [/home/vsts/work/1/s/examples/QIR/QIR.sln]
     1>/home/vsts/work/1/s/examples/QIR/Development/Development.csproj : error NU1605: Detected package downgrade: Microsoft.Quantum.Simulators from 0.27.236950 to 0.25.228311. Reference the package directly from the project to select a different version.  [/home/vsts/work/1/s/examples/QIR/QIR.sln]
/home/vsts/work/1/s/examples/QIR/Development/Development.csproj : error NU1605:  Development -> Microsoft.Quantum.Standard 0.27.236950 -> Microsoft.Quantum.Simulators (>= 0.27.236950)  [/home/vsts/work/1/s/examples/QIR/QIR.sln]
/home/vsts/work/1/s/examples/QIR/Development/Development.csproj : error NU1605:  Development -> Microsoft.Quantum.Simulators (>= 0.25.228311) [/home/vsts/work/1/s/examples/QIR/QIR.sln]
         Generating MSBuild file /home/vsts/work/1/s/examples/QIR/Development/obj/Development.csproj.nuget.g.props.
         Generating MSBuild file /home/vsts/work/1/s/examples/QIR/Development/obj/Development.csproj.nuget.g.targets.
         Writing assets file to disk. Path: /home/vsts/work/1/s/examples/QIR/Development/obj/project.assets.json
         Failed to restore /home/vsts/work/1/s/examples/QIR/Development/Development.csproj (in 1.27 sec).
         
         NuGet Config files used:
             /home/vsts/work/1/s/NuGet.config
             /home/vsts/.nuget/NuGet/NuGet.Config
         
         Feeds used:
             https://pkgs.dev.azure.com/ms-quantum-public/Microsoft Quantum (public)/_packaging/alpha/nuget/v3/index.json
             https://api.nuget.org/v3/index.json
             /opt/hostedtoolcache/dotnet/sdk/6.0.302/FSharp/library-packs
         
         Installed:
             2 package(s) to /home/vsts/work/1/s/examples/QIR/Emission/Emission.csproj
             5 package(s) to /home/vsts/work/1/s/examples/QIR/Development/Development.csproj
         13 of 15 projects are up-to-date for restore.
     1>Done Building Project "/home/vsts/work/1/s/examples/QIR/QIR.sln" (Restore target(s)) -- FAILED.
@kuzminrobin kuzminrobin added enhancement New request or suggestion for an improvement needs triage An initial review by a maintainer is needed labels Oct 26, 2022
@kuzminrobin kuzminrobin self-assigned this Oct 26, 2022
@kuzminrobin kuzminrobin removed their assignment Dec 1, 2022
swernli added a commit that referenced this issue Dec 6, 2022
This change updates the remaining example and test projects for using the QIR stdlib via the Microsoft.Quantum.Simulator.Runtime as a QIR backend. This resolves #1560, #1568, and #1569.

Note that it does not update the samples under examples\QIR\Simulation as these need to be fully rewritten and likely moved to https://github.com/qir-alliance/qir-runner (see Rewrite or Move docs in examples/QIR/Simulation #1577)
swernli added a commit that referenced this issue Dec 6, 2022
This change updates the remaining example and test projects for using the QIR stdlib via the Microsoft.Quantum.Simulator.Runtime as a QIR backend. This resolves #1560, resolves #1568, and resolves #1569.

Note that it does not update the samples under examples\QIR\Simulation as these need to be fully rewritten and likely moved to https://github.com/qir-alliance/qir-runner (see Rewrite or Move docs in examples/QIR/Simulation #1577)
swernli added a commit that referenced this issue Dec 7, 2022
* Update projects, docs, cpp files for QIR stdlib

This change updates the remaining example and test projects for using the QIR stdlib via the Microsoft.Quantum.Simulator.Runtime as a QIR backend. This resolves #1560, resolves #1568, and resolves #1569.

Note that it does not update the samples under examples\QIR\Simulation as these need to be fully rewritten and likely moved to https://github.com/qir-alliance/qir-runner (see Rewrite or Move docs in examples/QIR/Simulation #1577)

* Fix development project QDK version

* Update examples/QIR/Optimization/README.md

Co-authored-by: Robin Kuzmin <9372582+kuzminrobin@users.noreply.github.com>

* Use alternative method for copying build dependencies

Co-authored-by: Robin Kuzmin <9372582+kuzminrobin@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New request or suggestion for an improvement needs triage An initial review by a maintainer is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant