ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
97 stars 24 forks source link

evaluate_circuit.cpp compile after make clean-all #276

Closed alexandrupaler closed 4 years ago

alexandrupaler commented 4 years ago

After successfully configuring the Makefiles. The compiler complains

evaluate_circuit.cpp: In function ‘std::vector<std::pair<std::__cxx11::basic_string<char>, std::complex<double> > > qflex::EvaluateCircuit(qflex::QflexInput*)’:
evaluate_circuit.cpp:190:37: error: unused variable ‘index’ [-Werror=unused-variable]
         for (const auto& [index, dim] : index_dim) {
                                     ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]
95-martin-orion commented 4 years ago

This is a clang flag - what version of clang are you running? My system reports v8.0.1:

$ clang --version
clang version 8.0.1-3+build1 (tags/RELEASE_801/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Just to confirm, is this error happening when running make from the top-level qflex/ directory?

alexandrupaler commented 4 years ago

I should be using G++ 7.4 and not clang

În joi, 27 feb. 2020 la 12:02, Orion Martin notifications@github.com a scris:

This is a clang flag https://clang.llvm.org/docs/DiagnosticsReference.html#wunused-command-line-argument

  • what version of clang are you running? My system reports v8.0.1:

$ clang --version clang version 8.0.1-3+build1 (tags/RELEASE_801/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin

Just to confirm, is this error happening when running make from the top-level qflex/ directory?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ngnrsaa/qflex/issues/276?email_source=notifications&email_token=AEHWGFNXOJDLTEBQIE2D46DRFAL5NA5CNFSM4K5B7E42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENFYDDA#issuecomment-592150924, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHWGFMRMGXTDKJGWOVRIJ3RFAL5NANCNFSM4K5B7E4Q .

95-martin-orion commented 4 years ago

As discussed offline, this can be avoided by either using the index variable (if it's actually needed) or iterating only over the values (dims) of index_dim. Since we should be avoiding unused variables in any case, we should submit this fix - @alexandrupaler, would you be able to send a PR for this?

s-mandra commented 4 years ago

make clean-all should remove everything, including all the Makefiles. Hence I'm surprised you can even run make after make clean-all.

alexandrupaler commented 4 years ago

@s-mandra: #249 addressed this issue by rewriting the for loop.