Subject: [FEniCS-users] running demo.py for the Poisson problem

From: Krishna Garikipati <[email-masked]>
Date: Thu, 15 Oct 2009 06:04:18 +0100

Hello,

I have dolfin-0.9.3 installed, and get the following error message when
I try to run the python script demo.py for the Poisson problem:
$ python demo.py
Traceback (most recent call last):
  File "demo.py", line 20, in ?
    from dolfin import *
ImportError: No module named dolfin

I suppose I am doing something wrong. Any ideas what?

  ---Krishna

-- 
Krishna Garikipati
University of Michigan
Mechanical Engineering, Michigan Center for Theoretical Physics
and Center for Computational Medicine & Bioinformatics
3003B EECS
Tel: +1-734-936-0414, Fax: +1-734-647-9379
[email-masked]
www-personal.umich.edu/~krishna

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 15 Oct 2009 10:06:38 +0100

> I suppose I am doing something wrong. Any ideas what?

You need to do

   source path/to/dolfin/dolfin.conf

Garth

---

From: Krishna Garikipati <[email-masked]>
Date: Thu, 15 Oct 2009 14:03:38 +0100

Continuing with the python demo:
I am now getting an error where it seems to expect to find ctypes.py in
.../FEniCS/build/lib/python2.6/site-packages/dolfin/

Here is the error message:$ python demo.py
Traceback (most recent call last):
  File "demo.py", line 20, in ?
    from dolfin import *
  File 
"/home/krishna/Work/FEniCS/build/lib/python2.6/site-packages/dolfin/__init__.py", 
line 6, in ?
    import dynamic_load_mpi
  File 
"/home/krishna/Work/FEniCS/build/lib/python2.6/site-packages/dolfin/dynamic_load_mpi.py", 
line 8, in ?
    import ctypes
ImportError: No module named ctypes

        ---Krishna

---

From: Harish Narayanan <[email-masked]>
Date: Thu, 15 Oct 2009 19:38:25 +0200

What python are you running? Do a

which python
python -V

after you source dolfin.conf.

Also, get into python and try to import ctypes.

python
import ctypes

Harish

---

From: Krishna Garikipati <[email-masked]>
Date: Thu, 15 Oct 2009 17:16:04 +0100

I had an older python version lying around. Got rid of that and now I have:
[krishna@aragorn dolfin-0.9.3]$ which python
~/Work/FEniCS/build/bin/python
[krishna@aragorn dolfin-0.9.3]$ python -V
Python 2.6.2

But now it needs the BOOST_DIR variable to be set:
OSError: The Boost library was not found.
If Boost is installed in a nonstandard location,
set the environment variable BOOST_DIR.

The boost lib/ and include/ directories have not been created yet. Is 
this to be done as
bjam install

from the ~/Work/FEniCS/boost_1_40_0/ directory?

 ---Krishna

---

From: Harish Narayanan <[email-masked]>
Date: Thu, 15 Oct 2009 22:50:28 +0200

> [krishna@aragorn dolfin-0.9.3]$ python -V

Good.

> set the environment variable BOOST_DIR.

If you used Dorsal to install everything, try

export BOOST_DIR=${HOME}/Work/FEniCS/build/

before you try running dolfin via python.

> from the ~/Work/FEniCS/boost_1_40_0/ directory?

Something like this, but you needn't be doing this manually.

Harish

---

From: Krishna Garikipati <[email-masked]>
Date: Thu, 15 Oct 2009 18:28:15 +0100

OK. That worked. Now I only have to fix viper and demo.py will run to 
completion.
Thanks!

 --Krishna

---

From: Harish Narayanan <[email-masked]>
Date: Fri, 16 Oct 2009 14:36:57 +0200

> OK. That worked. Now I only have to fix viper and demo.py will run to 

This may or may not be trivial given the state of getting VTK up and
running on your machine. Whatever the case, it is easy to output the
results to a file (which this demo does) and open it after the fact in
Paraview.

Harish