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 Support #152

Open
cmoscardi opened this issue Sep 19, 2018 · 6 comments
Open

Windows Support #152

cmoscardi opened this issue Sep 19, 2018 · 6 comments
Labels

Comments

@cmoscardi
Copy link

cmoscardi commented Sep 19, 2018

Hi, I'm trudging away on Windows support (with very minimal knowledge of Windows environments) here: https://github.com/cmoscardi/libact (just on master).

If anyone else is interested in this, and knows a thing or two about compiling stuff on Windows (especially getting LAPACK to work, my current headache), please do let me know! Comment here or raise an issue on my fork, and we can talk more.

@cmoscardi
Copy link
Author

cmoscardi commented Sep 19, 2018

And, for reference, the most recent error is the following, during compilation of the variance_reduction.c file. From this build (and you can see build progress here too): https://ci.appveyor.com/project/cmoscardi/libact/build/1.0.37

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cstdlib(19): error C2061: syntax error: identifier 'noexcept'

According to this post, this should be compiled as C++ code? But that leads to a circular error of some sort where I'm told I'm missing dgesvd_, which may or may not be solvable by including clapack... but then there are multiple definitions of the same variable.

Oh, also worth noting that I had to follow the advice of this post to deal with that complex.h issue (which is also brought up in a couple of the issues on this repo where people are trying to build with Windows).

@yangarbiter
Copy link
Collaborator

variance_reduction.c is actually a file generated from variance_reduction.pyx, I don't think you should change the file.

Are you able to follow #118 for building the package?

@cmoscardi
Copy link
Author

cmoscardi commented Sep 20, 2018

Wait sorry, where is that .pyx file? I don't see it in the repo.

As for #118, it looks like they're stuck in approximately the same place as I am. Basically, getting lapacke installed in some way, shape, or form seems to be a challenge.

With that said, I think I've gotten closer (notably, this has included modifying the variance_reduction.c file), and now need to figure out why something in LAPACK itself (or maybe the entirety of LAPACK) isn't linking correctly.

variance_reduction.obj : error LNK2001: unresolved external symbol dgesvd_

Full build output: here
variance_reduction.c file at the relevant commit: here

@yangarbiter
Copy link
Collaborator

yangarbiter commented Sep 20, 2018

Oh sorry, my bad, the variance_reduction.c is correct.

I think the key problem might be this line
https://ci.appveyor.com/project/cmoscardi/libact/build/1.0.60#L124

The extra_link_args in setup.py is set for linux system
https://github.com/yangarbiter/libact/blob/master/setup.py#L28

Link your C application built with MSVC with the BLAS,LAPACK and LAPACKE libraries (the lib files) you just downloaded. In your project properties, change the properties "Linker > General > Additional Library Directory" to tell Visual Studio where the libraries are, and also add the name of your BLAS, LAPACK and LAPACKE libraries in "Linker > Input > Additional Dependencies", just put "liblapacke.lib;liblapack.lib;libblas.lib"

You may have to change the setup.py file accordingly

@cmoscardi
Copy link
Author

cmoscardi commented Sep 28, 2018

Yep, it was indeed explicitly linking that. Now, building completes, but the built .pyd file still cannot be found for some reason.

This is likely a simple issue, but again, I'm just not particularly experienced with the Windows build process, so any help would be appreciated.

Build output: https://ci.appveyor.com/project/cmoscardi/libact/build/1.0.73#L345

Remarks:

  1. Starting here, https://github.com/cmoscardi/libact/blob/master/appveyor.yml#L78 , I've changed the script to first run setup.py build, then setup.py test, to confirm that the built files exist.

  2. According to what I'm seeing on the internet, I should just have to change PYTHONPATH to include the .pyd file's location, but as you can see verified here, the PYTHONPATH includes a location where that .pyd file lives, and python still can't find it... https://ci.appveyor.com/project/cmoscardi/libact/build/1.0.73#L184

  3. Furthermore, the libblas, liblapack, liblapacke DLL files are on the PATH... see here:
    https://ci.appveyor.com/project/cmoscardi/libact#L83 (and the files themselves are downloaded around line 24 in this output)

@cmoscardi
Copy link
Author

cmoscardi commented Oct 3, 2018

Update: I've gotten it to build. Take a look at this, though -- many tests are failing.

https://ci.appveyor.com/project/cmoscardi/libact

Notably, scikit-learn was giving tons of error output about some default parameters (see scikit-learn/scikit-learn#9997 ) into the logistic regression model (as well as an SVM parameter), so I changed those... here's the commit showing the change in the logit model wrapper class with the current defaults. cmoscardi@991fc87

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

No branches or pull requests

2 participants