gccのバージョンが4.2以上でコンパイル可能 ※gccのバージョンは $gcc --version で確認できる
#include <omp.h>
&gcc -fopenmp test.c
gcc -lgomp test.o -o test
Makefileで
.c.o : g++ -c $<
の部分に注意。C++の一般的な拡張子.cppだと
.cpp.o : g++ -c &<
と合わせないと並列化されない(.cでもコンパイルは通る)
参考文献