我对linux很新,并尝试运行一些代码。尝试了几天没有成功,我希望有人可以帮助我。我的Linux版本是
描述:Ubuntu 16.04.1 LTS版本:16.04代号:xenial 代码可在此处找到:https://bitbucket.org/dsign/gecmi/wiki/Home
我的问题在于修改配置文件:site_config.py,开发人员说我应该:
检查此文件并对其进行编辑,使其与您的构建环境,要编译的目标以及您希望在何处安装它们的目标相匹配。 首先,我尝试通过apt-get安装boost,itbb,scons和numpy / scipy库
# Use 'release' for speed, 'debug' for debugging.
COMPILE_MODE='release'
# Use one or both of the following words: 'standalone' for
# building the standalone executable, 'python' for building
# the python module
COMPILE_TARGETS='standalone python'
# Where the boost library is installed. I expect an 'include'
# and a 'lib' dir below.
BOOST_ROOT='/opt/boost_1_47_0/'
# The prefix of the python installation. This is used for deducing
# include directories and lib path of python
PYTHON_PREFIX="/usr/"
# The python's version. Used for deducing include directories and
# library name of python.
PYTHON_VERSION ="2.7"
# Where the Intel threading building blocks is installed. I expect
# and 'include' and a 'lib' directory below this one.
TBB_PREFIX="/home/alcides/programming/projects/sci_python/prx"
# The executable for the c++ compiler to use.
COMPILER_NAME="g++-4.6"
# The place where numpy is installed. I expect the directories
# 'core/include' and 'numarray/include' below.
NUMPY_PREFIX="/usr/local/lib/python2.7/dist-packages/numpy/"
# Where you sould like the standalone program to be installed
GECMI_PROGRAM_INSTALL_AT='/usr/local/bin'
# Where you would like the shared library to be installed. This
# library is used by both the python module and the standalone
# program.
GECMI_LIB_INSTALL_AT='/usr/local/lib'
# Where would you like to have the module installed, for the
# target 'InstallPythonModule'. A dll file called gecmi.{dllext}
# is installed there.
PYTHON_MODULE_INSTALL_AT='/usr/lib/python2.7/dist-packages'
我不确定这些是否是正确的版本,但这是我在研究了一下之后能找到的。
下一步是调整配置文件中的条目,但我发现很难(实际上我没有太多线索)找出所有这些目录在安装上述库之后是什么或者如何分别调整此配置文件:
{{1}}
作者的提示指出修改LD_LIBRARY_PATH变量,但对我没有多大帮助:
如果未正确安装依赖项,则可以在加载共享库时获取类似错误的消息。在这种情况下,您可能想要使用命令locate和环境变量LD_LIBRARY_PATH或您选择的操作系统中的等效项。 我试图使用whereis并找到,但不确定是否有效。例如,当我使用whereis boost或locate boost时,我找到了很多目录,但是配置文件似乎没有像boost / include或boost / lib这样的目录。对于numpy,没有numarray / include文件夹asf。
所以基本上我想知道linux高级用户如何找到所有必要的路径和目录,并弄清楚如何运行此代码(或者如果你们中的一些人可以运行代码)。我还要感谢有关如何更熟悉解决此类问题的更多信息/教程/建议。
谢谢!
答案 0 :(得分:0)
在终端写下面的命令
sudo apt-get update
sudo apt-get -y upgrade
python3 -V (out put is Python 3.5.2 may be or other version..)
sudo apt-get install -y python3-pip
pip3 install package_name
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
sudo apt-get install -y python3-venv
如需更多帮助,请参阅这些网站