uob-positron-imaging-centre / up4

Post-processor for particle data.
https://uob-positron-imaging-centre.github.io/up4/
GNU General Public License v3.0
9 stars 1 forks source link

Windows. #11

Open dwerner95 opened 2 years ago

dwerner95 commented 2 years ago

I successfully ran up4 on windows using the rust-standalone version. One needs to install HDF5 (link) on windows and make sure that the bin folder is in PATH (which it should be automatically).

The main function in src/main.rs runs flawlessly and also plots the rotating drum (after some tweaks).

installing it in python works, however for some reason the HDF5-rust crate is not able to write a file.

pyo3_runtime.PanicException: Unable to create hdf5 File: Invalid file access property list id: 792633534417207322

@DanW97 can you try to reproduce this error? if so, i will raise an issue on HDF5-rust as I can not find anything online

dwerner95 commented 2 years ago

OK... I was able to run up4 properly on windows. In a virtual machine you need at least 70 GB of space. (including windows installation) Here is what to do: Install:

After this we need to setup the environment. Here is an guidance how to change environmental variables. Create a new variable called HDF5_DIR and point it to the version folder of HDF5. 'C:\Program Files\HDF_Group\HDF5\1.10.7 Attach the following paths to the PATH variable: C:\Users\USERNAME\anaconda3\ C:\Users\USERNAME\anaconda3\Scripts C:\Program Files\HDF_Group\HDF5\1.10.7\bin

From here it depends on the IDE you are using. I am simply using powershell to execute and compile applications, hence i explain this: open powershell in admin-mode and run set-executionpolicy remotesigned open powershell and run conda init restart powershell install setuptools_rust: python -m pip install setuptools_rust install up4 by executing python -m pip install . in the up4 directory.

Enjoy!

DanW97 commented 2 years ago

Ahoy Dom,

The above method seems to work, I would propose that we say to use %USERPROFILE%\anaconda3 as this is tied to the user installing up4.

For clarity when we (I) update the docs with how to install on windows I include below the components installed in VS2022 as copied from the the installer (make sure these are all ticked), and version info from also:

Microsoft Visual Studio Community 2022 Version 17.0.5 VisualStudio.17.Release/17.0.5+32112.339 Microsoft .NET Framework Version 4.8.04084 Installed Version: Community

This should mean that the following boxes are also ticked to reproduce my setup (some of these i question whether they are needed):

Once I got around Avast, up4 can be built and the rust side works, as you mentioned some tinkering with main.rs was required, i am currently unable to replicate that test here. When you get the chance, can you pass on what you used to perform your tests that passed?

Cheers,

Dan