Comments (2)
Recording my findings here for the benefit of others with the same question:
- After removing the unix dependency from examples/examples.cabal, "cabal build hasktorch" runs for a pretty long time, but eventually fails with ld complaining about among others -ltorch.
- One may hope that pointing cabal to libtorch windows binaries using --extra-lib-dirs will fix this, but it did not, as far as I understand because:
- libtorch binaries are compiled using MSVC and are not "ABI-compatible", which means GHC's c compiler mingw can not link to them (see the "tip" on https://pytorch.org/cppdocs/installing.html).
- One may hope to compile libtorch from source on windows using mingw, but libtorch does not provide makefiles for mingw. I did not attempt to figure it out myself after reading https://discuss.pytorch.org/t/can-i-build-libtorch-from-source-with-mingw/52632.
So getting hasktorch to compile on windows unfortunately seems like a major undertaking, even with just cpu and without cuda support.
from hasktorch.
Hi @davidbelius,
I think that when we use MSVC's libtorch, we need to use ghc of MSVC(https://www.reddit.com/r/haskell/comments/n0xcoy/announce_experimental_windows_ghc_8105_binary/), and some patches for some packages.
This repository(https://github.com/awson/ghc-nw) provides the paches.
However, both of them are not maintained.
I recommend to use WSL on windows, although the performance will be worse than native linux. GPU also works.
from hasktorch.
Related Issues (20)
- Build failure with GHC 9.4.7 (Stack LTS 21.15) HOT 3
- Building with cabal chokes on a commit sha from cabal.project HOT 3
- CI: reducing cache sizes to better cope with the 10 GB limit HOT 2
- libnvrtc-builtins.so.11.3 can't be found
- `cabal repl hasktorch` does nothing
- Plans / roadmap to release v0.2 ? HOT 13
- Not being able to move MutableTensor to GPU HOT 1
- macOS: cabal build hasktorch-gradually-typed fails with dylib problem HOT 4
- support for Cuda 12.1 HOT 1
- pathspec 'v2.3.0' did not match any files known to git HOT 1
- No cabal file found for cpu installation method
- stack test hasktorch error HOT 3
- minst dataset is no longer available? HOT 3
- feature request: attention mechanism example
- libtorch-ffi errors when profiling with `--profile` HOT 14
- Some part of libtorch-ffi codebase being called uninvoked? HOT 5
- Link error on macos(xcode/clang) : Duplicate symbol error for libtorch-ffi. HOT 3
- Missing configurations on NixOS HOT 13
- Outdated dependencies prevent building in nix shell
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hasktorch.