On 21/7/10 17:21, ~suv wrote:
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
output from configure [1]:
checking for OpenMP flag of C++ compiler... unknown
$ g++-4.2 --version i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577)
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?
grepping for 'fopenmp' revealed this in config.log:
configure:18063: checking for OpenMP flag of C++ compiler configure:18099: g++-4.2 -o conftest -O3 -Wall -fopenmp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 Undefined symbols: "_gomp_thread_attr", referenced from: _gomp_run_sched_chunk in libgomp.a(env.o) ld: symbol(s) not found collect2: ld returned 1 exit status configure:18099: $? = 1 configure: failed program was:
-> It seems that '-fopenmp' fails with Apple's GCC 4.2.1 on Mac OS X 10.5.8 Leopard even though the installed man page for g++-4.2 tells otherwise.
-> No multiple threads for Gaussian blurs with osx-builds using the system-provided compiler?
~suv (still not having newer gcc versions installed via MacPorts)
configure:18063: checking for OpenMP flag of C++ compiler configure:18099: g++-4.2 -o conftest -O3 -Wall -fopenmp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 Undefined symbols: "_gomp_thread_attr", referenced from: _gomp_run_sched_chunk in libgomp.a(env.o) ld: symbol(s) not found collect2: ld returned 1 exit status configure:18099: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "inkscape" | #define PACKAGE_TARNAME "inkscape" | #define PACKAGE_VERSION "0.48+devel" | #define PACKAGE_STRING "inkscape 0.48+devel" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "inkscape" | #define VERSION "0.48+devel" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_TR1_UNORDERED_SET 1 | #define HAVE_BOOST_UNORDERED_SET 1 | #define HAVE_EXT_HASH_SET 1 | #define GETTEXT_PACKAGE "inkscape" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char omp_set_num_threads (); | int | main () | { | return omp_set_num_threads (); | ; | return 0; | } configure:18099: g++-4.2 -o conftest -O3 -Wall -openmp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 ld: unknown option: -openmp collect2: ld returned 1 exit status configure:18099: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "inkscape" | #define PACKAGE_TARNAME "inkscape" | #define PACKAGE_VERSION "0.48+devel" | #define PACKAGE_STRING "inkscape 0.48+devel" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "inkscape" | #define VERSION "0.48+devel" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_TR1_UNORDERED_SET 1 | #define HAVE_BOOST_UNORDERED_SET 1 | #define HAVE_EXT_HASH_SET 1 | #define GETTEXT_PACKAGE "inkscape" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char omp_set_num_threads (); | int | main () | { | return omp_set_num_threads (); | ; | return 0; | } configure:18099: g++-4.2 -o conftest -O3 -Wall -mp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 cc1plus: error: unrecognized command line option "-mp" configure:18099: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "inkscape" | #define PACKAGE_TARNAME "inkscape" | #define PACKAGE_VERSION "0.48+devel" | #define PACKAGE_STRING "inkscape 0.48+devel" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "inkscape" | #define VERSION "0.48+devel" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_TR1_UNORDERED_SET 1 | #define HAVE_BOOST_UNORDERED_SET 1 | #define HAVE_EXT_HASH_SET 1 | #define GETTEXT_PACKAGE "inkscape" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char omp_set_num_threads (); | int | main () | { | return omp_set_num_threads (); | ; | return 0; | } configure:18099: g++-4.2 -o conftest -O3 -Wall -xopenmp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 i686-apple-darwin9-g++-4.2.1: language openmp not recognized i686-apple-darwin9-g++-4.2.1: language openmp not recognized ld warning: in conftest.cpp, file is not of required architecture Undefined symbols: "_main", referenced from: start in crt1.10.5.o ld: symbol(s) not found collect2: ld returned 1 exit status configure:18099: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "inkscape" | #define PACKAGE_TARNAME "inkscape" | #define PACKAGE_VERSION "0.48+devel" | #define PACKAGE_STRING "inkscape 0.48+devel" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "inkscape" | #define VERSION "0.48+devel" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_TR1_UNORDERED_SET 1 | #define HAVE_BOOST_UNORDERED_SET 1 | #define HAVE_EXT_HASH_SET 1 | #define GETTEXT_PACKAGE "inkscape" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char omp_set_num_threads (); | int | main () | { | return omp_set_num_threads (); | ; | return 0; | } configure:18099: g++-4.2 -o conftest -O3 -Wall -omp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 ld: unknown option: -omp collect2: ld returned 1 exit status configure:18099: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "inkscape" | #define PACKAGE_TARNAME "inkscape" | #define PACKAGE_VERSION "0.48+devel" | #define PACKAGE_STRING "inkscape 0.48+devel" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "inkscape" | #define VERSION "0.48+devel" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_TR1_UNORDERED_SET 1 | #define HAVE_BOOST_UNORDERED_SET 1 | #define HAVE_EXT_HASH_SET 1 | #define GETTEXT_PACKAGE "inkscape" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char omp_set_num_threads (); | int | main () | { | return omp_set_num_threads (); | ; | return 0; | } configure:18099: g++-4.2 -o conftest -O3 -Wall -qsmp=omp -Werror=format-security -Wall -Wformat -Wformat-security -W -D_FORTIFY_SOURCE=2 -I/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/include -L/Volumes/blue/mp-inkscape/with-a-long-long-long-directory-name/lib conftest.cpp >&5 Undefined symbols: "_omp_set_num_threads", referenced from: _main in ccfRoEUD.o ld: symbol(s) not found collect2: ld returned 1 exit status configure:18099: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "inkscape" | #define PACKAGE_TARNAME "inkscape" | #define PACKAGE_VERSION "0.48+devel" | #define PACKAGE_STRING "inkscape 0.48+devel" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "inkscape" | #define VERSION "0.48+devel" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define STDC_HEADERS 1 | #define HAVE_TR1_UNORDERED_SET 1 | #define HAVE_BOOST_UNORDERED_SET 1 | #define HAVE_EXT_HASH_SET 1 | #define GETTEXT_PACKAGE "inkscape" | #define HAVE_LOCALE_H 1 | #define HAVE_LC_MESSAGES 1 | #define HAVE_BIND_TEXTDOMAIN_CODESET 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define ENABLE_NLS 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char omp_set_num_threads (); | int | main () | { | return omp_set_num_threads (); | ; | return 0; | }