import patch from joe jordan to find the lammps DSO automatically

This commit is contained in:
Axel Kohlmeyer
2012-04-27 10:37:04 -04:00
parent 209fb57577
commit 959946a023

View File

@ -15,6 +15,7 @@
import types
from ctypes import *
import os.path
LMPINT = 0
LMPDOUBLE = 1
@ -22,6 +23,8 @@ LMPIPTR = 2
LMPDPTR = 3
LMPDPTRPTR = 4
LOCATION = os.path.dirname(__file__)
class lammps:
def __init__(self,args=None):
@ -29,10 +32,10 @@ class lammps:
# could provide caller a flag to choose which library to load
try:
self.lib = CDLL("_lammps.so")
self.lib = CDLL(os.path.join(LOCATION, "_lammps.so"))
except:
try:
self.lib = CDLL("_lammps_serial.so")
self.lib = CDLL(os.path.join(LOCATION, "_lammps_serial.so"))
except:
raise OSError,"Could not load LAMMPS dynamic library"