[OMPI devel] about r32685
Ralph and Brice, i noted Ralph commited r32685 in order to fix a problem with Intel compilers. The very similar issue occurs with clang 3.2 (gcc and clang 3.4 are ok for me) imho, the root cause is in the hwloc configure. in this case, configure fails to detect strncasecmp is part of the C include files. in order to achieve this, the conftest.1.c program is compiled and a failure means that strncasecmp is supported since it is declared in some C include files. gcc and clang 3.4 both fail to compile this program : $ gcc -c /tmp/conftest.1.c ; echo $? /tmp/conftest.1.c:592: warning: data definition has no type or storage class /tmp/conftest.1.c:592: error: conflicting types for ‘strncasecmp’ 1 $ clang --version clang version 3.4 (tags/RELEASE_34/final) Target: x86_64-redhat-linux-gnu Thread model: posix $ clang -c /tmp/conftest.1.c ; echo $? /tmp/conftest.1.c:592:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] strncasecmp(int,long,int,long,int,long,int,long,int,long); ^~~ /tmp/conftest.1.c:592:8: error: conflicting types for 'strncasecmp' /usr/include/string.h:540:12: note: previous declaration is here extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) ^ /tmp/conftest.1.c:596:19: error: too many arguments to function call, expected 3, have 10 strncasecmp(1,2,3,4,5,6,7,8,9,10); ~~~ ^~ 1 warning and 2 errors generated. 1 but clang 3.2 and icc simply issue a warning and no error : $ clang --version clang version 3.2 (tags/RELEASE_32/final) Target: x86_64-unknown-linux-gnu Thread model: posix $ clang -c /tmp/conftest.1.c ; echo $? /tmp/conftest.1.c:592:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] strncasecmp(int,long,int,long,int,long,int,long,int,long); ^~~ /tmp/conftest.1.c:592:8: warning: incompatible redeclaration of library function 'strncasecmp' /usr/include/string.h:540:12: note: 'strncasecmp' is a builtin with type 'int (const char *, const char *, size_t)' extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) ^ 2 warnings generated. 0 $ icc -c conftest.1.c ; echo $? conftest.1.c(592): warning #77: this declaration has no storage class or type specifier strncasecmp(int,long,int,long,int,long,int,long,int,long); ^ conftest.1.c(592): warning #147: declaration is incompatible with "int strncasecmp(const char *, const char *, size_t={unsigned long})" (declared at line 540 of "/usr/include/string.h") strncasecmp(int,long,int,long,int,long,int,long,int,long); ^ 0 the attached hwloc_config.patch is used in order to make the test program slightly different (conftest.2.c) and it does fail with all the compilers. that being said, r32685 might not be reversed since in the case strncasecmp is not supported by the system (i do not even know if such os exist) ctype.h must be #include'd in order to get the prototype of the tolower() function. could you please review the hwloc_config.patch and comment ? Cheers, Gilles /* confdefs.h */ #define PACKAGE_NAME "Open MPI" #define PACKAGE_TARNAME "openmpi" #define PACKAGE_VERSION "1.9a1" #define PACKAGE_STRING "Open MPI 1.9a1" #define PACKAGE_BUGREPORT "http://www.open-mpi.org/community/help/"; #define PACKAGE_URL "" #define OPAL_ARCH "x86_64-unknown-linux-gnu" #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 __EXTENSIONS__ 1 #define _ALL_SOURCE 1 #define _GNU_SOURCE 1 #define _POSIX_PTHREAD_SEMANTICS 1 #define _TANDEM_SOURCE 1 #define OMPI_MAJOR_VERSION 1 #define OMPI_MINOR_VERSION 9 #define OMPI_RELEASE_VERSION 0 #define OMPI_GREEK_VERSION "a1" #define OMPI_VERSION "0" #define OMPI_RELEASE_DATE "Unreleased developer copy" #define OMPI_WANT_REPO_REV 1 #define OMPI_REPO_REV "r32670M" #define ORTE_MAJOR_VERSION 1 #define ORTE_MINOR_VERSION 9 #define ORTE_RELEASE_VERSION 0 #define ORTE_GREEK_VERSION "a1" #define ORTE_VERSION "0" #define ORTE_RELEASE_DATE "Unreleased developer copy" #define ORTE_WANT_REPO_REV 1 #define ORTE_REPO_REV "r32670M" #define OSHMEM_MAJOR_VERSION 1 #define OSHMEM_MINOR_VERSION 9 #define OSHMEM_RELEASE_VERSION 0 #define OSHMEM_GREEK_VERSION "a1" #define OSHMEM_VERSION "0" #define OSHMEM_RELEASE_DATE "Unreleased developer copy" #define OSHMEM_WANT_REPO_REV 1 #define OSHMEM_REPO_REV "r32670M" #define OPAL_MAJOR_VERSION 1 #define OPAL_MINOR_VERSION 9 #define OPAL_RELEASE_VERSION 0 #define OPAL_GREEK_VERSION "a1" #define OPAL_VERSION "0" #define OPAL_RELEASE_DATE "Unreleased developer copy" #define OPAL_WANT_REPO_REV 1 #define OPAL_REPO_REV "r32670M" #define OPAL_ENABLE_MEM_DEBUG 0 #define OPAL_ENABLE_MEM_PROFILE 0 #define OPAL_ENABLE_DEBUG 0 #define OPAL_WANT_PRETTY_PRINT_STACKTRACE 1 #define OPAL_ENABLE_PTY_SUPPORT 1 #define OPAL_ENABLE_HETEROGENEOUS_SUPPORT 0 #define OPAL_WANT_HOME_CONFIG_FILES 1 #define O
Re: [OMPI devel] about r32685
I'll have to let Brice comment on the config change. All I can say is that "tolower" on my CentOS box is defined in , and that has to be included in the misc.h header. On Sep 8, 2014, at 5:49 PM, Gilles Gouaillardet wrote: > Ralph and Brice, > > i noted Ralph commited r32685 in order to fix a problem with Intel > compilers. > The very similar issue occurs with clang 3.2 (gcc and clang 3.4 are ok > for me) > > imho, the root cause is in the hwloc configure. > in this case, configure fails to detect strncasecmp is part of the C > include files. > > in order to achieve this, the conftest.1.c program is compiled and a > failure means that > strncasecmp is supported since it is declared in some C include files. > > gcc and clang 3.4 both fail to compile this program : > > $ gcc -c /tmp/conftest.1.c ; echo $? > /tmp/conftest.1.c:592: warning: data definition has no type or storage class > /tmp/conftest.1.c:592: error: conflicting types for ‘strncasecmp’ > 1 > > $ clang --version > clang version 3.4 (tags/RELEASE_34/final) > Target: x86_64-redhat-linux-gnu > Thread model: posix > $ clang -c /tmp/conftest.1.c ; echo $? > /tmp/conftest.1.c:592:8: warning: type specifier missing, defaults to 'int' > [-Wimplicit-int] > strncasecmp(int,long,int,long,int,long,int,long,int,long); > ^~~ > /tmp/conftest.1.c:592:8: error: conflicting types for 'strncasecmp' > /usr/include/string.h:540:12: note: previous declaration is here > extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) > ^ > /tmp/conftest.1.c:596:19: error: too many arguments to function call, > expected > 3, have 10 > strncasecmp(1,2,3,4,5,6,7,8,9,10); > ~~~ ^~ > 1 warning and 2 errors generated. > 1 > > > but clang 3.2 and icc simply issue a warning and no error : > > $ clang --version > clang version 3.2 (tags/RELEASE_32/final) > Target: x86_64-unknown-linux-gnu > Thread model: posix > $ clang -c /tmp/conftest.1.c ; echo $? > /tmp/conftest.1.c:592:8: warning: type specifier missing, defaults to 'int' > [-Wimplicit-int] > strncasecmp(int,long,int,long,int,long,int,long,int,long); > ^~~ > /tmp/conftest.1.c:592:8: warning: incompatible redeclaration of library > function > 'strncasecmp' > /usr/include/string.h:540:12: note: 'strncasecmp' is a builtin with type > 'int > (const char *, const char *, size_t)' > extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) > ^ > 2 warnings generated. > 0 > > $ icc -c conftest.1.c ; echo $? > conftest.1.c(592): warning #77: this declaration has no storage class or > type specifier > strncasecmp(int,long,int,long,int,long,int,long,int,long); > ^ > > conftest.1.c(592): warning #147: declaration is incompatible with "int > strncasecmp(const char *, const char *, size_t={unsigned long})" > (declared at line 540 of "/usr/include/string.h") > strncasecmp(int,long,int,long,int,long,int,long,int,long); > ^ > > 0 > > > the attached hwloc_config.patch is used in order to make the test > program slightly different (conftest.2.c) and it does fail with all the > compilers. > > > that being said, r32685 might not be reversed since in the case > strncasecmp is not supported by the system (i do not even know if such > os exist) > ctype.h must be #include'd in order to get the prototype of the > tolower() function. > > > could you please review the hwloc_config.patch and comment ? > > Cheers, > > Gilles > ___ > devel mailing list > de...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel > Link to this post: > http://www.open-mpi.org/community/lists/devel/2014/09/15775.php
Re: [OMPI devel] about r32685
Ralph, ok, let me clarify my point : tolower() is invoked in : opal/mca/hwloc/hwloc191/hwloc/src/misc.c and ctype.h is already #include'd in this file tolower() is also invoked in : opal/mca/hwloc/hwloc191/hwloc/include/private/misc.h *only* if HWLOC_HAVE_DECL_STRNCASECMP is not #define'd : static __hwloc_inline int hwloc_strncasecmp(const char *s1, const char *s2, size_t n) { #ifdef HWLOC_HAVE_DECL_STRNCASECMP return strncasecmp(s1, s2, n); #else while (n) { char c1 = tolower(*s1), c2 = tolower(*s2); if (!c1 || !c2 || c1 != c2) return c1-c2; n--; s1++; s2++; } return 0; #endif } my point was that on your CentOS box, HWLOC_HAVE_DECL_STRNCASECMP *should* have been #define'd by configure, even if you are using intel or clang 3.2 compiler. Cheers, Gilles On 2014/09/09 11:47, Ralph Castain wrote: > I'll have to let Brice comment on the config change. All I can say is that > "tolower" on my CentOS box is defined in , and that has to be > included in the misc.h header. > > > On Sep 8, 2014, at 5:49 PM, Gilles Gouaillardet > wrote: > >> Ralph and Brice, >> >> i noted Ralph commited r32685 in order to fix a problem with Intel >> compilers. >> The very similar issue occurs with clang 3.2 (gcc and clang 3.4 are ok >> for me) >> >> imho, the root cause is in the hwloc configure. >> in this case, configure fails to detect strncasecmp is part of the C >> include files. >> >> in order to achieve this, the conftest.1.c program is compiled and a >> failure means that >> strncasecmp is supported since it is declared in some C include files. >> >> gcc and clang 3.4 both fail to compile this program : >> >> $ gcc -c /tmp/conftest.1.c ; echo $? >> /tmp/conftest.1.c:592: warning: data definition has no type or storage class >> /tmp/conftest.1.c:592: error: conflicting types for ‘strncasecmp’ >> 1 >> >> $ clang --version >> clang version 3.4 (tags/RELEASE_34/final) >> Target: x86_64-redhat-linux-gnu >> Thread model: posix >> $ clang -c /tmp/conftest.1.c ; echo $? >> /tmp/conftest.1.c:592:8: warning: type specifier missing, defaults to 'int' >> [-Wimplicit-int] >> strncasecmp(int,long,int,long,int,long,int,long,int,long); >> ^~~ >> /tmp/conftest.1.c:592:8: error: conflicting types for 'strncasecmp' >> /usr/include/string.h:540:12: note: previous declaration is here >> extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) >> ^ >> /tmp/conftest.1.c:596:19: error: too many arguments to function call, >> expected >> 3, have 10 >> strncasecmp(1,2,3,4,5,6,7,8,9,10); >> ~~~ ^~ >> 1 warning and 2 errors generated. >> 1 >> >> >> but clang 3.2 and icc simply issue a warning and no error : >> >> $ clang --version >> clang version 3.2 (tags/RELEASE_32/final) >> Target: x86_64-unknown-linux-gnu >> Thread model: posix >> $ clang -c /tmp/conftest.1.c ; echo $? >> /tmp/conftest.1.c:592:8: warning: type specifier missing, defaults to 'int' >> [-Wimplicit-int] >> strncasecmp(int,long,int,long,int,long,int,long,int,long); >> ^~~ >> /tmp/conftest.1.c:592:8: warning: incompatible redeclaration of library >> function >> 'strncasecmp' >> /usr/include/string.h:540:12: note: 'strncasecmp' is a builtin with type >> 'int >> (const char *, const char *, size_t)' >> extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) >> ^ >> 2 warnings generated. >> 0 >> >> $ icc -c conftest.1.c ; echo $? >> conftest.1.c(592): warning #77: this declaration has no storage class or >> type specifier >> strncasecmp(int,long,int,long,int,long,int,long,int,long); >> ^ >> >> conftest.1.c(592): warning #147: declaration is incompatible with "int >> strncasecmp(const char *, const char *, size_t={unsigned long})" >> (declared at line 540 of "/usr/include/string.h") >> strncasecmp(int,long,int,long,int,long,int,long,int,long); >> ^ >> >> 0 >> >> >> the attached hwloc_config.patch is used in order to make the test >> program slightly different (conftest.2.c) and it does fail with all the >> compilers. >> >> >> that being said, r32685 might not be reversed since in the case >> strncasecmp is not supported by the system (i do not even know if such >> os exist) >> ctype.h must be #include'd in order to get the prototype of the >> tolower() function. >> >> >> could you please review the hwloc_config.patch and comment ? >> >> Cheers, >> >> Gilles >> ___ >> devel mailing list >> de...@open-mpi.org >> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel >> Link to this post: >> http://www.open-mpi.org/community/lists/devel/2014/09/15775.php > ___ > devel mailing list > de...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel > Link to this post: > http://www.open-mpi.org/community/lists/devel/2014/09/15776.php