libact
libact copied to clipboard
Windows compiled ok, but can't run
Here are the steps(All the files are in the zip file):
(1) Download the liblapack.lib and liblapacke.lib , and headers LAPACKE header file, LAPACKE mangling header file, liblapack.dll, liblapacke.dll (2) Change the variance_reduction.c to variance_reduction.cpp , and change the part to
#include <complex>
#define LAPACK_COMPLEX_CUSTOM
#define lapack_complex_float std::complex<float>
#define lapack_complex_double std::complex<double>
#include <Python.h>
#include <numpy/arrayobject.h>
#include <lapacke.h>
/* DGESVD prototype */
extern "C" void LAPACK_dgesvd( char* jobu, char* jobvt, int* m, int* n, double* a,
int* lda, double* s, double* u, int* ldu, double* vt, int* ldvt,
double* work, int* lwork, int* info )
(3) Change the setup.py file to :
else:
# assume linux otherwise, unless we support Windows in the future...
print("Platform Detection: Linux. Link to liblapacke...")
extra_link_args = []
include_dirs = [(numpy.distutils.misc_util.get_numpy_include_dirs() +
['/usr/include/']), "your_header_directory"] #Change the header directory
libraries = ['liblapacke', 'liblapack']
library_dirs = ['D:/tools/LAPACK_3.1.1_for_Windows_VS/lib/x64'] #This is the lib directory
(4) Run: python setup.py install
(5) Put the dll files like this
Is there any error message that might suggest why it can't run?
The python's pyd file can't load. There may exist some dependencies error.
In my knowledge, the best way to install on windows is disable compile variance_reduction. Current version of setup.py allow to achieve this purpose by set env LIBACT_BUILD_VARIANCE_REDUCTION=0.