Error importing lsm
Hi there,
I am trying to run esys-particle directly from the flash drive in which it has been installed into. I am currently trying the first tutorial (bingle.py) but i am getting the error message below while trying to run it:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ cd /home/ubuntu/
ubuntu@
Traceback (most recent call last):
File "bingle.py", line 1, in <module>
from esys.lsm import *
File "/usr/local/
from .util import InstallInfo
File "/usr/local/
from esys.lsm.
ImportError: libFoundation-
ubuntu@
Please help me
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Qi Shao
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hi Temitope,
It looks like your path variables are not set correctly. Could you please post the output from the following 3 commands?
$ echo $LD_LIBRARY_PATH
$ ls /usr/local/
$ which esysparticle
Cheers,
Dion
Revision history for this message
|
#2 |
Hi Dion,
I did run the command. Please see the response below;
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ echo $LD_LIBRARY_PATH
ubuntu@ubuntu:~$ ls /usr/local/
/usr/local/
/usr/local/
ubuntu@ubuntu:~$ which esysparticle
/usr/local/
ubuntu@ubuntu:~$
Kind Regards
Tope
Revision history for this message
|
#3 |
Hi Tope,
Thanks for the reply. That confirms that your path variables are not set correctly.
There are two options to fix this. The first is temporary and the second should be permanent. I suggest you try option 1 first to ensure that this works. If so, then try option 2. Otherwise, reply with details of any further error messages.
Option 1:
=======
In the terminal where you wish to execute ESyS-Particle, type the following commands:
$ export PATH=/usr/
$ export LD_LIBRARY_
$ export LIBRARY_
$ export PYTHONPATH=
N.B. if you choose this option, you will need to type these commands each time you login.
Option 2:
=======
The option will permanently update your path variables so that ESyS-Particle will work each time you login. You need to use a text editor to modify a file called ~/.bashrc and add the lines above to the end of the file (without the leading '$' symbol). For example, using the 'gedit' text editor:
$ gedit ~/.bashrc
[add these lines to the end of the file then save and exit the text editor:]
export PATH=/usr/
export LD_LIBRARY_
export LIBRARY_
export PYTHONPATH=
Cheers,
Dion
Revision history for this message
|
#4 |
Hi Dion,
I did try option 1. It seems to work since i did not get any error message. However , i tried to work through the bingle.py tutorial. i stared getting this error from the third command (sim = LsmMpi(
Here is the message from the terminal:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ export PATH=/usr/
ubuntu@ubuntu:~$ export LD_LIBRARY_
ubuntu@ubuntu:~$ export LIBRARY_
ubuntu@ubuntu:~$ export PYTHONPATH=
ubuntu@ubuntu:~$ cd /home/ubuntu/
ubuntu@
*** The MPI_comm_size() function was called before MPI_INIT was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.
[ubuntu:2838] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!
ubuntu@
Regards
Tope
Revision history for this message
|
#5 |
Hi Tope,
Yes, the path problem looks to be fixed now.
Your current error message is because esys-particle scripts (like bingle.py) need to be executed with a particular command.
To test bingle.py, issue the following command:
$ mpirun -np 2 esysparticle bingle.py
The number after '-np' must equal one more than the number of worker processes i.e. Nw + 1. Since bingle.py only uses one worker process (see the LsmMpi command in the script), we must instruct mpirun to set up 2 threads, one for the master process and one for the worker process.
Assuming bingle.py now executes without another error message, I strongly suggest you carefully read and work through the examples in the ESyS-Particle Tutorial:
https:/
The Tutorial covers most of the basics for building and executing ESyS-Particle simulations, as well as some of the basics of DEM modelling.
Cheers,
Dion
Revision history for this message
|
#6 |
Thank you Dion,
I am working through the tutorial. After executing the command up to : sim = LsmMpi(
sim.initNeighbo
particleType=
gridSpacing=2.5,
verletDist=0.5
)
I got the following message, I seem not to understand what it means.
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ export PATH=/usr/
ubuntu@ubuntu:~$ export LD_LIBRARY_
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ export LIBRARY_
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ export PYTHONPATH=
ubuntu@ubuntu:~$ cd /home/ubuntu/
ubuntu@
WARNING:
=======
The use of 'mpipython' to execute ESyS-Particle simulations
WARNING:
=======
The use of 'mpipython' to execute ESyS-Particle simulations
is deprecated as of ESyS-Particle v2.2.
is deprecated as of ESyS-Particle v2.2.
Instead, use a commandline similar to:
Instead, use a commandline similar to:
mpirun -np 3 esysparticle myscript.py
Now executing: "esysparticle bingle.py"...
mpirun -np 3 esysparticle myscript.py
Now executing: "esysparticle bingle.py"...
CSubLatticeCont
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "bingle.py", line 7, in <module>
Revision history for this message
|
#7 |
Hi Tope,
The warning messages prior to "CSubLatticeCon
mpirun -np 2 /usr/local/
The 'mpipython' command is now deprecated and has been replaced with the 'esysparticle' command.
From your last post, it would appear that there is still a problem though. The last 2 lines of your post:
Traceback (most recent call last):
File "bingle.py", line 7, in <module>
appear to be the start of a Python error message. It is likely that there is a syntax/
Could you please re-run bingle.py with the 'esysparticle' command above then post all output following "Traceback"?
Also, please post the contents of your bingle.py script.
Cheers,
Dion
Revision history for this message
|
#8 |
Hi Dion,
I did execute the command (mpirun -np 2 /usr/local/
However, it seems i still have the argument error. Here is the message and the content of my bingle.py script.
Message:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ export PATH=/usr/
ubuntu@ubuntu:~$ export LD_LIBRARY_
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ export LIBRARY_
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ export PYTHONPATH=
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ cd /home/ubuntu/
ubuntu@
CSubLatticeCont
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "bingle.py", line 7, in <module>
verletDist=0.5
Boost.Python.
LsmMpi.
did not match C++ signature:
initNeighbo
Content of bingle.py script:
from esys.lsm import *
from esys.lsm.util import Vec3, BoundingBox
sim = LsmMpi(
sim.initNeighbo
ParticleType
gridSpacing=2.5,
verletDist=0.5
)
Kind Regards
Tope
Revision history for this message
|
#9 |
Hi Tope,
Try changing "ParticleType" to "particleType".
Python is case-sensitive so I think the capital letter 'P' is causing the error in this case.
Cheers,
Dion
Revision history for this message
|
#10 |
Hi Dion,
It's now working.
Thank you.
Revision history for this message
|
#11 |
Superb! Have fun Tope!
Dion
Revision history for this message
|
#12 |
Hi Dion,
I am currently working on a computer installed with ubuntu. I tried some of the previous steps you suggested while trying to run from a flash drive. Below is the response that I got: I do not know what to do from here. please help. Is there any other easy way to run it since i have downloaded the latest version of Esysparticle and will be running directly on an ubuntu computer.
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
The program 'mpirun' can be found in the following packages:
* lam-runtime
* mpich
* openmpi-bin
Try: sudo apt-get install <selected package>
adminuser@
Revision history for this message
|
#13 |
Hi Temitope,
Dion asked me to assist you with your questions. It seems that ESyS-Particle has not been installed correctly in your system. Did you follow the instructions shown in the following link to install ESyS-Particle?
https:/
You can check whether EsyS-Particle is installed via the following command:
$ which esysparticle
Some mandatory dependencies are also required to be pre-installed prior to building EsyS-Particle. To find out whether they are installed in your system, please use the following commands:
$ dpkg -l |grep openmpi
$ dpkg -l |grep libboost
Could you please post the output from above-mentioned commands?
Cheers,
Qi
Revision history for this message
|
#14 |
Hi Qi,
I tried the installation intruction from the link and also executed the two commands you gave me. Here is what i got:
adminuser@
[sudo] password for adminuser:
Sorry, try again.
[sudo] password for adminuser:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
build-essential set to manually installed.
The following extra packages will be installed:
autoconf autotools-dev libjs-jquery libltdl-dev libsigsegv2 m4 python-bzrlib
python-configobj python-gpgme python-keyring python-launchpadlib
python-
python-simplejson python-wadllib
Suggested packages:
autoconf-archive gnu-standards autoconf-doc bzr-doc bzrtools
python-
fortran95-
python-pycurl python-
python-keyczar python-
The following NEW packages will be installed:
autoconf automake autotools-dev bzr libjs-jquery libltdl-dev libsigsegv2
libtool m4 python-bzrlib python-configobj python-gpgme python-keyring
python-
python-
0 upgraded, 20 newly installed, 0 to remove and 255 not upgraded.
Need to get 3,244 kB of archives.
After this operation, 16.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Get:12 http://
Get:13 http://
Get:14 http://
Get:15 http://
Get:16 http://
Get:17 http://
Get:18 http://
Get:19 http://
Get:20 http://
Fetched 3,244 kB in 4s (665 kB/s)
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 175380 files and directories currently installed.)
Preparing to unpack .../libsigsegv2
Unpacking libsigsegv2:amd64 (2.10-4) ...
Selecting previously unselected package m4.
Preparing to unpack .../archives/
Unpacking m4 (1.4.17-4) ...
Selecting previously unselected package autoconf.
Preparing to unpack .../autoconf_
Unpacking autoconf (2.69-8) ...
Selecting previously unselected package autotools-dev.
Preparing to unpack .../autotools-
Unpacking autotools-dev (20140911.1) ...
Selecting previously unselected package automake.
Preparing to unpack .../automake_
Unpacking automake (1:1.15-1ubuntu1) ...
Selecting previously unselected package python-configobj.
Preparing to unpack .../python-
Unpacking python-configobj (5.0.6-2) ...
Selecting previously unselected package python-bzrlib.
Preparing to unpack .../python-
Unpacking python-bzrlib (2.6.0+
Selecting previously unselected package bzr.
Preparing to unpack .../bzr_
Unpacking bzr (2.6.0+
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../libjs-
Unpacking libjs-jquery (1.7.2+
Selecting previously unselected package libltdl-dev:amd64.
Preparing to unpack .../libltdl-
Unpacking libltdl-dev:amd64 (2.4.2-1.11) ...
Selecting previously unselected package libtool.
Preparing to unpack .../libtool_
Unpacking libtool (2.4.2-1.11) ...
Selecting previously unselected package python-gpgme.
Preparing to unpack .../python-
Unpacking python-gpgme (0.3-1build1) ...
Selecting previously unselected package python-keyring.
Preparing to unpack .../python-
Unpacking python-keyring (4.0-1ubuntu1) ...
Selecting previously unselected package python-lazr.uri.
Preparing to unpack .../python-
Unpacking python-lazr.uri (1.0.3-2build1) ...
Selecting previously unselected package python-simplejson.
Preparing to unpack .../python-
Unpacking python-simplejson (3.7.3-1ubuntu1) ...
Selecting previously unselected package python-wadllib.
Preparing to unpack .../python-
Unpacking python-wadllib (1.3.2-3) ...
Selecting previously unselected package python-oauth.
Preparing to unpack .../python-
Unpacking python-oauth (1.0.1-4) ...
Selecting previously unselected package python-
Preparing to unpack .../python-
Unpacking python-
Selecting previously unselected package python-
Preparing to unpack .../python-
Unpacking python-launchpadlib (1.10.3-2ubuntu1) ...
Selecting previously unselected package python-
Preparing to unpack .../python-
Unpacking python-
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for install-info (6.0.0.dfsg.1-3) ...
Processing triggers for doc-base (0.10.6) ...
Processing 1 added doc-base file...
Setting up libsigsegv2:amd64 (2.10-4) ...
Setting up m4 (1.4.17-4) ...
Setting up autoconf (2.69-8) ...
Setting up autotools-dev (20140911.1) ...
Setting up automake (1:1.15-1ubuntu1) ...
update-
Setting up python-configobj (5.0.6-2) ...
Setting up python-bzrlib (2.6.0+
Setting up bzr (2.6.0+
Setting up libjs-jquery (1.7.2+
Setting up libltdl-dev:amd64 (2.4.2-1.11) ...
Setting up libtool (2.4.2-1.11) ...
Setting up python-gpgme (0.3-1build1) ...
Setting up python-keyring (4.0-1ubuntu1) ...
Setting up python-lazr.uri (1.0.3-2build1) ...
Setting up python-simplejson (3.7.3-1ubuntu1) ...
Setting up python-wadllib (1.3.2-3) ...
Setting up python-oauth (1.0.1-4) ...
Setting up python-
Setting up python-launchpadlib (1.10.3-2ubuntu1) ...
Setting up python-
Processing triggers for libc-bin (2.21-0ubuntu4) ...
adminuser@
adminuser@
adminuser@
ii libboost-
ii libboost-
ii libboost-
ii libboost-
adminuser@
Kind Regards
Revision history for this message
|
#15 |
Hi Temitope,
It seems that openmpi has not been installed in your system. This video explains how to install openmpi step by step:
https:/
Please install openmpi and then build ESyS-Particle following the instruction. Let me know if there is any issue.
Cheers,
Qi
Revision history for this message
|
#16 |
Hi Temitope,
I just noticed that you have not completed all the steps shown in the FAQ (installation instruction), except for the first step "sudo apt-get install libtool automake build-essential bzr". Please disregard my last reply, and go through all the steps shown below (selectively copied from the FAQ). Let you know if you have difficulties in any of these steps.
2) Install MANDATORY dependencies:
sudo apt-get install libtool automake build-essential bzr
sudo apt-get install mpi-default-bin mpi-default-dev libboost-all-dev
5) Configure bazaar:
5a) bzr whoami "Your Name <email address hidden>"
5b) ssh-keygen -t rsa
5c) upload the public key to launchpad -- instructions are available here:
https:/
5d) bzr launchpad-login launchpad-username
6) Obtain and install the latest development version of ESyS-Particle:
bzr co lp:esys-particle
sh autogen.sh
./configure CC=mpicc CXX=mpic++
make
sudo make install
7) Set up environment variables
export PATH=/usr/
export LD_LIBRARY_
export LIBRARY_
export PYTHONPATH=
[OPTIONALLY, append these 'export' lines to the end of ~/.bashrc]
8) run a test script e.g. bingle_output.py from the ESyS-Particle Tutorial
mpirun -np 2 esysparticle bingle_output.py
Revision history for this message
|
#17 |
Hi Qi,
I encountered the following message from ((5c) uploading the public key to launchpad) of the instruction you gave:
dminuser@
[sudo] password for adminuser:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
libpam-ssh keychain monkeysphere
The following packages will be upgraded:
openssh-client
1 upgraded, 0 newly installed, 0 to remove and 252 not upgraded.
Need to get 604 kB of archives.
After this operation, 9,216 B of additional disk space will be used.
Get:1 http://
Fetched 604 kB in 1s (334 kB/s)
(Reading database ... 190357 files and directories currently installed.)
Preparing to unpack .../openssh-
Unpacking openssh-client (1:6.9p1-
Processing triggers for man-db (2.7.4-1) ...
Setting up openssh-client (1:6.9p1-
adminuser@
Generating public/private rsa key pair.
Enter file in which to save the key (/home/
/home/adminuser
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/adminuser
Your public key has been saved in /home/adminuser
The key fingerprint is:
SHA256:
The key's randomart image is:
+---[RSA 2048]----+
|=@Xo==.o= |
|=B*=ooE. = . |
|=++o.oo . + |
|+..+. o + |
|... S + |
| * |
| . . |
| + |
| o |
+----[SHA256]-----+
adminuser@
Revision history for this message
|
#18 |
Additional info:
I tried to run the id_rsa file but permission was denied. I'm not sure if this was initially created. Please see the response below:
adminuser@
bash: /.ssh/id_rsa: No such file or directory
adminuser@
bash: /home/adminuser
adminuser@
3144: command not found
adminuser@
/path/to/
adminuser@
bash: /home/adminuser
adminuser@
Revision history for this message
|
#19 |
Hi Temitope,
Instead of running the id_rsa.pub file, you will need to open this file in a text editor and copy & paste its contents to your SSH keys page. You can get its contents using the command:
cat ~/.ssh/id_rsa.pub
Then follow the instructions shown by link in (5c) to import your public key to launchpad.
Alternatively, you can download the source-code tarball from:
https:/
Unzip the tarball file and then continue with step 6).
Cheers,
Qi
Revision history for this message
|
#20 |
Hi Qi,
I did access the content and followed the instruction to upload my SSH public key which was successfully added. The error for step 5d is :
adminuser@
bzr: ERROR: The user name launchpad-username is not registered on Launchpad.
adminuser@
Revision history for this message
|
#21 |
Hi Temitope,
Please make sure the username you typed in is consistent with the one you registered on LaunchPad. Actually you do not need to log in to download the code. Just use the following command to get a copy of the branch:
bzr branch lp:esys-particle
Cheers,
Qi
Revision history for this message
|
#22 |
Hi Temitope,
When you issue this command:
$ bzr launchpad-login launchpad-username
you need to replace the word "launchpad-
$ bzr launchpad-login temitope
After that command is successful (no error message), you can continue with the remaining installation instructions in the FAQ.
Cheers,
Dion
Revision history for this message
|
#23 |
Hi Dion and Qi,
I was able to log with with the correct user name "temitope"
In step 6, only the first line of the command could be executed in the terminal. here is the message below together with the error message:
adminuser@
adminuser@
The authenticity of host 'bazaar.
RSA key fingerprint is SHA256:
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bazaar.
Permission denied (publickey).
ConnectionReset reading response for 'BzrDir.open_2.1', retrying
Permission denied (publickey).
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
adminuser@
Revision history for this message
|
#24 |
Hi Temitope,
It might because you have not successfully registered your key with Launchpad. You can visit your SSH keys page at https:/
As I said, if you have trouble with bazaar and just want to install ESyS-Particle as soon as possible, you can always download the source-code tarball for installation.
Cheers,
Qi
Revision history for this message
|
#25 |
Hi Qi,
I checked the SSH key page and i found that it was successful and i did try to re-register it again which was also successful. i got a confirmatory email. I continued with step 6 and i got the same error message as shown below:adminuser
ssh-rsa AAAAB3NzaC1yc2E
adminuser@
adminuser@
Permission denied (publickey).
ConnectionReset reading response for 'BzrDir.open_2.1', retrying
Permission denied (publickey).
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
adminuser@
I also went through the alternative route of downloading the source-code tarball for installation, unzipped the folder and continued with step 6. but i also got the same error as shown below:
adminuser@
Permission denied (publickey).
ConnectionReset reading response for 'BzrDir.open_2.1', retrying
Permission denied (publickey).
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
adminuser@
Regards
Tope
Revision history for this message
|
#26 |
Hi Tope,
Sorry but I am not quite sure why you still have the ‘’Permission denied (publickey)" problem after you have successfully regestered your SSH key. I hope Dion or other users can answer this question for you.
However, I may be able to assist you with intalling ESyS-Particle from the source-code tarball. After extracting files from the downloaded tarball, proceed with the following procedures:
cd ESyS-Particle-2.3.5
sh autogen.sh
./configure CC=mpicc CXX=mpic++
make
sudo make install
7) Set up environment variables
export PATH=/usr/
export LD_LIBRARY_
export LIBRARY_
export PYTHONPATH=
[OPTIONALLY, append these 'export' lines to the end of ~/.bashrc]
8) run a test script e.g. bingle_output.py from the ESyS-Particle Tutorial
mpirun -np 2 esysparticle bingle_output.py
Cheers,
QI