如何使用 EPD python 在 Ubuntu 12.04 中使用 FEniCS? [英] How can I get FEniCS working in Ubuntu 12.04 with EPD python?

查看:23
本文介绍了如何使用 EPD python 在 Ubuntu 12.04 中使用 FEniCS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FEniCS 不适用于 Enthought EPD 除非我用 PYTHONPATH 做一些疯狂的事情,这通常会导致 EPD 使用 Ubuntu 存储库 python 模块而不是 EPD 模块.

FEniCS that comes in the Ubuntu 12.04 repository does not work with Enthought EPD unless I do some crazy stuff with PYTHONPATH which can often result in EPD using Ubuntu repository python modules rather than EPD modules.

另一种方法是编译和安装所有 FEniCS 模块 手动.这很奇怪,因为 FEniCS 需要 sudo 才能安装在普通的 EPD 目录/usr/local/EPD 中.如果您使用 sudo,这意味着 PATH 环境变量不是来自 ~/.bashrc ,因此它认为它与本机 python 一起工作,而不是 EPD.我尝试在 sudo 上使用 -i 选项,这也做了一些奇怪的事情.

The alternative then is to compile and install all of the FEniCS modules manually. This is screwy because FEniCS needs sudo to install in the normal EPD directory, /usr/local/EPD. If you use sudo, this means that PATH environment variable is not being sourced from ~/.bashrc so it thinks it's working with the native python, not EPD. I tried using the -i option on sudo, and that did some screwy things also.

推荐答案

我设法解决了自己的问题.我将要描述的这种技术存在很多问题,详细信息这里此处.出于我不明白的原因,重新安装 Ubuntu 修复了链接中描述的问题,但这超出了我在这里试图涵盖的范围.可以说将/和/home 作为单独的分区安装 Ubuntu 很好,因为它使完全重新安装变得非常容易.

I managed to solve my own problem. There were a bunch of issues with this technique that I am about to describe, and they are detailed here and here. For reasons that I don't understand, reinstalling Ubuntu fixed the problems described in the links, but that's beyond the scope of what I'm trying to cover here. Suffice it to say that it's good to install Ubuntu with / and /home as separate partitions because it makes complete reinstall very easy.

  1. 此处下载所有软件包.创建目录 ~/.local/src/fenics 并将它们保存在那里.对该目录中的所有文件运行 tar -xvf.一个简单的方法是使用命令 for i in *.tar.gz;做 tar -xvf $i;完成.
  2. 首先通过进入每个目录并运行 python setup.py install --user 来安装 Python 模块 FFC、FIAT、Instant、Viper 和 UFL.用户标志使它们安装在/.local/lib .. 中.这将被添加到你在 python 中的 sys.path 中.您可以在此处阅读有关 --user 标志的更多信息.
  3. 然后导航到 dolfin 和 ufc 的目录,并在每个目录中运行以下命令:cmake -DCMAKE_INSTALL_PREFIX=~/.local ., make, <代码>进行安装.
  4. 最后,如果您想使用强大的文本编辑器,请使用 gedit 或 emacs 将 source/home/chad/.local/share/dolfin/dolfin.conf 添加到 ~/.bashrc.
  1. Download all of the packages here. Create the directory ~/.local/src/fenics and save them there. Run tar -xvf on all the files in that directory. An easy easy to do this is with the command for i in *.tar.gz; do tar -xvf $i; done.
  2. First install the python modules FFC, FIAT, Instant, Viper and UFL by going into each of their directories and running python setup.py install --user. The user flag causes them to be installed in /.local/lib.. something. This will be added to your sys.path in python. You can read more about the --user flag here.
  3. Then navigate to the directories for dolfin and ufc, and in each of them run the following commands: cmake -DCMAKE_INSTALL_PREFIX=~/.local ., make, make install.
  4. Lastly, add source /home/chad/.local/share/dolfin/dolfin.conf to ~/.bashrc using gedit or emacs if you want to use a powerful text editor.

编辑您还必须安装 ScientificPython 使用 python setup.py install --user,这相对轻松.
编辑

EDIT You must also install ScientificPython using python setup.py install --user, and this is relatively painless.
EDIT

这应该能让你在 ~/.local/share/dolfin/demo/pde/poisson/python 中运行演示.我希望这可以帮助别人.

This should get you up and running for the demos in ~/.local/share/dolfin/demo/pde/poisson/python. I hope this helps someone.

这篇关于如何使用 EPD python 在 Ubuntu 12.04 中使用 FEniCS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