build.sh 595 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # -ffast-math but without reciprocal approximations
  3. MATH_CFLAGS="\
  4. -fno-math-errno \
  5. -fexcess-precision=fast \
  6. -fno-signed-zeros -fno-trapping-math -fassociative-math \
  7. -ffinite-math-only -fno-rounding-math \
  8. -fno-signaling-nans
  9. "
  10. # flags for first-gen Ryzen
  11. # change if your cpu is different
  12. CPU_CFLAGS="-march=native -mtune=native"
  13. ERR_CFLAGS="\
  14. -Wall \
  15. -Wextra \
  16. -Wno-unused-result \
  17. -Wno-unused-function \
  18. -Werror-implicit-function-declaration \
  19. -Wno-discarded-qualifiers
  20. "
  21. gcc -o test_c3dlas test.c c3dlas.c -O0 -ggdb -lm $ERR_CFLAGS $CPU_CFLAGS $MATH_CFLAGS