1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
--- a/python/_harppy.py
+++ b/python/_harppy.py
@@ -34,8 +34,10 @@
import glob
import numpy
import os
+import subprocess
from functools import reduce
+
try:
from cStringIO import StringIO
except ImportError:
@@ -367,6 +369,14 @@
if os.path.exists(library_path):
return library_path
+ # Debian/Ubuntu
+ st,reply = subprocess.getstatusoutput('dpkg-architecture --query DEB_HOST_MULTIARCH')
+ if st != 0:
+ raise Exception("Multiarch check failed for libharp: %s" % reply)
+ library_path = os.path.join(os.path.normpath("/usr/lib"), reply, "libharp.so.10")
+ if os.path.exists(library_path):
+ return library_path
+
# assume the library to be in the parent library directory
library_path = os.path.normpath(os.path.join(os.path.dirname(__file__), "../../..", library_name))
if not os.path.exists(library_path):
|