Last active
May 3, 2020 07:27
-
-
Save trajing/5625f53d3f5599a05f1925a6b15561c6 to your computer and use it in GitHub Desktop.
Simple bash script to get CUDA futhark compilation going
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
#!/usr/bin/env bash | |
# nonstandard things: bash; ripgrep; mktemp | |
name=$(basename $@ .fut) | |
tmpf=$(mktemp) | |
futhark cuda $@ 2>&1 | tee $tmpf | rg gcc > /dev/null | |
if [ $? -eq 0 ] | |
then | |
gcc -L/opt/cuda/lib64 -I/opt/cuda/include -lm -lcuda -lnvrtc $name.c -o $name | |
else | |
# actual compilation problem | |
cat $tmpf | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment