Failed to generate makefiles
Layne-wu opened this issue · comments
I downloaded the relevant package and ran the instructions as shown in the document until I got an error at this step.
CXX=mpiicpc cmake -DIqsMPI=ON -DIqsUtest=ON ..
-- The CXX compiler identification is unknown
-- Check for working CXX compiler: /opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin/mpiicpc
-- Check for working CXX compiler: /opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin/mpiicpc -- broken
CMake Error at /opt/cmake-3.12.2/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin/mpiicpc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /root/intel-qs/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_3abc4/fast"
/usr/bin/make -f CMakeFiles/cmTC_3abc4.dir/build.make CMakeFiles/cmTC_3abc4.dir/build
make[1]: Entering directory '/root/intel-qs/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_3abc4.dir/testCXXCompiler.cxx.o
/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin/mpiicpc -o CMakeFiles/cmTC_3abc4.dir/testCXXCompiler.cxx.o -c /root/intel-qs/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin/mpiicpc: 1: eval: icpc: not found
CMakeFiles/cmTC_3abc4.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_3abc4.dir/testCXXCompiler.cxx.o' failed
make[1]: *** [CMakeFiles/cmTC_3abc4.dir/testCXXCompiler.cxx.o] Error 127
make[1]: Leaving directory '/root/intel-qs/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_3abc4/fast' failed
make: *** [cmTC_3abc4/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:17 (project)
-- Configuring incomplete, errors occurred!
See also "/root/intel-qs/CMakeFiles/CMakeOutput.log".
See also "/root/intel-qs/CMakeFiles/CMakeError.log".
What should I do? thanks
@giangiac
Hi @Layne-wu
I am not sure what is happening. From the error message it seems that there is a problem with the mpiicpc compiler.
Did you verify that the installed version of mpiicpc is able to compile a simple "hello world" example?
Recall that mpiicpc is part of the icpc compiler that requires license so is not available in all machines.
Gian
Hi @Layne-wu
I just performed a fresh clone of the repository on Ubuntu 20.04 LTS and was able to build with mpiicpc. When you get a chance, could you post the output from the following command:
bash> mpiicpc -show_env
This will let me know if your shell environment is correctly configured for the Intel Compiler toolchain or if something is missing or corrupted.
Thanks!
Justin -=-
Hi @jwhogabo
This is the output after I run mpiicpc -show_env, and it seems normal.
LIBRARY_PATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/libfabric/lib:/opt/intel/compilers_and_
libraries_2020.2.254/linux/mpi/intel64/libfabric/lib:/opt/intel/compilers_and_libraries_2020.2.254/linux/ipp/lib/int
el64:/opt/intel/compilers_and_libraries_2020.2.254/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries
2020.2.254/linux/mkl/lib/intel64_lin:/opt/intel/compilers_and_libraries_2020.2.254/linux/tbb/lib/intel64/gcc4.8:/op
t/intel/compilers_and_libraries_2020.2.254/linux/tbb/lib/intel64/gcc4.8:/opt/intel/compilers_and_libraries_2020.2.25
4/linux/daal/lib/intel64_lin:/opt/intel/compilers_and_libraries_2020.2.254/linux/daal/../tbb/lib/intel64_lin/gcc4.4:
/opt/intel/compilers_and_libraries_2020.2.254/linux/daal/../tbb/lib/intel64_lin/gcc4.8
MAIL=/var/mail/root
USER=root
SSH_CLIENT=58.33.10.82 16779 22
LANGUAGE=en_US.UTF-8
INTEL_PYTHONHOME=/opt/intel/debugger_2020/python/intel64/
LD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/libfabric/lib:/opt/intel/compilers_a
nd_libraries_2020.2.254/linux/mpi/intel64/lib/release:/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel6
4/lib:/opt/intel/compilers_and_libraries_2020.2.254/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_librarie
s_2020.2.254/linux/mpi/intel64/libfabric/lib:/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/lib/rel
ease:/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/lib:/opt/intel/compilers_and_libraries_2020.2.2
54/linux/ipp/lib/intel64:/opt/intel/compilers_and_libraries_2020.2.254/linux/mkl/lib/intel64_lin:/opt/intel/compiler
s_and_libraries_2020.2.254/linux/tbb/lib/intel64/gcc4.8:/opt/intel/debugger_2020/python/intel64/lib:/opt/intel/debug
ger_2020/libipt/intel64/lib:/opt/intel/compilers_and_libraries_2020.2.254/linux/daal/lib/intel64_lin:/opt/intel/comp
ilers_and_libraries_2020.2.254/linux/daal/../tbb/lib/intel64_lin/gcc4.4:/opt/intel/compilers_and_libraries_2020.2.25
4/linux/daal/../tbb/lib/intel64_lin/gcc4.8
SHLVL=1
OLDPWD=/root/intel-qs/examples
HOME=/root
INTEL_LICENSE_FILE=/opt/intel/compilers_and_libraries_2020.2.254/linux/licenses:/opt/intel/licenses:/root/intel/lice
nses
SSH_TTY=/dev/pts/0
IPPROOT=/opt/intel/compilers_and_libraries_2020.2.254/linux/ipp
DAALROOT=/opt/intel/compilers_and_libraries_2020.2.254/linux/daal
MPI_ROOT=/srv/mpich-install
TBBROOT=/opt/intel/compilers_and_libraries_2020.2.254/linux/tbb
INFOPATH=/opt/intel/documentation_2020/en/debugger/gdb-ia/info/
LOGNAME=root
PSTLROOT=/opt/intel/compilers_and_libraries_2020.2.254/linux/pstl
=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin/mpiicpc
PKG_CONFIG_PATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/mkl/bin/pkgconfig
XDG_SESSION_ID=4599
TERM=xterm
PATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/libfabric/bin:/opt/intel/compilers_and_librarie
s_2020.2.254/linux/mpi/intel64/bin:/opt/intel/compilers_and_libraries_2020.2.254/linux/bin/intel64:/opt/intel/compil
ers_and_libraries_2020.2.254/linux/bin:/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/libfabric/bin
:/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/bin:/opt/intel/debugger_2020/gdb/intel64/bin:/srv/m
pich-install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
S_COLORS=auto
XDG_RUNTIME_DIR=/run/user/0
DISPLAY=localhost:10.0
LANG=en_US.UTF-8
SHELL=/bin/bash
MKLROOT=/opt/intel/compilers_and_libraries_2020.2.254/linux/mkl
CLASSPATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/lib/mpi.jar:/opt/intel/compilers_and_libra
ries_2020.2.254/linux/mpi/intel64/lib/mpi.jar:/opt/intel/compilers_and_libraries_2020.2.254/linux/daal/lib/daal.jar
NLSPATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/compiler/lib/intel64/locale/%l%t/%N:/opt/intel/compiler
s_and_libraries_2020.2.254/linux/mkl/lib/intel64_lin/locale/%l%t/%N:/opt/intel/debugger_2020/gdb/intel64/share/loca
le/%l_%t/%N
LC_ALL=en_US.UTF-8
FI_PROVIDER_PATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi/intel64/libfabric/lib/prov
PWD=/root/intel-qs
SSH_CONNECTION=58.33.10.82 16779 10.1.1.58 22
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
I_MPI_ROOT=/opt/intel/compilers_and_libraries_2020.2.254/linux/mpi
CPATH=/opt/intel/compilers_and_libraries_2020.2.254/linux/ipp/include:/opt/intel/compilers_and_libraries_2020.2.254/
linux/mkl/include:/opt/intel/compilers_and_libraries_2020.2.254/linux/pstl/include:/opt/intel/compilers_and_librarie
s_2020.2.254/linux/pstl/stdlib:/opt/intel/compilers_and_libraries_2020.2.254/linux/tbb/include:/opt/intel/compilers_
and_libraries_2020.2.254/linux/tbb/include:/opt/intel/compilers_and_libraries_2020.2.254/linux/daal/include
MANPATH=:/opt/intel/man/common::/opt/intel/documentation_2020/en/debugger/gdb-ia/man/:/srv/mpich-install/man:::
In addition, I would like to ask two other questions. If I want to use the IQS simulator and MPI mechanism to run quantum programs on multiple machines, what should I do? Is there any relevant documentation for reference? I checked your get_started_with_IQS. cpp file, does it mean that I need to define the file according to your grammar rules? Then use commands to execute them.
Another problem is that when I run [ mpiicpc ./examples/grover_4qubit.cpp -o grover_4quibt ] under the intel-qs directory, and then report an error, I did not find the /qureg/qureg.hpp file in the project.
./examples/grover_4qubit.cpp(20): catastrophic error: cannot open source file "../qureg/qureg.hpp"
#include "../qureg/qureg.hpp"
^
compilation aborted for ./examples/grover_4qubit.cpp (code 4)
/qureg/qureg.hpp
thanks so much.
Hi @Layne-wu
Let me address the part about compiling "grover_4quibt.cpp". It is part of the applications provided in the folder "/examples".
The examples should be compiled automatically when, in the cmake command, one adds the option "-DBuildExamples=ON".
The executables are built in "/examples/bin"
For the specific case of "grover_4quibt.cpp" it used some old notation and we forgot to include it in the CMakeLists.txt file.
I just committed a quick fix of this issue. Also, if you give a look to:
https://github.com/iqusoft/intel-qs/blob/master/examples/CMakeLists.txt
you may see a clear pattern about how to add other examples or applications.
From your question, you tried to compile using command line. It is a bit more complicated since:
- make needs to know where to find the header files (like qureg.hpp), so you should provide the corresponding path using the compiler option -I
- the code needs to be linked to the IQS library and other libraries (like MKL, ...). They must be provided via -l and -L options.
The cmake building process was put in place to take care of these details automatically.
We know that the documentation is lacking and we are working on extending it.
We thank you for your valuable feedback.
Best,
Gian