-
Notifications
You must be signed in to change notification settings - Fork 133
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
conda package/mkl on windows #72
Comments
This is awesome, thanks for writing these recipes. To clarify - where does the mkl come from that should be linked against? Is it a conda distribution or must the user download mkl manually? What are the full set of steps that I should try on a clean windows install to replicate this (python version, conda install, mkl etc.). I have an old windows laptop I can test on. |
Anaconda comes with mkl now on all platforms. The default now is for numpy, scipy, etc to link against mkl. So ideally SCS would only link against mkl as well. This happens on linux. On Mac it links against Accelerate as well, but that's fine. On a clean windows environment you should install anaconda, run You can test out the SCS you built by running |
As far as I can tell this is an issue with the numpy conda package. SCS uses numpy.distutils.system_info function get_info to tell it where the blas/lapack libraries it should link against are located. Numpy stores that information in a
This is before I've even downloaded SCS. It's looking for the libs and includes in After some digging I found this part of the guide in conda about making packages relocatable, which says that the build prefix is replaced in any file that contains it with a placeholder and the file is added to the list in
and the site.cfg file has
In other words the However the latest windows numpy packages (e.g.
But that directory doesn't exist, and the prefix is not getting replaced, so it ends up with the error above. However, an older windows version of numpy,
Which is saying to swap out the I think the message here is that the conda numpy packages for windows are untested and broken, and appear to have been broken in different ways for a long time. I guess the right thing to do is flag it with the anaconda team. I never even got to the point of installing SCS on the system! |
can you try the same trick using another package that links to lapack/blas (e.g. scipy)? maybe that one is not broken. or really any other one. you can specify " build requirements" in a conda recipe, packages that are installed temporarily when building the package but not when installing it.. Enzo
|
As far as I know other packages don't expose that information like numpy does. And scipy uses the same get_info functionality from numpy to build: https://github.com/scipy/scipy/search?utf8=%E2%9C%93&q=get_info |
One potential workaround that would work for all platforms is for the conda recipe for SCS to bypass numpy and get the lapack / blas libs directly. SCS will use the environment variables |
To spell it out, the build.sh and bld.bat files would have to be something along the lines of
|
I was able to install scs on windows anaconda (python 2.7), linking to the lapack/blas libraries. I'll detail the steps I followed to successfully install the 32 bits version, and potential problems with installing the 64 bits version. Steps that I followed for the 32 bits installation:
Issues with the 64 bits installation:
Other issues encountered:
Troubleshooting:
I hope this helps anyone trying to install scs on windows! |
Thanks for this very detailed guide! It will really help other people who want to install on windows anaconda. What steps do you think can we take in the SCS codebase to make this easier? |
I'm not sure how to make the process completely automated.
|
I have made the change as in step 6, and also hopefully fixed the --extraverbose issue. |
@bodono it looks like you got installation working on windows. Could you cut a new SCS version and put it on PyPi? |
Ok, I didn't change much but I will cut a new release to PyPi when I get a chance. |
Just uploaded version 1.2.7. |
Hi, I tried to install scs via conda on Windows 10, but I get an error:
I don't know why the script is looking for Visual Studio 2017, I only have 2019. Apparently the script doesn't find MSVC through registry lookup but I found this registry key: Looking at this: (Btw, more context here: stefan-jansen/machine-learning-for-trading#177) Any idea how to make it work? :) |
When installing with conda, you should need neither the download from PyPI, nor a compiler. Something is definitely off here. Could you please post the outputs of (within the environment that you want to install Ideally, to keep things readable, please copy the outputs of
|
@h-vetinari Thanks for your help, I really appreciate it :) This is the output: Output of
|
Well.. that environment yaml file contains several things that are not ideal, chief of which is putting Same goes for Finally, this environment is not following best practices that there should be as few channels as possible. conda-forge & anaconda defaults are compatible with each other (at great effort to make sure everything is ABI-compatible), but other channels may for all intents and purposes contain stuff that blows up your setup. I didn't check all packages in that environment, but almost everything should be available from conda-forge, without the need for extra channels. Aside from trying if things work with:
I would at the very least recommend ordering conda-forge & defaults first in your channel list, as they represent the highest-quality packaging you can expect for - essentially - any package (actually, conda-forge packaging even assumes |
@Boscop, any success? |
Haven't had time to try it yet but I'll try it as soon as I'm back. Thanks :) |
@enzobusseti and I have been working on making conda packages for cvxpy and all its dependencies. We are so so close, and would really appreciate help with Windows support. Here's the conda recipes we've made:
https://github.com/cvxgrp/conda-recipes
We've used these recipes to push conda binaries to https://anaconda.org/cvxgrp
They all work except for SCS on windows. The binary doesn't link against mkl for blas/lapack some reason. It does link against mkl on linux.
You should be able to run "conda build scs" inside the conda-recipes folder and have it just work. If anyone can figure out how to get a proper windows build I would be incredibly appreciative. Remember it's not enough for the package to build, it also has to link against mkl.
The text was updated successfully, but these errors were encountered: