First modified version that installs with pip

This commit is contained in:
2017-01-12 18:21:29 +01:00
parent c5cd9ce155
commit 3ae3ad98e1
12 changed files with 1335 additions and 100 deletions

View File

@@ -1 +1 @@
__version__ = "0.1.6"
__version__ = "0.2.0"

View File

@@ -6,7 +6,23 @@ import numpy as np
import os
import mpmath
def _print_error(msg_str):
sys.stderr.write(msg_str + "\n")
try:
_OpenBLASLibPath = os.path.join(os.path.dirname(os.path.abspath(__file__)),"OpenBLAS_install/lib/libopenblas.so.0")
c.CDLL(_OpenBLASLibPath)
except OSError:
_print_error("Warning: Failed to load OpenBLAS in its default place. Excepting the library to be available from the system.")
_SpintrumLibPath = os.path.join(os.path.dirname(os.path.abspath(__file__)),"lib/libspintrum.so")
if not os.path.exists(_SpintrumLibPath):
msg = "WARNING: Could not load the spintrum shared library in path " \
+ _SpintrumLibPath + ". This means that the installation is not valid " \
"and will most likely not work."
_print_error(msg)
print(msg)
mpmath.mp.dps = 50
@@ -41,19 +57,6 @@ def who_am_i():
return func_name
def _print_error(msg_str):
sys.stderr.write(msg_str + "\n")
if not os.path.exists(_SpintrumLibPath):
msg = "WARNING: Could not load the spintrum shared library in path " \
+ _SpintrumLibPath + ". This means that the installation is not valid " \
"and will most likely not work."
_print_error(msg)
print(msg)
def _raise_error(msg_str):
sys.stderr.write(msg_str + "\n")
raise Exception(msg_str)