Skip to content

Instantly share code, notes, and snippets.

@trajing
Last active May 3, 2020 07:27
Show Gist options
  • Save trajing/5625f53d3f5599a05f1925a6b15561c6 to your computer and use it in GitHub Desktop.
Save trajing/5625f53d3f5599a05f1925a6b15561c6 to your computer and use it in GitHub Desktop.
Simple bash script to get CUDA futhark compilation going
#!/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