Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows compiled ok, but can't run #180

Open
happydpc opened this issue Jul 14, 2020 · 3 comments
Open

Windows compiled ok, but can't run #180

happydpc opened this issue Jul 14, 2020 · 3 comments

Comments

@happydpc
Copy link

happydpc commented Jul 14, 2020

modified_files.zip

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
image

@happydpc happydpc changed the title Solved: windows compile Windows compiled ok, but can't run Jul 14, 2020
@yangarbiter
Copy link
Collaborator

Is there any error message that might suggest why it can't run?

@happydpc
Copy link
Author

The python's pyd file can't load. There may exist some dependencies error.

@brightgems
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants