谷歌的tensorflow包在gentoo环境下安装挺非周折,作者折腾了一天,总算搞定了。
我的gentoo是2013年安装的,计划安装tensorflow 0.5.0,上网了解到tensorflow最好的使用环境是python,虽然我不了解python,但有其它语言做基础,觉得安装没什么难度。于是不加思索直接下了个tensorflow包,解压后就想试用,在python环境里:
可想而知,碰了一鼻子灰。
查谷歌文档:http://wiki.jikexueyuan.com/project/tensorflow-zh/get_started/os_setup.html,觉得我这个环境(主要是有两个版本的python,2.7.5和3.2),最好方法用virtualenv安装,不容迟疑,那就赶快装个virtual 吧!
$ emerge virtualenv
由于存在两个版本的python,好像virtualenv要我决定使用哪个版本python才emerge得到,按照网络上所说打入:
$PYTHON_TARGETS="python2_7" emerge virtualenv
emerge说我有很多包block virtualenv,特别是python block的最狠。在网上到处找,很是烦人,终于在gentoo的官网上找到一丝踪迹,https://www.gentoo.org.cn/mirrorlist/,原来是我的gentoo太老了,长时间不更新,包被阻塞。于是按照gentoo的官网修改/etc/portage/make.conf
# These settings were set by the catalyst build script that automatically # built this stage. # Please consult /usr/share/portage/config/make.conf.example for a more # detailed example. CFLAGS="-O2 -pipe" CXXFLAGS="${CFLAGS}" # WARNING: Changing your CHOST is not something that should be done lightly. # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing. CHOST="x86_64-pc-linux-gnu" # These are the USE flags that were used in addition to what is provided by the # profile used for building. USE="bindist mmx sse sse2 gtk2 gtk3 -gnome qt4 dvd alsa cdr -minimal branding d$ SYNC="rsync://mirrors.ustc.edu.cn/gentoo-portage/" GENTOO_MIRRORS="http://mirrors.aliyun.com/gentoo/" PORTDIR="/usr/portage" DISTDIR="${PORTDIR}/distfiles" PKGDIR="${PORTDIR}/packages" INPUT_DEVICES="evdev synaptics" VIDEO_CARDS="intel"