linux Ubuntu14.04 python(c++版本) tesorflow(python版本)c++

一、环境变量配置:

export M2_HOME=/home/ustcjing/Maven/apache-maven-3.5.0
export JAVA_HOME=/usr/lib/jvm8/java
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:/root/anaconda3/bin:${M2_HOME}/bin:/home/ustcjing/SocLib/soclib/utils/bin:/home/ustcjing/Soclib/Installaion/binutils/bin:/home/ustcjing/Soclib/build/mipsel:/home/ustcjing/SocLib/Installaion/binutils/bin:$PATH
export SYSTEMC=/home/ustcjing/SystemC
export PKG_CONFIG_PATH=usr/local/lib/pkgconfig:/root/anaconda3/lib/pkgconfig:$PKG_CONFIG_PATH
export LIBRARY_PATH=/usr/lib:/usr/local/lib:/root/anaconda3/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/root/anaconda3/lib:/root/anaconda3/bin:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/usr/local/include:/root/anaconda3/include/python3.5m:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/include:/root/anaconda3/include/python3.5m:$CPLUS_INCLUDE_PATH

二、Makefile文件

CFLAGS = -g -Wall
LIBS = $(shell pkg-config opencv --cflags --libs)
INCLUDES=$(shell pkg-config python3 --cflags --libs)
OBJS = test.cpp
CXX = g++
all: test
test: $(OBJS)
    $(CXX) $(CFLAGS) $(OBJS) $(LIBS) $(INCLUDES) -o $@ 
clean:
    rm -rf *.o

三、更新Cmake

sudo add-apt-repository ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get upgrade 
cmake --version

四、OpenCv的安装参数

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D PYTHON3_EXECUTABLE=/home/ustcjing/Anaconda3/bin/python3 -D PYTHON_INCLUDE_DIR=/home/ustcjing/Anaconda3/include/python3.5m -D PYTHON_LIBRARY=/home/ustcjing/Anaconda3/lib/libpython3.5m.so -D PYTHON3_NUMPY_INCLUDE_DIRS=/home/ustcjing/Anaconda3/pkgs/numpy-1.14.0-py35h3dfced4_0/lib/python3.5/site-packages/numpy/core/include -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D PYTHON_EXECUTABLE=/home/ustcjing/Anaconda3/bin/python3 -D BUILD_TIFF=ON -D BUILD_EXAMPLES=ON ..

五、libstdc++的链接问题

ln -s libstdc++.so.6.0.24 libstdc++.so.6
ln -s libstdc++.so.6.0.24 libstdc++.so

 

posted @ 2018-10-10 09:20  Run_For_Love  阅读(2567)  评论(0编辑  收藏  举报