Last active
December 18, 2015 21:18
-
-
Save jenshnielsen/5846017 to your computer and use it in GitHub Desktop.
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
diff --git fftw/m4/ax_openmp.m4 fftw/m4/ax_openmp.m4 | |
index 611ae0b..7981c0b 100644 | |
--- fftw/m4/ax_openmp.m4 | |
+++ fftw/m4/ax_openmp.m4 | |
@@ -49,8 +49,18 @@ for ax_openmp_flag in $ax_openmp_flags; do | |
none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; | |
*) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; | |
esac | |
- AC_TRY_LINK_FUNC(omp_set_num_threads, | |
- [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) | |
+ AC_TRY_LINK([#ifdef __cplusplus | |
+extern "C" | |
+#endif | |
+void omp_set_num_threads(int);], [const int N = 100000; | |
+ int i, arr[N]; | |
+ | |
+ omp_set_num_threads(2); | |
+ | |
+ #pragma omp parallel for | |
+ for (i = 0; i < N; i++) { | |
+ arr[i] = i; | |
+ }], [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) | |
done | |
[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment