Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 20/09/2011, à 13:14

petertosh

installation ok mais le logiciel ne trouve pas les librairies

Bonjour,
J'ais besoin d'installer un logiciel particulier qui nécéssite l'instalation de sundials et de pysundials (http://pysundials.sourceforge.net/).

Tout va bien, l'installation se passe bien mais lorsque j'utilise mon logiciel (qui fonctionne en language python), celui-ci doit faire appel aux librairies pysundials.
Pysundials doit lui se référer aux librairies sundials pour fonctionner (j'espère que je suis clair wink )

Seulement j'obtiens un message d'erreur quand je veux faire appel à pysundials:

PySundials is not installed or did not import correctly
/usr/local/lib/python2.6/dist-packages/pysundials/libsundials_core_aux.so: cannot open shared object file: No such file or directory
Cannot load shared library /usr/local/lib/python2.6/dist-packages/pysundials/libsundials_core_aux.so. Please check you config file and ensure the paths to the shared libraries are correct.

J'ais suivis les recommandations de configuration pour pouvoir faire appel à cette librairie mais sans succès:

PySUNDIALS uses ctypes to link the required SUNDIALS libraries directly into the running python process. In order to do this, it needs to know where to find those shared libraries. On Linux/BSD systems, this is usually auto detected, as library locations are standard, however on windows systems, the final location and even naming convention of the shared library files is compiler dependent. If PySUNDIALS cannot find the SUNDIALS libraries, please locate them yourself, and specify their locations in a file named ~/.pysundials/config (Linux/BSD), or %HOMEPATH%\pysundials\config (Windows). If PySUNDIALS cannot find this configuration file in your home directory, it will seek it in the same directory it was installed in, i.e. $PYTHONROOT/site-packages/pysundials/config

In the 'config' file, anything following a hash (including the hash itself) is considered a comment. Each line specifies the location of a required library in the form library = path, where library is one of 'c', 'aux', 'nvecserial', 'nvecparallel' 'cvode', 'cvodes', 'ida', or 'kinsol', and path is the complete path of the appropriate library file. 'c', 'aux', and 'nvecparallel' are optional; the first two being generally autodetected, and the second only required if you will be using pysundials in parallel with MPI.

You can find a sample config file for both posix and mingw32 systems in the doc subdirectory of the PySUNDIALS distribution.

Peut être que vous pouriez me venir en aide?

Merci pour votre aide

Dernière modification par petertosh (Le 20/09/2011, à 18:15)

Hors ligne

#2 Le 20/09/2011, à 13:23

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

Tu as installé les paquets sundials & cie?
http://packages.ubuntu.com/source/maverick/sundials
Enfin j'imagine que tu as commencé par faire un
sudo apt-get install sundials pysundials
mais je demande quand même au cas où...

Dernière modification par Nemesis (Le 20/09/2011, à 13:23)

Hors ligne

#3 Le 20/09/2011, à 15:16

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Je suis sous Debian, il y avait des dépendances que je n'arrivais pas à satisfaire sous Ubuntu. En fouillant un peu sur le net, certaines personnes avaient le même soucis que moi sous Ubuntu mais pas sous Debian.
J'ai donc installé sundials puis pysundials à partir des sources, tout fonctionne bien sauf le lien entre sundials et pysundials. J'ais bien vérifié que les paquets suivants étaient bien installés:

libsundials-cvode0
ordinary differentialequation solver (SUNDIALS library)
libsundials-cvodes1
ODE solver with sensistivity analysis (SUNDIALS library)
libsundials-ida1
differential-algebraic system solver (SUNDIALS library)
libsundials-kinsol0
KINSOL solver (SUNDIALS library)
libsundials-nvecserial0
vector operations library (SUNDIALS library)
libsundials-serial
SUit of Nonlinear and DIfferential/ALgebraic equation Solvers
libsundials-serial-dev
SUNDIALS development files
libsundials-serial-doc
SUNDIALS documentation file

s
Voici le message d'erreur quand sous le prompt python je lance la commande

from pysundials import cvode

:

OSError                                   Traceback (most recent call last)

/home/tonio/Pysces/<ipython console> in <module>()

/usr/local/lib/python2.6/dist-packages/pysundials/cvode.py in <module>()
     38
     39 import ctypes
---> 40 import sundials_core
     41 import nvecserial
     42

/usr/local/lib/python2.6/dist-packages/pysundials/sundials_core.py in <module>()
     86 f.close()
     87
---> 88 libc = loadlib("c")
     89 try:
     90         libc.fdopen.argtypes = [ctypes.c_int, ctypes.c_int]

/usr/local/lib/python2.6/dist-packages/pysundials/sundials_core.py in loadlib(libname)
     62                 lib = ctypes.CDLL(libpaths[libname])
     63         except OSError, e:
---> 64                 raise OSError("%s\nCannot load shared library %s. Please check you config file and ensure the paths to the shared libraries are correct."%(e, libpaths[libname]))
     65         return lib
     66

OSError: /usr/local/lib: cannot read file data: Is a directory
Cannot load shared library /usr/local/lib. Please check you config file and ensure the paths to the shared libraries are correct.

Je suppose que l'erreur provient de ce que je vous ais mis en violet mais je ne sais aps comment y remédier.

En tout cas merci de ton aide

Hors ligne

#4 Le 20/09/2011, à 15:26

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Pour info, voici mon fichier config:

cvode = /usr/local/lib/libsundials_cvode.la
nvecserial = /usr/local/lib/libsundials_nvecserial.la
cvodes = /usr/local/lib/libsundials_cvodes.la
ida = /usr/local/lib/libsundials_ida.la
idas = /usr/local/lib/libsundials_idas.la
kinsol = /usr/local/lib/libsundials_kinsol.la

nvecparallel = /usr/local/lib/
aux = /usr/local/lib
c = /usr/local/lib

Hors ligne

#5 Le 20/09/2011, à 15:34

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

A force de tatonner j'avance un peu. Il semnblerait que ce soit le lien avec la librairie "c" qui ne soit pas bon. Je vais voir si c'est ça ou si je me plante encore une fois big_smile

Dernière modification par petertosh (Le 20/09/2011, à 16:00)

Hors ligne

#6 Le 20/09/2011, à 17:59

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Alors,
J'ai installer ubuntu pour tester ce que tu me disais. Tout s'installe très bien mais j'ai le même soucis.

Couldn't find pysundials config file at /usr/local/lib/python2.7/dist-packages/pysundials/config. Please create one, and point it to the appropriate library files

Donc il faut que j'arrive à créer un fichier config avec les liens vers les bonnes librairies, mais comment faire?

Merci encore

Hors ligne

#7 Le 20/09/2011, à 18:10

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

"In the 'config' file, anything following a hash (including the hash itself) is considered a comment. Each line specifies the location of a required library in the form library = path, where library is one of 'c', 'aux', 'nvecserial', 'nvecparallel' 'cvode', 'cvodes', 'ida', or 'kinsol', and path is the complete path of the appropriate library file. 'c', 'aux', and 'nvecparallel' are optional; the first two being generally autodetected, and the second only required if you will be using pysundials in parallel with MPI.

You can find a sample config file for both posix and mingw32 systems in the doc subdirectory of the PySUNDIALS distribution. "

Y'a un exemple apparemment dans le répertoire de la doc...

Hors ligne

#8 Le 20/09/2011, à 18:32

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Merci de ton aide,
J'étais passé à côté du fichier...
Je viens de tester, copier/coller le fichier en le renomant config mais le problème perciste. Je suis vraiment paumé là sad

Hors ligne

#9 Le 20/09/2011, à 19:05

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

y'a quoi dans le fichier?

Hors ligne

#10 Le 21/09/2011, à 09:04

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Il y a le lien vers les librairies:

nvecserial = /usr/local/lib/libsundials_nvecserial
cvode = /usr/local/lib/libsundials_cvode
cvodes = /usr/local/lib/libsundials_cvodes
ida = /usr/local/lib/libsundials_ida
kinsol = /usr/local/lib/libsundials_kinsol

Hors ligne

#11 Le 21/09/2011, à 10:37

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

Tous les fichiers référencés existent?

ls -l /usr/local/lib/libsundials_nvecserial
ls -l /usr/local/lib/libsundials_cvode
ls -l /usr/local/lib/libsundials_cvodes
ls -l /usr/local/lib/libsundials_ida
ls -l /usr/local/lib/libsundials_kinsol

ne renvoit aucune erreur?

Hors ligne

#12 Le 21/09/2011, à 11:33

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Tous les fichiers semblent bien présents:

tonio@bavo-mdebf039:~$ ls -l /usr/local/lib/libsundials_nvecserial
lrwxrwxrwx 1 root staff 28 20 sept. 17:37 /usr/local/lib/libsundials_nvecserial -> libsundials_nvecserial.0.0.1
tonio@bavo-mdebf039:~$ ls -l /usr/local/lib/libsundials_cvode
lrwxrwxrwx 1 root staff 23 20 sept. 17:37 /usr/local/lib/libsundials_cvode -> libsundials_cvode.0.0.1
tonio@bavo-mdebf039:~$ ls -l /usr/local/lib/libsundials_cvodes
lrwxrwxrwx 1 root staff 24 20 sept. 17:37 /usr/local/lib/libsundials_cvodes -> libsundials_cvodes.1.0.0
tonio@bavo-mdebf039:~$ ls -l /usr/local/lib/libsundials_ida
lrwxrwxrwx 1 root staff 21 20 sept. 17:37 /usr/local/lib/libsundials_ida -> libsundials_ida.1.0.0
tonio@bavo-mdebf039:~$ ls -l /usr/local/lib/libsundials_kinsol
lrwxrwxrwx 1 root staff 24 20 sept. 17:37 /usr/local/lib/libsundials_kinsol -> libsundials_kinsol.0.0.1

Hors ligne

#13 Le 21/09/2011, à 12:21

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

C'est quoi les messages d'erreur?

D'ailleurs vis à vis de ton premier de fichier de conf, je n'avais pas vu l'erreur suivante:
OSError: /usr/local/lib: cannot read file data: Is a directory
Cannot load shared library /usr/local/lib. Please check you config file and ensure the paths to the shared libraries are correct.

-> Y'avait surement un des trois là qui n'étaient pas bon et auraient du pointer vers un fichier et non un dossier:
nvecparallel = /usr/local/lib/
aux = /usr/local/lib
c = /usr/local/lib

Hors ligne

#14 Le 21/09/2011, à 14:18

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Je reviens vers toi et je rectifie quelque chose.
La commande

ls -l /usr/local/lib/libsundials_nvecserial
ls -l /usr/local/lib/libsundials_cvode
ls -l /usr/local/lib/libsundials_cvodes
ls -l /usr/local/lib/libsundials_ida
ls -l /usr/local/lib/libsundials_kinsol

me renvoit les réponses suivants sous mon installation de Ubuntu:

tonio@tonio-VirtualBox:~$ ls -l /usr/local/lib/libsundials_nvecserial
ls: impossible d'accéder à /usr/local/lib/libsundials_nvecserial: Aucun fichier ou dossier de ce type
tonio@tonio-VirtualBox:~$ ls -l /usr/local/lib/libsundials_cvode
ls: impossible d'accéder à /usr/local/lib/libsundials_cvode: Aucun fichier ou dossier de ce type
tonio@tonio-VirtualBox:~$ ls -l /usr/local/lib/libsundials_cvodes
ls: impossible d'accéder à /usr/local/lib/libsundials_cvodes: Aucun fichier ou dossier de ce type
tonio@tonio-VirtualBox:~$ ls -l /usr/local/lib/libsundials_ida
ls: impossible d'accéder à /usr/local/lib/libsundials_ida: Aucun fichier ou dossier de ce type
tonio@tonio-VirtualBox:~$ ls -l /usr/local/lib/libsundials_kinsol
ls: impossible d'accéder à /usr/local/lib/libsundials_kinsol: Aucun fichier ou dossier de ce

type
Dans le dossier incriminé, je retrouve des fichiers similaires, par exemple pour

libsundials_cvode

:

libsundials_cvode.a
libsundials_cvode.la
libsundials_cvode.so
libsundials_cvode.so.1
libsundials_cvode.so.1.0.0

Merci de ton aide en tout cas wink

Hors ligne

#15 Le 21/09/2011, à 17:02

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

Pourquoi tu as des liens sur ton premier message et pas le second.
Pas la même machine j'ai l'impression...
Tu as installé les paquets sundials sur celle de ton dernier message?

Hors ligne

#16 Le 21/09/2011, à 17:08

petertosh

Re : installation ok mais le logiciel ne trouve pas les librairies

Pour résumer, sur le premier lien il s'agit d'une installation sous Debian, pour les seconds liens d'une installation virtualisée de ubuntu. Il me faut une image fonctionnelle à installer sur quelques postes. J'ai bien installé les paquets sundials sur le deuxième lien également.

Hors ligne

#17 Le 21/09/2011, à 18:27

Nemesis

Re : installation ok mais le logiciel ne trouve pas les librairies

Sur le premier, tu peux regarder vers quoi pointent les liens?
Pour voir si on peut les créer à la main?

Hors ligne