haskell icon indicating copy to clipboard operation
haskell copied to clipboard

Is it possible to install on Windows 7 x64 ?

Open Quantification opened this issue 7 years ago • 5 comments

Is it worth trying to install haskell-tensorflow on Windows 7 x64 ? Tried stack install tensorflow, it requires some dependencies.

Quantification avatar Mar 28 '18 15:03 Quantification

I've haven't tried it, but if you managed to install tensorflow for windows already, then you probably have most of the dependencies.

I think the main extra dependency we have over tensorflow is libsnappy-dev. That is only needed for tensorflow-records, so, unless you need that package, you can probably save some work by commenting out the tensorflow-records* and snappy-* lines in https://github.com/tensorflow/haskell/blob/master/stack.yaml

(if you do need tensorflow-records, we can probably drop its dependency on snappy without much effort: https://github.com/tensorflow/haskell/blob/master/tensorflow-records/tensorflow-records.cabal#L22)

fkm3 avatar Mar 28 '18 16:03 fkm3

@Quantification , I've successfully installed it on Windows 10 x64. I don't know why it should be different on Windows 7 x64.

I used stack and LTS-11.20. Steps:

  1. Download Tensorflow C API for Windows X64. I used version 1.9.
  2. Generate import library (tensorflow.lib). I used dumpbin and lib tools from VS2017.
  3. Add location of tensorflow.dll to PATH variable. It's important. And add location of .lib to extra-lib-dirs in your stack.yaml.
  4. Download protoc.exe and add its location to PATH variable.
  5. Try stack install tensorflow. If build fails on c2hs, check generated types. My problem was that c2hs generates CULLong for size_t when tensorflows's sources require CULong.
  6. Install snappy via pacman of stack's MSYS2 (%USERNAME%\AppData\Local\Programs\stack\x86_64-windows\msys2-20180531)
  7. Build your project with tensorflow.

EvgenyVorobyov avatar Aug 10 '18 19:08 EvgenyVorobyov

Thanks @EvgenyVorobyov!

Try stack install tensorflow. If build fails on c2hs, check generated types. My problem was that c2hs generates CULLong for size_t when tensorflows's sources require CULong.

That looks like a bug. We should switch a couple CULongs to CSizes.

fkm3 avatar Aug 10 '18 20:08 fkm3

@fkm3 , I believe its a bug. Probably its Windows only. If its a bug of c2hs, then maybe its better to make an alias like type CSizeT = {#type size_t #} since c2hs generated CULLong instead of CSize or CULong.

EvgenyVorobyov avatar Aug 10 '18 20:08 EvgenyVorobyov

This look like a very useful package and having it running it on W10x64 would be really great. Would it be possible to make this W10x64 installation totally trivial? If not please could you give step by step details/pointers -- for example on step 2 using VS2017 to generate the import library etc.? Thanks

mst2018 avatar Nov 20 '18 11:11 mst2018