Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save derekbrokeit/4492277 to your computer and use it in GitHub Desktop.

Select an option

Save derekbrokeit/4492277 to your computer and use it in GitHub Desktop.
Explicitly call the library based on the homebrew prefix location. This is best for users who do not use the standard homebrew installation directory.
diff --git a/python/lammps.py b/python/lammps.py
index c65e84c..b2b28a2 100644
--- a/python/lammps.py
+++ b/python/lammps.py
@@ -23,8 +23,8 @@ class lammps:
# if name = "g++", load liblammps_g++.so
try:
- if not name: self.lib = CDLL("liblammps.so",RTLD_GLOBAL)
- else: self.lib = CDLL("liblammps_%s.so" % name,RTLD_GLOBAL)
+ if not name: self.lib = CDLL("#{HOMEBREW_PREFIX}/lib/liblammps.so",RTLD_GLOBAL)
+ else: self.lib = CDLL("#{HOMEBREW_PREFIX}/lib/liblammps_%s.so" % name,RTLD_GLOBAL)
except:
type,value,tb = sys.exc_info()
traceback.print_exception(type,value,tb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment