Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump build-torch-core.sh to support FreeBSD
- Loading branch information
stites
committed
Nov 14, 2017
1 parent
15d9fc5
commit 6446493
Showing
4 changed files
with
39 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
stack build hasktorch-codegen || { | ||
echo "can't build torch-codegen, exiting early" | ||
|
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 |
---|---|---|
@@ -1,22 +1,32 @@ | ||
#!/bin/bash -eu | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
# Build TorchStructs.hsc | ||
c2hsc torch_structs.h | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
## OSX | ||
case "$(uname -s)" in | ||
"Darwin"|"FreeBSD") | ||
## Treat FreeBSD the same as OSX for now | ||
sed -i '' 's/<bindings.dsl.h>/"bindings.dsl.h"/g' TorchStructs.hsc | ||
sed -i '' 's/^#synonym_t.*//g' TorchStructs.hsc | ||
hsc2hs TorchStructs.hsc -o TorchStructs.hs | ||
sed -i '' '/.*LINE.*/d' TorchStructs.hs | ||
rm ./TorchStructs.hsc | ||
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then | ||
;; | ||
|
||
"Linux") | ||
## Linux | ||
sed -i 's/<bindings.dsl.h>/"bindings.dsl.h"/g' TorchStructs.hsc | ||
sed -i 's/^#synonym_t.*//g' TorchStructs.hsc | ||
hsc2hs TorchStructs.hsc -o TorchStructs.hs | ||
sed -i '/.*LINE.*/d' TorchStructs.hs | ||
rm ./TobchStructs.hsc | ||
fi | ||
;; | ||
|
||
*) | ||
echo "Unknown OS" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Done" |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
rsync -arv ./raw/src/*.hs ../raw/src/ | ||
rsync -arv ./raw/src/generic/*.hs ../raw/src/generic/ |
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