-
Notifications
You must be signed in to change notification settings - Fork 46
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
Can't build on Windows 10 #28
Comments
After some toying around, the issue seems to be that the windows shell doesn't have a "cp" command, or a "make" command for that matter, so the shell thinks that these are local executables, hence the "unknown file" error. I'm not sure what I can do to circumvent this issue... |
Yes, I suspected that. Unfortunately, the build script was not written with Windows in mind. Some help from an experienced Windows user is required in order to make appropriate adjustments. |
Actually both make and cp commands are functional in windows powershell if you have gnu make and cygwin installed and on path. Though the commands are functional on my shell, I too get the same error but mine is formatted bit differently to "source_x86_64-pc-windows-msvc-tmp". I hope this can be resolved as I am unable to use linux on my system. |
For those interested in researching into the root cause, I’ve set up AppVeyor. Here one can see how it fails for four different configurations with two different errors: |
Changing make to cmake and cp -R command to robocopy source source_x86_64-pc-windows-gnu_tmp /e I get following result for Environment: TARGET=x86_64-pc-windows-msvc https://ci.appveyor.com/project/VanioBegic/openblas-src/builds/24976367/job/2adrcsyx4vaj4yt3 . The exit code is 1 in this case, which seems to be the problem, since usually anything but 0 is interpreted as error, and I do not know if this is also a case with Rust Command Update:
and this compiles to following error https://ci.appveyor.com/project/VanioBegic/openblas-src/builds/24976676/job/6vp5g54ha050w4cc I am sorry for formatting, I am really new to all of this. |
Thank you for looking into this! Yes, the actual problem is the following:
In other words, this Since you got to the linking part, does it mean that you were able to compile OpenBLAS? The whole process usually takes around 10 minutes. If it finished in a few seconds, it probably didn’t go well. In any case, I think the best way to make it work is to compile OpenBLAS in isolation first. That is, just clone their repository and try to go through the whole process from start to finish manually. Then it’ll be a matter of reproducing the same commands in the build script, assuming that all requirements are installed. Here are some instructions: https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio Perhaps linking to any |
As said, this is actually not an error. Robocopy returns exit code 1, when it successfully copies all files. But directly afterwards it returns with note: LINK : fatal error LNK1181: cannot open input file 'gfortran.lib' during compilation of openblas-src I will try to follow the tutorial given in the link above, and will come back with results. |
Now when I clone the repository and build OpenBLAS manually, how do I link it to rust? Root cause of my problem is actually that I am trying to use ndarray-linalg library, but none of the BLAS crates compiles, and this one seemed most promising. Any tutorials would be helpful. |
So now you’re able to compile it manually, right? Then the natural next step is to integrate it into this crate and make the test here pass. In theory, the only thing that is needed is to link everything properly. You have the library compiled, and now tell Rust to use it in the build script. |
So I made some progress on my machine here are the steps I took:
Now after these steps the .a files can be usually found under C:\msys64\opt\OpenBLAS\lib if the installation of MSYS proceeded as given in link. Now if one wants to use this build of OpenBLAS for openblas-src it is necesarry to remove all calls to make from build script, and make corrections for robocopy on windows systems as discussed in previous comments. Now it is the matter of translating these steps into build-script. |
Perfect! Have you tried to hard-code your manual installation in the build script to check if it is actually able to find and use what is needed? I also assume that all the different parameters that we pass to Assuming the above is the case, I’d proceed as follows. All the prerequisites should be assumed to be installed. We shouldn’t try to do anything in this regard in the build script. It’s better to write it in the Wiki and then make sure people can find it from every package. Then the only thing that has to be changed is the copying of the What do you think? |
Comically enought now cargo build runs to end, but cargo test fails because it cant find a gfortran.lib file, which is not even present on my computer. Even when I comment out the specific println it still fails because it can not find openblas.lib file, which is sadly enough also not present on my computer. I am trying to resolve the issue by trying gnu toolchain. |
Do you not get |
Actually I do not get gfortran.lib file after running pacman -S gcc-fortran on msys2. What I do get is libgfortran.a and libgfortran.dll.a files located at C:\msys64\usr\lib\gcc\x86_64-pc-msys\7.4.0 About openblas.lib I can not confirm nor deny it, since I did not run Update:
When I run make install I still get no openblas.lib but rather I get cygopenblas.a and cygopenblas.dll and libopenblas.dll.a files in C:\msys64\opt\OpenBLAS\bin. In most recent attempt I am trying to compile this repo directly from msys. |
It’s good news that you have I’d simplify the build script by hard-coding the path to your manual installation and then play with different linking options. https://doc.rust-lang.org/cargo/reference/build-scripts.html |
It compiles with original build script from MSYS2 shell . I guess we can close the issue, and write in readme or wiki that compilation on windows must be done through MSYS2 shell rather then powershell. |
How come nothing is passing on AppVeyor then? https://ci.appveyor.com/project/IvanUkhov/openblas-src Is it a different shell used? Do you know how the configuration file has to be adjusted to make it work? https://github.com/blas-lapack-rs/openblas-src/blob/master/appveyor.yml |
The shell is different. Basically one needs to start this special shell which is installed together with MSYS2 called MSYS2 MinGW 64-bit ( in case of 64 bit enviroment, and 32 bit in case of 32 bit enviroment ) , and then run all the arguments from there. Seems like the way to make that happen in Rust is outlined in following : https://stackoverflow.com/questions/29903129/invoking-shell-scripts-on-windows-under-msys-using-command |
@vaniobegic, I’ve tried doing it from |
@IvanUkhov As long as you keep getting errors, it is an indicator that a package is not installed in MSYS enviroment. The -lgfortran error is caused because you lack mingw-w64-x86_64-gcc-libgfortran and you can install it by running UPDATE: Cautionary note with MSYS is that package repositories sometimes fail in middle of download, so that even if you run the pacman command it may return prematurely. Make sure you run it as many times as needed until the package is installed. |
I close this due to the recent development. |
When trying to build the crate with cargo, I get the following error messsage :
I am using the latest stable version of rust (1.34.0) on Windows 10.
The text was updated successfully, but these errors were encountered: