openbsd installation FoundationPy

Asked by Patrick Carr

I have a new installation on openbsd (5.1); everything went smoothly except I had to set -DMPIl=M_PI (side question: will the error be significant?). When I try the first script in the tutorial, I get:

   galena 07:05:31 $ mpirun -np 1 esysparticle test.py
   Traceback (most recent call last):
     File "test.py", line 1, in <module>
       from esys.lsm import *
     File "/usr/local/lib/python2.7/site-packages/esys/lsm/__init__.py", line 15, in <module>
       from util import InstallInfo
     File "/usr/local/lib/python2.7/site-packages/esys/lsm/util/__init__.py", line 13, in <module>
       from FoundationPy import *
   ImportError: No module named FoundationPy

There are FoundationPy libraries in esys/lsm/util/, but no FoundationPy.py there or in the source. Did I do something wrong in the installation? Am I missing some other third-party module?

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Vince Boros
Solved:
Last query:
Last reply:
Revision history for this message
Dion Weatherley (d-weatherley) said :
#1

Hi Patrick,

Nice to know that ESyS-Particle can be installed on BSD. I doubt the M_PI error will be a problem.

Regarding the import error, I'm not familar with BSD but on linux I would be checking that my PYTHONPATH environment variable has been set correctly e.g.

export PYTHONPATH=/path/to/esys/install/lib/python2.7/dist-packages:$PYTHONPATH

Cheers,

Dion.

Revision history for this message
Patrick Carr (pmc1) said :
#2

Thanks for replying, Dion. Forgive me for not mentioning it, but I did try several variations on PYTHONPATHs without success (and just did it again). And the FoundationPy compiled libraries are in the same directory as the __init__.py which is trying to import them, so it's finding it to that point. I'm afraid I don't know enough about python to completely understand how it imports binary libraries as opposed to python code; could it be as simple as an incompatibility in libtool (I have 2.4.2)?

Revision history for this message
Feng Chen (fchen3-gmail) said :
#3

Hi Patrick:

I am not sure how BSD handle boost python, however you might need to check if libboost-python are also in PYTHONPATH, that is also necessary for the whole thing to work.

Feng

Revision history for this message
Vince Boros (v-boros) said :
#4

Hello Patrick:

There is not meant to be a Python file for FoundationPy, and there should be no difficulty for Python to import the FoundationPy library from the same folder that it found esys.lsm.util's __init__.py. If you are still having trouble, send me the contents of /usr/local/lib/python2.7/site-packages/esys/lsm/util/FoundationPy.la. And can you verify that the library name is in fact FoundationPy.so? I am also curious to know the names of your Boost libraries (libboost*, probably under /usr/lib/, or /usr/local/lib/). Finally, can you send me the configuration line you used before building ESyS-Particle?

Vince

Revision history for this message
Patrick Carr (pmc1) said :
#5

Hi Vince,

I'm not sure if there's a way to attach files; if there is delete this and I'll redo it. Otherwise, the answers are below in order, and I've delineated the longer answers. I have also tried updating the openbsd packages, reinstalling, and running various variations on `libtool finish`, but I still get the same error.

Thanks!

----- esys/lsm/util/FoundationPy.la -----

# FoundationPy.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='FoundationPy.so.0.0'

# Names of this library.
library_names='FoundationPy.so.0.0 FoundationPy.so.0.0'

# The name of the static archive.
old_library='FoundationPy.a'

# Libraries that this one depends upon.
dependency_libs=' /usr/local/lib/python2.7/site-packages/esys/lsm/util/libFoundationPy.la -L/usr/lib /usr/local/lib/libFoundation.la -lboost_filesystem-mt -lboost_system-mt /usr/local/lib/libBoostPythonUtil.la -lboost_python-mt -lpython2.7'

# Version information for FoundationPy.
current=0
age=0
revision=0

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=yes

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/local/lib/python2.7/site-packages/esys/lsm/util'
~
----- FoundationPy.la -----

The three FoundationPy.* files in that directory are .a, .la, and .so.0.0, which matches the contents in .la, I think.

----- boost files -----

