MindQuantum-HiQ / HiQsimulator

A high performance distributed quantum simulator
Apache License 2.0
95 stars 36 forks source link

recipe for target '_cppsim_mpi' failed #25

Closed DechinPhy closed 5 years ago

DechinPhy commented 5 years ago

issues0925.txt It seems there are some problems when I install hiq simulator according to tutorials.

DechinPhy commented 5 years ago

sudo apt-get install libgoogle-glog-dev 正在读取软件包列表... 完成 正在分析软件包的依赖关系树
正在读取状态信息... 完成
libgoogle-glog-dev 已经是最新版 (0.3.4-2)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。 It seems glog already installed.

DechinPhy commented 5 years ago

System Version:

Linux version 4.15.0-30deepin-generic (pbuilder@zs-PC) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #31 SMP Fri Nov 30 04:29:02 UTC 2018

DechinPhy commented 5 years ago

issues0926.txt This is my stage now. Is this means HiQSimulator installed successfully or not?

DechinPhy commented 5 years ago

Still with some problems I think.

In [1]: from hiq.projectq.backends import SimulatorMPI

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from hiq.projectq.backends import SimulatorMPI

~/git_lab/HiQsimulator/hiq/projectq/backends/init.py in 23 """ 24 ---> 25 from ._sim import SimulatorMPI 26 from ._sim import StabilizerSimulator

~/git_lab/HiQsimulator/hiq/projectq/backends/_sim/init.py in 13 # limitations under the License. 14 ---> 15 from ._simulator_mpi import SimulatorMPI 16 from ._stabilizer_simulator import StabilizerSimulator

~/git_lab/HiQsimulator/hiq/projectq/backends/_sim/_simulator_mpi.py in 37 38 from hiq.projectq.ops import MetaSwap, AllocateQuregGate ---> 39 from ._cppsim_mpi import SimulatorMPI as SimulatorBackend 40 41 from mpi4py import rc

ModuleNotFoundError: No module named 'hiq.projectq.backends._sim._cppsim_mpi'

yzotov commented 5 years ago

Hello. According to the first log you have problems with gflags library. Though cmake reported that it was successfully found actually it is not. And than make scenario has failed to find gflags. May be you just need to install gflags using apt-get same as glog.

Nevertheless it is a but in cmake configuration scenarios and we have to fix it. Please in current wrong state try to find gflags.h file and libgflags.so* files and show the result. Also please show the output of the command ldd /usr/lib/x86_64-linux-gnu/libglog.so

DechinPhy commented 5 years ago

pip install --user . Processing /home/dechin/git_lab/HiQsimulator Requirement already satisfied: mpi4py in /home/dechin/anaconda3/lib/python3.7/site-packages/mpi4py-3.0.2-py3.7-linux-x86_64.egg (from HiQsimulator==0.0.1) (3.0.2) Requirement already satisfied: projectq>=0.4.0 in /home/dechin/anaconda3/lib/python3.7/site-packages/projectq-0.4.2-py3.7-linux-x86_64.egg (from HiQsimulator==0.0.1) (0.4.2) Requirement already satisfied: numpy in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (1.16.2) Requirement already satisfied: future in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (0.17.1) Requirement already satisfied: pytest>=3.1 in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (4.3.1) Requirement already satisfied: pybind11>=2.2.3 in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (2.3.0) Requirement already satisfied: requests in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (2.21.0) Requirement already satisfied: scipy in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (1.2.1) Requirement already satisfied: networkx in /home/dechin/anaconda3/lib/python3.7/site-packages (from projectq>=0.4.0->HiQsimulator==0.0.1) (2.2) Requirement already satisfied: py>=1.5.0 in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (1.8.0) Requirement already satisfied: six>=1.10.0 in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (1.12.0) Requirement already satisfied: setuptools in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (40.8.0) Requirement already satisfied: attrs>=17.4.0 in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (19.1.0) Requirement already satisfied: atomicwrites>=1.0 in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (1.3.0) Requirement already satisfied: pluggy>=0.7 in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (0.9.0) Requirement already satisfied: more-itertools>=4.0.0 in /home/dechin/anaconda3/lib/python3.7/site-packages (from pytest>=3.1->projectq>=0.4.0->HiQsimulator==0.0.1) (6.0.0) Requirement already satisfied: idna<2.9,>=2.5 in /home/dechin/anaconda3/lib/python3.7/site-packages (from requests->projectq>=0.4.0->HiQsimulator==0.0.1) (2.8) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/dechin/anaconda3/lib/python3.7/site-packages (from requests->projectq>=0.4.0->HiQsimulator==0.0.1) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in /home/dechin/anaconda3/lib/python3.7/site-packages (from requests->projectq>=0.4.0->HiQsimulator==0.0.1) (2019.3.9) Requirement already satisfied: urllib3<1.25,>=1.21.1 in /home/dechin/anaconda3/lib/python3.7/site-packages (from requests->projectq>=0.4.0->HiQsimulator==0.0.1) (1.24.1) Requirement already satisfied: decorator>=4.3.0 in /home/dechin/anaconda3/lib/python3.7/site-packages (from networkx->projectq>=0.4.0->HiQsimulator==0.0.1) (4.4.0) Building wheels for collected packages: HiQsimulator Building wheel for HiQsimulator (setup.py) ... done Stored in directory: /tmp/pip-ephem-wheel-cache-7481ng5u/wheels/1c/ab/6a/db4fbedbd7000fc402c945891c415d7a049a3bafd6d515ead5 Successfully built HiQsimulator Installing collected packages: HiQsimulator Found existing installation: HiQsimulator 0.0.1 Uninstalling HiQsimulator-0.0.1: Successfully uninstalled HiQsimulator-0.0.1 Successfully installed HiQsimulator-0.0.1

Ok problems solved I think.

MindQuantum-HiQ commented 5 years ago

Solution: Modified the file ./cmake/Findgflags.cmake line 103, added "!" @Takishima Is there a more perfect solution?

image

Takishima commented 5 years ago

Solution: Modified the file ./cmake/Findgflags.cmake line 103, added "!" @Takishima Is there a more perfect solution?

image

This does not solve the issue at all!

The goal of this check is that if CMake is able to find the gflags library using the CONFIG method, then we need to extract the information about the library header and binary locations from the targets found (which can be either stored in CMake targets gflags::gflags, gflags or in CMake variables gflags_LIBRARIES and gflags_INCLUDE_DIR depending on the version of glfags installed).

Takishima commented 5 years ago

The problem can be seen in the log here:

  -- Found gflags: /usr/include
  -- Found gflags and defined the gflags::gflags imported target:
  --   - include:      /usr/include
  --   - library:      gflags
  -- Could NOT find glog (missing: glog_DIR)
  -- Found glog: /usr/include
  -- Found glog and defined the glog::glog imported target:
  --   - include:      /usr/include
  --   - library:      /usr/lib/x86_64-linux-gnu/libglog.so

It seems that CMake does not finds the full path to the gflags library.

Could you run this command on your machine for me @DechinPhy ?

locate libgflags.so

If you get an error message, you may need to run these commands before the one above:

sudo apt-get install mlocate
sudo updatedb
Takishima commented 5 years ago

issues0926.txt This is my stage now. Is this means HiQSimulator installed successfully or not?

Installation is not successful. Error message can be seen in the log here:

  CMake Error: The current CMakeCache.txt directory /tmp/pip-req-build-3hmby4sy/build/temp.linux-x86_64-3.7/CMakeCache.txt is different than the directory /home/dechin/git_lab/HiQsimulator/build/temp.linux-x86_64-3.7 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
  CMake Error: The source "/tmp/pip-req-build-3hmby4sy/CMakeLists.txt" does not match the source "/home/dechin/git_lab/HiQsimulator/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.

You probably need to delete everything that is found inside this folder: /home/dechin/git_lab/HiQsimulator/build/temp.linux-x86_64-3.7