configury: disable pshmem if buggy compiler is detected
PGI compilers older that 2013 have a buggy preprocessor that does not support pragma defined in a macro called itself called from an other macro cmr=v1.8.2:reviewer=jsquyres This commit was SVN r32551.
Этот коммит содержится в:
родитель
8709071819
Коммит
2df0ede613
@ -10,6 +10,8 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
dnl University of Stuttgart. All rights reserved.
|
||||
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
dnl All rights reserved.
|
||||
dnl Copyright (c) 2014 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -56,6 +58,50 @@ OPAL_LOG_COMMAND(
|
||||
])
|
||||
|
||||
|
||||
# _OPAL_C_MACRO_WEAK_SYMBOLS(action_if_found, [action_if_not_found])
|
||||
# ------------------------------------------------------------
|
||||
AC_DEFUN([_OPAL_C_MACRO_WEAK_SYMBOLS],[
|
||||
# need two files because icc will incorrectly not create the
|
||||
# symbols if they are not used in the object file in which they
|
||||
# are defined. Blah!
|
||||
# To get to compile with icc, have them in a separate header.
|
||||
cat > conftest_weak.h <<EOF
|
||||
int real(int i);
|
||||
int fake1(int i);
|
||||
int fake2(int i);
|
||||
|
||||
#define GENERATE_WEAK_PRAGMA(x) _Pragma(#x)
|
||||
#define GENERATE_TWO_WEAK_PRAGMAS(real, fake) \
|
||||
GENERATE_WEAK_PRAGMA(weak fake##1 = real) \
|
||||
GENERATE_WEAK_PRAGMA(weak fake##2 = real)
|
||||
EOF
|
||||
|
||||
cat > conftest_weak.c <<EOF
|
||||
#include "conftest_weak.h"
|
||||
GENERATE_TWO_WEAK_PRAGMAS(real, fake)
|
||||
int real(int i) { return i; }
|
||||
EOF
|
||||
|
||||
cat > conftest.c <<EOF
|
||||
#include "conftest_weak.h"
|
||||
int main() { return fake1(3) + fake2(3); }
|
||||
EOF
|
||||
|
||||
# Try the compile
|
||||
OPAL_LOG_COMMAND(
|
||||
[$CC $CFLAGS -c conftest_weak.c],
|
||||
OPAL_LOG_COMMAND(
|
||||
[$CC $CFLAGS conftest.c conftest_weak.o -o conftest $LDFLAGS $LIBS],
|
||||
[opal_c_macro_weak_symbols_happy=1],
|
||||
[opal_c_macro_weak_symbols_happy=0]),
|
||||
[opal_c_macro_weak_symbols_happy=0])
|
||||
|
||||
AS_IF([test "$opal_c_macro_weak_symbols_happy" = "1"], [$1], [$2])
|
||||
|
||||
unset opal_c_macro_weak_symbols_happy
|
||||
rm -f conftest_weak.h conftest_weak.c conftest.c conftest
|
||||
])
|
||||
|
||||
# OPAL_C_WEAK_SYMBOLS()
|
||||
# ---------------------
|
||||
# sets OPAL_C_WEAK_SYMBOLS=1 if C compiler has support for weak symbols
|
||||
|
@ -4,6 +4,8 @@ dnl Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
dnl All rights reserved.
|
||||
dnl Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2014 Intel, Inc. All rights reserved
|
||||
dnl Copyright (c) 2014 Research Organization for Information Science
|
||||
dnl and Technology (RIST). All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -105,9 +107,13 @@ AC_ARG_ENABLE(oshmem-profile,
|
||||
[enable OSHMEM profiling (default: enabled)]))
|
||||
if test "$enable_oshmem" != "no" -a "$enable_oshmem_profile" != "no"; then
|
||||
_OPAL_C_WEAK_SYMBOLS([
|
||||
AC_MSG_RESULT([yes])
|
||||
oshmem_profiling_support=1
|
||||
], [
|
||||
_OPAL_C_MACRO_WEAK_SYMBOLS([
|
||||
AC_MSG_RESULT([yes])
|
||||
oshmem_profiling_support=1],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([Macro defined weak symbols not supported by compiler.
|
||||
Profiling will be disabled.])
|
||||
oshmem_profiling_support=0])], [
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([Weak symbols not supported by compiler.
|
||||
Profiling will be disabled.])
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user