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

OpenMP is now an experimental feature. #169

Closed s-mandra closed 4 years ago

s-mandra commented 4 years ago

OpenMP in src/tensor.cpp causes memory leaks that need to be fixed.

95-martin-orion commented 4 years ago

Got an error when running make run-tests with this change {...}

Seems that adding -lpthread in the Makefile can resolve this, I'll test it shortly.

95-martin-orion commented 4 years ago

Got an error when running make run-tests with this change {...}

Seems that adding -lpthread in the Makefile can resolve this, I'll test it shortly.

I have confirmed that this fixes the issue - my Makefile TESTFLAGS now looks like this:

TESTFLAGS = -lpthread -I$(GTEST_DIR)/include -L$(GTEST_DIR) -I$(GMOCK_DIR)/include -L$(GMOCK_DIR) -I$(SRC_DIR)

Please apply this fix. Thanks!

s-mandra commented 4 years ago

Got an error when running make run-tests with this change {...}

Seems that adding -lpthread in the Makefile can resolve this, I'll test it shortly.

with or without --enable-openmp? If OpenMP is disabled, you shouldn't need -lpthread. If it's the case, we need another fix.

95-martin-orion commented 4 years ago

with or without --enable-openmp? If OpenMP is disabled, you shouldn't need -lpthread. If it's the case, we need another fix.

Without --enable-openmp, tests fail to build without the -lpthread flag. Based on the error message, I think this is a googletest restriction, not a qFlex issue.

s-mandra commented 4 years ago

with or without --enable-openmp? If OpenMP is disabled, you shouldn't need -lpthread. If it's the case, we need another fix.

Without --enable-openmp, tests fail to build without the -lpthread flag. Based on the error message, I think this is a googletest restriction, not a qFlex issue.

Fixed, would you mind to try? Thanks!