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

Track C++ in LGTM #197

Closed 95-martin-orion closed 4 years ago

95-martin-orion commented 4 years ago

Latest LGTM runs for C++ appear to be stuck installing pybind11:

[2019-10-26 01:15:35] [build] checking for pybind11... no
[2019-10-26 01:15:35] [build] configure: error: Please install pybind11 >= '2.2.4' before configuring (or --disable-pybind11).

Hopefully resolving this will allow us to track C++ code quality in LGTM as well.

s-mandra commented 4 years ago

Let me check this, it worked on my machine. What OS do you have?

95-martin-orion commented 4 years ago

Let me check this, it worked on my machine. What OS do you have?

As far as I can tell the LGTM runs are handled by a remote server - the full logs are available in the link above.

s-mandra commented 4 years ago

It fails because the LGTM VM doesn't have the Python libraries required to run pybind11. There is no solution unless we decide to have Python disabled by default (so that, only C++ would be compiled).

s-mandra commented 4 years ago

To avoid this issue, I'm changing configure.ac so that in case of a python fail, it simply disable python rather than issue an error.

95-martin-orion commented 4 years ago

LGTM is still unable to check C++ quality. Apparent cause is the flags LGTM uses for g++ - in particular, the lack of -std=c++17:

[2019-11-07 18:37:22] [build] g++ -c ordering.cpp -fpermissive -lgslcblas -lpthread -Wno-unknown-pragmas  -Idocopt/ -fPIC -o ordering.o
{...errors in ordering.cpp...}
[2019-11-07 18:37:22] [build] ordering.cpp:42:7: warning: init-statement in selection statements only available with -std=c++17 or -std=gnu++17
[2019-11-07 18:37:22] [build]    if (auto in = std::ifstream(filename); in.good())
[2019-11-07 18:37:22] [build]        ^~~~

Additional logs can be seen in the latest run.

s-mandra commented 4 years ago

Yeah .. initially the problem was python but I'm not sure how to resolve this problem. I can take another look.

s-mandra commented 4 years ago

We probably need a configuration file.

s-mandra commented 4 years ago

Fixed: https://lgtm.com/projects/g/ngnrsaa/qflex/logs/languages/lang:cpp

s-mandra commented 4 years ago

@95-martin-orion Is it ok with Google policy to install the LGTM app? Thanks!

95-martin-orion commented 4 years ago

Is it ok with Google policy to install the LGTM app?

As far as I can find, this is the only restriction in the Google policy:

If the service doesn't require commit access (public_repo or repo scope), then it's generally fine to use.

It's explicitly noted that this prohibits use of the Travis CI app, but not travis-ci.org.

s-mandra commented 4 years ago

To avoid any trouble, let's not install any apps. Thanks for clarifying this!