我最近为Linux安装了英特尔的c / c ++编译器:“用于Linux的英特尔®C++ Composer XE”。
当我进行安装时,只标记了与编译器和调试器相关的选项(或包),并向instaler说我将编译64位应用程序。
现在,当我尝试编译程序时,我得到了:
meniwis @ meniwis-Satellite-L845:〜/ syscave / src / c-ext / code $ ./build.sh
Could not locate executable icc
Could not locate executable ecc
INFO:root:using /opt/alges/ as sqlite3 directory
INFO:root:using /opt/alges/ as HDF5 directory
running build_ext
running build_src
build_src
building extension "cvoronoi" sources
building extension "cflowsim" sources
build_src: building npy-pkg config files
customize IntelCCompiler
customize IntelCCompiler using build_ext
customize IntelCCompiler
customize IntelCCompiler using build_ext
building 'cvoronoi' extension
compiling C++ sources
C compiler: icc -fPIC
compile options: '-g -I/home/meniwis/syscave/src/c-ext/code/../include -
I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
icc: /home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp
sh: 1: icc: not found
sh: 1: icc: not found
error: Command "icc -fPIC -g -I/home/meniwis/syscave/src/c-ext/code/../include -
I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c
/home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp -o build/temp.linux-x86_64-
2.7/home/meniwis/syscave/src/c-ext/code/cvoronoi.o" failed with exit status 127
对我正在做的事情进行“一步一步”:
在命令行中输入:
meniwis@meniwis-Satellite-L845:~/syscave/src/c-ext/code$ ./build.sh
“build.sh”文件是下一个:
export HDF5_DIR=/opt/alges/
export SQLITE3_DIR=/opt/alges/
export SYSCAVE_ROOT=/home/meniwis/syscave/
python setup.py build_ext --inplace
“setup.py”文件的一部分:
.
.
.
voronoi_src_dir=abspath(pjoin(syscave_root,'src/c-ext/code'))
cflowsim_src_dir=abspath(pjoin(syscave_root,'src/c-ext/code/flowsim/code/Flowsim'))
extensions = [
Extension('cvoronoi',
sources=[
pjoin(voronoi_src_dir,'cvoronoi.cpp'),
pjoin(voronoi_src_dir,'VoronoiDiagramGenerator.cpp')
],
language = "c++",
include_dirs=[pjoin(voronoi_src_dir,'../include')],
extra_objects=lib_args['extra_compile_args']
),
Extension('cflowsim',
sources=[
pjoin(cflowsim_src_dir,'cflowsim.cpp'),
pjoin(cflowsim_src_dir,'parsers.cpp'),
pjoin(cflowsim_src_dir,'Cell.cpp'),
pjoin(cflowsim_src_dir,'ChunkDriver.cpp'),
pjoin(cflowsim_src_dir,'DataLoader.cpp'),
pjoin(cflowsim_src_dir,'DisplayResult.cpp'),
pjoin(cflowsim_src_dir,'Drawbell.cpp'),
pjoin(cflowsim_src_dir,'DrawbellType.cpp'),
pjoin(cflowsim_src_dir,'Drawpoint.cpp'),
pjoin(cflowsim_src_dir,'ExtractionResult.cpp'),
pjoin(cflowsim_src_dir,'Model.cpp'),
pjoin(cflowsim_src_dir,'Simulator.cpp'),
pjoin(cflowsim_src_dir,'Tracer.cpp'),
],
language = "c++",
extra_objects=lib_args['extra_compile_args'],
**lib_args
)
]
#move to packages
#all default to ext_dir
ext_run_dir=abspath(pjoin(syscave_root,'src/python/syscave/extensions/'))
moves=[]
for ext in extensions:
if ext.name not in moves:
moves.append((ext.name,ext_run_dir))
moves.append(None)
ext_src_dir=pjoin(syscave_root,'src','c-ext','code') #='.'
file_ext=''
if os.name=='posix':
file_ext='so'
build_path=abspath(ext_src_dir)
elif os.name=='nt':
file_ext='pyd'
build_path=abspath(ext_src_dir)
else:
raise EnvironmentError('Unsupported platform: {0}'.format(os.name))
for i,m in enumerate(moves):
if m is None:
continue
name,new_path=m
file_name=".".join([name,file_ext])
file_path_from=os.path.join(build_path,file_name)
file_path_to =os.path.join(new_path,file_name)
moves[i]=(file_path_from,file_path_to)
.
.
.
所以错误是icc和ecc无法找到?或者是别的什么?如果是这样,我怎么解决它?任何指示?。
提前致谢。 素不相识。
--------------------- EDIT ------------------------- ---------
在@Vahid abdi的帮助下,我会做下一个:
export PATH=$PATH:/opt/intel/bin/
现在我明白了:
meniwis@meniwis-Satellite-L845:~/syscave/src/c-ext/code$ ./build.sh
Found executable /opt/intel/bin/icc
Could not locate executable ecc
INFO:root:using /opt/alges/ as sqlite3 directory
INFO:root:using /opt/alges/ as HDF5 directory
running build_ext
running build_src
build_src
building extension "cvoronoi" sources
building extension "cflowsim" sources
build_src: building npy-pkg config files
customize IntelCCompiler
customize IntelCCompiler using build_ext
customize IntelCCompiler
customize IntelCCompiler using build_ext
building 'cvoronoi' extension
compiling C++ sources
C compiler: icc -fPIC
compile options: '-g -I/home/meniwis/syscave/src/c-ext/code/../include -
I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
icc: /home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp
In file included from /usr/include/c++/4.8/bits/stl_tree.h(61),
from /usr/include/c++/4.8/map(60),
from /home/meniwis/syscave/src/c-
ext/code/../include/VoronoiDiagramGenerator.h(36),
from /home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp(9):
/usr/include/c++/4.8/bits/stl_algobase.h(59): catastrophic error: cannot open source
file "bits/c++config.h"
#include <bits/c++config.h>
^
compilation aborted for /home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp (code 4)
In file included from /usr/include/c++/4.8/bits/stl_tree.h(61),
from /usr/include/c++/4.8/map(60),
from /home/meniwis/syscave/src/c-
ext/code/../include/VoronoiDiagramGenerator.h(36),
from /home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp(9):
/usr/include/c++/4.8/bits/stl_algobase.h(59): catastrophic error: cannot open source
file "bits/c++config.h"
#include <bits/c++config.h>
^
compilation aborted for /home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp (code 4)
error: Command "icc -fPIC -g -I/home/meniwis/syscave/src/c-ext/code/../include -
I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c
/home/meniwis/syscave/src/c-ext/code/cvoronoi.cpp -o build/temp.linux-x86_64-
2.7/home/meniwis/syscave/src/c-ext/code/cvoronoi.o" failed with exit status 4
请帮忙。 提前谢谢。
答案 0 :(得分:1)
你是如何安装icc的?
icc不在您的$ PATH变量
中首先查找icc路径updatedb && locate icc
然后将它的基本名称添加到$ PATH变量中,如下所示:
export PATH=$PATH:/path/to/youricc/basename
答案 1 :(得分:1)
现在问题是icc无法打开bits/c++config.h
如果您bits/c++config.h
首先尝试找到它的路径(可能是:/usr/include/x86_64-linux-gnu/c++/4.7)并将其添加到icc,如下所示
export __INTEL_POST_CFLAGS="-I/usr/include/x86_64-linux-gnu/c++/4.7"