galena 20:44:43 $ ls /usr/local/lib/*boost*
/usr/local/lib/libboost_date_time-mt.a
/usr/local/lib/libboost_date_time-mt.so.2.0
/usr/local/lib/libboost_date_time-mt.so.4.0
/usr/local/lib/libboost_date_time.a
/usr/local/lib/libboost_date_time.so.2.0
/usr/local/lib/libboost_date_time.so.4.0
/usr/local/lib/libboost_filesystem-mt.a
/usr/local/lib/libboost_filesystem-mt.so.2.0
/usr/local/lib/libboost_filesystem-mt.so.4.0
/usr/local/lib/libboost_filesystem.a
/usr/local/lib/libboost_filesystem.so.2.0
/usr/local/lib/libboost_filesystem.so.4.0
/usr/local/lib/libboost_graph-mt.a
/usr/local/lib/libboost_graph-mt.so.2.0
/usr/local/lib/libboost_graph-mt.so.4.0
/usr/local/lib/libboost_graph.a
/usr/local/lib/libboost_graph.so.2.0
/usr/local/lib/libboost_graph.so.4.0
/usr/local/lib/libboost_iostreams-mt.a
/usr/local/lib/libboost_iostreams-mt.so.2.0
/usr/local/lib/libboost_iostreams-mt.so.4.0
/usr/local/lib/libboost_iostreams.a
/usr/local/lib/libboost_iostreams.so.2.0
/usr/local/lib/libboost_iostreams.so.4.0
/usr/local/lib/libboost_math_c99-mt.a
/usr/local/lib/libboost_math_c99-mt.so.2.0
/usr/local/lib/libboost_math_c99-mt.so.4.0
/usr/local/lib/libboost_math_c99.a
/usr/local/lib/libboost_math_c99.so.2.0
/usr/local/lib/libboost_math_c99.so.4.0
/usr/local/lib/libboost_math_c99f-mt.a
/usr/local/lib/libboost_math_c99f-mt.so.2.0
/usr/local/lib/libboost_math_c99f-mt.so.4.0
/usr/local/lib/libboost_math_c99f.a
/usr/local/lib/libboost_math_c99f.so.2.0
/usr/local/lib/libboost_math_c99f.so.4.0
/usr/local/lib/libboost_math_c99l-mt.a
/usr/local/lib/libboost_math_c99l-mt.so.2.0
/usr/local/lib/libboost_math_c99l-mt.so.4.0
/usr/local/lib/libboost_math_c99l.a
/usr/local/lib/libboost_math_c99l.so.2.0
/usr/local/lib/libboost_math_c99l.so.4.0
/usr/local/lib/libboost_math_tr1-mt.a
/usr/local/lib/libboost_math_tr1-mt.so.2.0
/usr/local/lib/libboost_math_tr1-mt.so.4.0
/usr/local/lib/libboost_math_tr1.a
/usr/local/lib/libboost_math_tr1.so.2.0
/usr/local/lib/libboost_math_tr1.so.4.0
/usr/local/lib/libboost_math_tr1f-mt.a
/usr/local/lib/libboost_math_tr1f-mt.so.2.0
/usr/local/lib/libboost_math_tr1f-mt.so.4.0
/usr/local/lib/libboost_math_tr1f.a
/usr/local/lib/libboost_math_tr1f.so.2.0
/usr/local/lib/libboost_math_tr1f.so.4.0
/usr/local/lib/libboost_math_tr1l-mt.a
/usr/local/lib/libboost_math_tr1l-mt.so.2.0
/usr/local/lib/libboost_math_tr1l-mt.so.4.0
/usr/local/lib/libboost_math_tr1l.a
/usr/local/lib/libboost_math_tr1l.so.2.0
/usr/local/lib/libboost_math_tr1l.so.4.0
/usr/local/lib/libboost_prg_exec_monitor-mt.a
/usr/local/lib/libboost_prg_exec_monitor-mt.so.2.0
/usr/local/lib/libboost_prg_exec_monitor-mt.so.4.0
/usr/local/lib/libboost_prg_exec_monitor.a
/usr/local/lib/libboost_prg_exec_monitor.so.2.0
/usr/local/lib/libboost_prg_exec_monitor.so.4.0
/usr/local/lib/libboost_program_options-mt.a
/usr/local/lib/libboost_program_options-mt.so.2.0
/usr/local/lib/libboost_program_options-mt.so.4.0
/usr/local/lib/libboost_program_options.a
/usr/local/lib/libboost_program_options.so.2.0
/usr/local/lib/libboost_program_options.so.4.0
/usr/local/lib/libboost_python-mt.a
/usr/local/lib/libboost_python-mt.so.2.0
/usr/local/lib/libboost_python-mt.so.4.0
/usr/local/lib/libboost_python.a
/usr/local/lib/libboost_python.so.2.0
/usr/local/lib/libboost_python.so.4.0
/usr/local/lib/libboost_regex-mt.a
/usr/local/lib/libboost_regex-mt.so.2.0
/usr/local/lib/libboost_regex-mt.so.4.0
/usr/local/lib/libboost_regex.a
/usr/local/lib/libboost_regex.so.2.0
/usr/local/lib/libboost_regex.so.4.0
/usr/local/lib/libboost_serialization-mt.a
/usr/local/lib/libboost_serialization-mt.so.2.0
/usr/local/lib/libboost_serialization-mt.so.4.0
/usr/local/lib/libboost_serialization.a
/usr/local/lib/libboost_serialization.so.2.0
/usr/local/lib/libboost_serialization.so.4.0
/usr/local/lib/libboost_signals-mt.a
/usr/local/lib/libboost_signals-mt.so.2.0
/usr/local/lib/libboost_signals-mt.so.4.0
/usr/local/lib/libboost_signals.a
/usr/local/lib/libboost_signals.so.2.0
/usr/local/lib/libboost_signals.so.4.0
/usr/local/lib/libboost_system-mt.a
/usr/local/lib/libboost_system-mt.so.2.0
/usr/local/lib/libboost_system-mt.so.4.0
/usr/local/lib/libboost_system.a
/usr/local/lib/libboost_system.so.2.0
/usr/local/lib/libboost_system.so.4.0
/usr/local/lib/libboost_test_exec_monitor-mt.a
/usr/local/lib/libboost_test_exec_monitor.a
/usr/local/lib/libboost_thread-mt.a
/usr/local/lib/libboost_thread-mt.so.2.0
/usr/local/lib/libboost_thread-mt.so.4.0
/usr/local/lib/libboost_unit_test_framework-mt.a
/usr/local/lib/libboost_unit_test_framework-mt.so.2.0
/usr/local/lib/libboost_unit_test_framework-mt.so.4.0
/usr/local/lib/libboost_unit_test_framework.a
/usr/local/lib/libboost_unit_test_framework.so.2.0
/usr/local/lib/libboost_unit_test_framework.so.4.0
/usr/local/lib/libboost_wave-mt.a
/usr/local/lib/libboost_wave-mt.so.2.0
/usr/local/lib/libboost_wave-mt.so.4.0
/usr/local/lib/libboost_wave.a
/usr/local/lib/libboost_wave.so.2.0
/usr/local/lib/libboost_wave.so.4.0
/usr/local/lib/libboost_wserialization-mt.a
/usr/local/lib/libboost_wserialization-mt.so.2.0
/usr/local/lib/libboost_wserialization-mt.so.4.0
/usr/local/lib/libboost_wserialization.a
/usr/local/lib/libboost_wserialization.so.2.0
/usr/local/lib/libboost_wserialization.so.4.0

----- boost files -----

It was created by ESyS-Particle configure 2.2, which was
generated by GNU Autoconf 2.68. Invocation command line was

  $ ./configure CC=mpicc CXX=mpic++ CXXFLAGS=-DM_PIl=M_PI

Revision history for this message
Dion Weatherley (d-weatherley) said :
#6

Hi Patrick,

This is proving to be a tricky problem!

I just now noticed that the command you are using to run the test script is slightly incorrect. It should be:
mpirun -np 2 esysparticle test.py

ESyS-Particle always requires N+1 MPI processes where N is the number of workers/subdomains and the extra 1 is the master process.

Unfortunately I doubt that fixing this is going to solve your problem though...over to Vince again.

Cheers,

Dion

Revision history for this message
Patrick Carr (pmc1) said :
#7

Dion,

Correct; I had initially tried to run it on two nodes and the '-np 1' was just an attempt at simplification. I don't have anything better to add.

Thanks!

Revision history for this message
Best Vince Boros (v-boros) said :
#8

Hello Patrick:

I am concerned that all of your shared object files have a version extension. I think that Python needs a .so extension. At least, when i delete FoundationPy.so on my system (which is a link to FoundationPy.so.0.0.0), i get the same import error that you have been getting.

In Python/esys/lsm/util/ create a link to FoundationPy.so.0.0 called FoundationPy.so. Then, also in Python/esys/lsm/util/, run "python" and at the Python prompt import the contents of FoundationPy.so: "from FoundationPy import *". If this works, then your test script should get past the immediate hurdle (although you will need to similarly create a libFoundationPy.so link).

Vince

Revision history for this message
Patrick Carr (pmc1) said :
#9

Hi Vince,

That did the trick! Thanks!

Pat

Revision history for this message
Patrick Carr (pmc1) said :
#10

Thanks Vince Boros, that solved my question.

Revision history for this message
Vince Boros (v-boros) said :
#11

Hi Pat:

Good. But there are more ESyS-Particle libraries that need .so links in order to exploit the full potential of the code. Of course you can create the links manually, but much better to work out how to get the Autotools on BSD Unix to generate them. They should be generated automatically as on our Linux systems, but currently I don't know why they are not.

Vince