Skip to content

Commit

Permalink
Fix XACC build (#8)
Browse files Browse the repository at this point in the history
* Update script to build witih and without xacc

* Fix xacc quantum test for revert to single interface

* Fix bad ctest arguments flagged by cmake update
  • Loading branch information
sethrj authored Jul 22, 2024
1 parent 63642ef commit 86682c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ jobs:
- name: Run tests
working-directory: build
run: |
ctest --parallel 2 --timeout 15 --output-on-failure \
--test-output-size-passed=32768 --test-output-size-failed=1048576
ctest --parallel 2 --timeout 15 --output-on-failure
- name: Install
working-directory: build
run: |
Expand Down
16 changes: 15 additions & 1 deletion scripts/cmake-presets/goldfinger.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@
"CMAKE_FIND_FRAMEWORK": {"type": "STRING", "value": "LAST"},
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-O2 -g -DNDEBUG -fno-inline -fno-omit-frame-pointer",
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-error=deprecated -pedantic -fdiagnostics-color=always"
},
"environment": {
"CMAKE_PREFIX_PATH": "/opt/homebrew/Cellar/llvm/18.1.6:/opt/spack/var/spack/environments/xacc/.spack-env/view:$env{HOME}/Code/xacc/install"
}
},
{
"name": "base",
"displayName": "Goldfinger default options",
"inherits": [".base", "default"],
"binaryDir": "${sourceDir}/build",
"cacheVariables": {}
"cacheVariables": {
"QIREE_USE_XACC": {"type": "BOOL", "value": "OFF"}
}
},
{
"name": "xacc",
"displayName": "Build with xacc",
"inherits": ["base"],
"binaryDir": "${sourceDir}/build-xacc",
"cacheVariables": {
"QIREE_USE_XACC": {"type": "BOOL", "value": "ON"}
}
}
],
"buildPresets": [
Expand Down
6 changes: 2 additions & 4 deletions test/qirxacc/XaccQuantum.test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "qiree/Types.hh"
#include "qiree_test.hh"
#include "qirxacc/XaccDefaultRuntime.hh"

namespace qiree
{
Expand Down Expand Up @@ -66,7 +65,6 @@ TEST_F(XaccQuantumTest, sim_rotation)

// Create a simulator that will write to the string stream
XaccQuantum xacc_sim{os};
XaccDefaultRuntime xacc_rt{os, xacc_sim};

// Call functions in the same sequence that rotation.ll would
xacc_sim.set_up([] {
Expand All @@ -79,8 +77,8 @@ TEST_F(XaccQuantumTest, sim_rotation)
xacc_sim.rx(pi / 6, Q{0});
xacc_sim.h(Q{0});
xacc_sim.mz(Q{0}, R{0});
xacc_rt.array_record_output(1, "yeehaw");
xacc_rt.result_record_output(R{0}, "tag");
xacc_sim.array_record_output(1, "yeehaw");
xacc_sim.result_record_output(R{0}, "tag");
xacc_sim.tear_down();

auto result = clean_output(os.str());
Expand Down

0 comments on commit 86682c3

Please sign in to comment.