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
WIP: shell.nix that provides all the dependencies #162
Closed
Closed
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b802245
introduce shell.nix for inline-c
wavewave 6bdb729
add more haskell deps and mkl.
wavewave 5cc7d0c
pytorch 1.2!
wavewave bbcaee8
pin nixpkgs revision.
wavewave ae8c3fb
api/include path. temporarily disable mkl
wavewave 8c01de9
library_path.
wavewave bf60cb9
hasktorch works with setting up C++11 ABI flag correctly!
wavewave d57bfff
remove unnecessary ABI option
wavewave 8d6d441
enable mkl. use dev attribute.
wavewave File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ pkgs ? | ||
let | ||
# revision: https://github.com/NixOS/nixpkgs/pull/65041 | ||
rev = "9420c33455c5b3e0876813bdd739bc75b3ccbd8a"; | ||
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; | ||
# nix-prefetch-url --unpack ${url} | ||
sha256 = "0l82qfcmip0mfijcxssaliyxayfh0c11bk66yhwna1ixc0s0jjd2"; | ||
nixpkgs = builtins.fetchTarball { inherit url sha256; }; | ||
in | ||
import nixpkgs { config.allowUnfree = true; config.allowUnsupportedSystem = true; } | ||
}: | ||
|
||
with pkgs; | ||
|
||
let | ||
|
||
hsenv = haskellPackages.ghcWithPackages (p: with p; [ | ||
cabal-install | ||
ansi-wl-pprint | ||
async | ||
bytestring | ||
containers | ||
exceptions | ||
finite-typelits | ||
ghc-typelits-knownnat | ||
hashable | ||
hspec | ||
hspec-discover | ||
mtl | ||
optparse-applicative | ||
parsec | ||
parsers | ||
QuickCheck | ||
reflection | ||
safe-exceptions | ||
sysinfo | ||
template-haskell | ||
transformers | ||
transformers-compat | ||
unordered-containers | ||
vector | ||
]); | ||
|
||
in | ||
|
||
stdenv.mkDerivation { | ||
name = "hasktorch-dev"; | ||
buildInputs = [ hsenv mkl python3Packages.pytorchWithoutCuda ]; | ||
shellHook = | ||
let | ||
libtorch_path = "${python3Packages.pytorchWithoutCuda}/lib/${python3Packages.python.libPrefix}/site-packages/torch"; | ||
in | ||
'' | ||
export CPATH=${libtorch_path}/include/torch/csrc/api/include | ||
export LD_LIBRARY_PATH=${libtorch_path}/lib | ||
''; | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-optc-D_GLIBCXX_USE_CXX11_ABI=1
is a default option of gcc.So we can just remove it to use CXX11_ABI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Official page of pytorch provides libtorch of CXX11ABI.
So It ’s a good time to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! now I removed them.