-
Notifications
You must be signed in to change notification settings - Fork 103
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 hasktorch-0.2.0.0 into external cabal project (linux, cuda) #591
Comments
@melendezd Is stack an option? If so the template here https://github.com/hasktorch/hasktorch-stack-skeleton takes care of the hasktorch git dependency using stack.yaml. We'd like to have a cabal skeleton as well, but nobody has gotten to it yet (there's a nix one as well https://github.com/hasktorch/hasktorch-skeleton). If you need cabal maybe the troubleshooting here could be the basis for one. |
In your use case, include path is not enough. I recommend to use above skeltons. |
Heads up for hasktorch-skeleton, not sure why this is yet, but (in my experience) the .cabal file must be named hasktorch-skeleton.cabal or cabal will fail to locate it (even if the glob *.cabal is used). I haven't had the chance to figure out why this is yet. Also watch out for using Cuda 11, as the libtorch nix overlay has the incorrect version 11.0 instead of 11.1. I fixed the second issue in my local copy but never got to submitting a PR for it. Will do ASAP. I'm really not sure about the first one. Maybe someone else has some more insight, but I'll hopefully have time to look at it some more later today. |
I was able to get the examples to work just fine (static typed MNIST CNN), but I'm having trouble building hasktorch-0.2.0.0 into a separate cabal project.
Steps:
get-deps.h
inhasktorch/deps/
hasktorch/deps/libtorch/include/*
into/usr/include
hasktorch/deps/libtorch/lib/*
into/lib
(not sure if this is necessary with thesetenv
script)setenv
inhasktorch
hasktorch/setup-cabal.sh
inhasktorch
cabal build hasktorch
Hasktorch builds successfully on its own.
I then create a new cabal project called
ml
in a separate folder. Here's myml.cabal
file:I also create a
cabal.project
file:Then, I run
cabal build
and get the following error:Am I approaching this wrong?
The text was updated successfully, but these errors were encountered: