import patch from joe jordan to find the lammps DSO automatically
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
import types
|
import types
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
|
import os.path
|
||||||
|
|
||||||
LMPINT = 0
|
LMPINT = 0
|
||||||
LMPDOUBLE = 1
|
LMPDOUBLE = 1
|
||||||
@ -22,6 +23,8 @@ LMPIPTR = 2
|
|||||||
LMPDPTR = 3
|
LMPDPTR = 3
|
||||||
LMPDPTRPTR = 4
|
LMPDPTRPTR = 4
|
||||||
|
|
||||||
|
LOCATION = os.path.dirname(__file__)
|
||||||
|
|
||||||
class lammps:
|
class lammps:
|
||||||
def __init__(self,args=None):
|
def __init__(self,args=None):
|
||||||
|
|
||||||
@ -29,10 +32,10 @@ class lammps:
|
|||||||
# could provide caller a flag to choose which library to load
|
# could provide caller a flag to choose which library to load
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.lib = CDLL("_lammps.so")
|
self.lib = CDLL(os.path.join(LOCATION, "_lammps.so"))
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
self.lib = CDLL("_lammps_serial.so")
|
self.lib = CDLL(os.path.join(LOCATION, "_lammps_serial.so"))
|
||||||
except:
|
except:
|
||||||
raise OSError,"Could not load LAMMPS dynamic library"
|
raise OSError,"Could not load LAMMPS dynamic library"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user