summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-01-27 10:05:57 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-01-27 10:08:48 +0100
commit4a75ab09962015d90acaa3e2be8357a1c917d5eb (patch)
tree139bd09d0319bc031578733a9948fcdf154c7d7e /python
parentcf0eff7075d21ccfa985676eb3a5e30f8694fc4c (diff)
downloadastra-4a75ab09962015d90acaa3e2be8357a1c917d5eb.tar.gz
astra-4a75ab09962015d90acaa3e2be8357a1c917d5eb.tar.bz2
astra-4a75ab09962015d90acaa3e2be8357a1c917d5eb.tar.xz
astra-4a75ab09962015d90acaa3e2be8357a1c917d5eb.zip
Move fixLapackLoading to astra_mex_plugin
Diffstat (limited to 'python')
-rw-r--r--python/astra/src/PythonPluginAlgorithm.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/python/astra/src/PythonPluginAlgorithm.cpp b/python/astra/src/PythonPluginAlgorithm.cpp
index 61a56ea..e34861a 100644
--- a/python/astra/src/PythonPluginAlgorithm.cpp
+++ b/python/astra/src/PythonPluginAlgorithm.cpp
@@ -127,43 +127,11 @@ void CPluginAlgorithm::run(int _iNrIterations){
PyGILState_Release(state);
}
-void fixLapackLoading(){
- // When running in Matlab, we need to force numpy
- // to use its internal lapack library instead of
- // Matlab's MKL library to avoid errors. To do this,
- // we set Python's dlopen flags to RTLD_NOW|RTLD_DEEPBIND
- // and import 'numpy.linalg.lapack_lite' here. We reset
- // Python's dlopen flags afterwards.
- PyObject *sys = PyImport_ImportModule("sys");
- if(sys!=NULL){
- PyObject *curFlags = PyObject_CallMethod(sys,"getdlopenflags",NULL);
- if(curFlags!=NULL){
- PyObject *retVal = PyObject_CallMethod(sys, "setdlopenflags", "i",10);
- if(retVal!=NULL){
- PyObject *lapack = PyImport_ImportModule("numpy.linalg.lapack_lite");
- if(lapack!=NULL){
- Py_DECREF(lapack);
- }
- PyObject *retVal2 = PyObject_CallMethod(sys, "setdlopenflags", "O",curFlags);
- if(retVal2!=NULL){
- Py_DECREF(retVal2);
- }
- Py_DECREF(retVal);
- }
- Py_DECREF(curFlags);
- }
- Py_DECREF(sys);
- }
-}
-
CPythonPluginAlgorithmFactory::CPythonPluginAlgorithmFactory(){
if(!Py_IsInitialized()){
Py_Initialize();
PyEval_InitThreads();
}
-#ifndef _MSC_VER
- if(astra::running_in_matlab) fixLapackLoading();
-#endif
pluginDict = PyDict_New();
inspect = PyImport_ImportModule("inspect");
six = PyImport_ImportModule("six");