On 21/7/10 15:42, Krzysztof KosiĆski wrote:
I just discovered that OpenMP support (used to parallelize Gaussian blur) is not functional on Linux and OS X because of a missing AC_DEFINE. Here is a patch that fixes this problem. Admins: please apply to 0.48 branch also.
I applied your patch and reran autogen.sh and configure - twice, to test both compilers provided by OSX/Xcode, setting $CC and $CXX accordingly:
# to speed up the compilation #export CC="ccache gcc" #export CXX="ccache g++"
# test with OpenMP: use gcc 4.2 export CC="gcc-4.2" export CXX="g++-4.2"
output from configure [1]:
checking for OpenMP flag of C++ compiler... unknown
for both default compilers installed on OS X 10.5.8:
$ g++ --version i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) $ g++-4.2 --version i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577)
GCC 4.0.1 does not support OpenMP. GCC 4.2.1 _does_ support OpenMP according to its man page:
-fopenmp Enable handling of OpenMP directives "#pragma omp" in C/C++ and "!$omp" in Fortran. When -fopenmp is specified, the compiler generates parallel code according to the OpenMP Application Program Interface v2.5 <http://www.openmp.org/>.
<omp.h> does exist:
$ ll /usr/lib/gcc/i686-apple-darwin9/4.2.1/include/omp.h -rw-r--r-- 1 root wheel 2793 Jul 7 2009 /usr/lib/gcc/i686-apple-darwin9/4.2.1/include/omp.h
What do I miss here?
~suv
[1] configure output for g++-4.2:
checking whether we are using the GNU C++ compiler... (cached) yes checking whether g++-4.2 accepts -g... (cached) yes checking dependency style of g++-4.2... (cached) gcc3 checking how to run the C++ preprocessor... g++-4.2 -E checking for objdir... .libs checking if gcc-4.2 supports -fno-rtti -fno-exceptions... no checking for gcc-4.2 option to produce PIC... -fno-common -DPIC checking if gcc-4.2 PIC flag -fno-common -DPIC works... yes checking if gcc-4.2 static flag -static works... no checking if gcc-4.2 supports -c -o file.o... yes checking if gcc-4.2 supports -c -o file.o... (cached) yes checking whether the gcc-4.2 linker (/usr/libexec/gcc/i686-apple-darwin9/4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin9.8.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for ld used by g++-4.2... /usr/libexec/gcc/i686-apple-darwin9/4.2.1/ld checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.2.1/ld) is GNU ld... no checking whether the g++-4.2 linker (/usr/libexec/gcc/i686-apple-darwin9/4.2.1/ld) supports shared libraries... yes checking for g++-4.2 option to produce PIC... -fno-common -DPIC checking if g++-4.2 PIC flag -fno-common -DPIC works... yes checking if g++-4.2 static flag -static works... no checking if g++-4.2 supports -c -o file.o... yes checking if g++-4.2 supports -c -o file.o... (cached) yes checking whether the g++-4.2 linker (/usr/libexec/gcc/i686-apple-darwin9/4.2.1/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin9.8.0 dyld checking how to hardcode library paths into programs... immediate checking for ANSI C header files... (cached) yes checking for BZR snapshot build... yes checking for gcc... (cached) gcc-4.2 checking whether we are using the GNU C compiler... (cached) yes checking whether gcc-4.2 accepts -g... (cached) yes checking for gcc-4.2 option to accept ISO C89... (cached) none needed checking dependency style of gcc-4.2... (cached) gcc3 checking whether gcc-4.2 and cc understand -c and -o together... yes checking compiler support for -Werror=format-security... yes checking compiler support for -Wno-pointer-sign... yes checking linker tolerates -z relro... no checking GNU compiler version... 4.2.1 checking TR1 unordered_set usability... ok checking boost/unordered_set.hpp usability... yes checking boost/unordered_set.hpp presence... yes checking for boost/unordered_set.hpp... yes checking ext/hash_set usability... yes checking ext/hash_set presence... yes checking for ext/hash_set... yes
(...)
checking for OpenMP flag of C++ compiler... unknown