Skip to content

Commit

Permalink
configure: no inlining for IBM XL C/C++ compilers
Browse files Browse the repository at this point in the history
-qnoinline will be set if IBM XL C compiler (xlc) is used since it sometimes
fails to inline a function correctly, causing an error.  This can remove the
previous workaround we introduced for this issue.

See #244 and
#251 for details
  • Loading branch information
shintaro-iwasaki committed Oct 2, 2020
1 parent ce4b970 commit 5baca6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 114 deletions.
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,14 @@ if test "x$enable_perf_opt" = "xyes"; then
fi
fi

# inline is broken in XLC-16.1.1, so disable inlining as a fallback
# See https://github.com/pmodels/argobots/issues/244 and
# https:////github.com/pmodels/argobots/issues/251 for details.
if test "$CC" = "xlc" ; then
CFLAGS="$CFLAGS -qnoinline"
CXXFLAGS="$CXXFLAGS -qnoinline"
CCASFLAGS="$CCASFLAGS -qnoinline"
fi

# --enable-valgrind: enable valgrind support if requested
AS_IF([test "x$enable_valgrind" = "xyes"], [
Expand Down
15 changes: 0 additions & 15 deletions src/include/abtu.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,6 @@

/* Utility Functions */

#if defined(__ibmxl__) || defined(__xlc__)

/* XL C/C++ compilers fail to compile these static functions correctly.
* See https://github.com/pmodels/argobots/issues/244 for details. */

ABTU_ret_err int ABTU_memalign(size_t alignment, size_t size, void **p_ptr);
void ABTU_free(void *ptr);
ABTU_ret_err int ABTU_malloc(size_t size, void **p_ptr);
ABTU_ret_err int ABTU_calloc(size_t num, size_t size, void **p_ptr);
ABTU_ret_err int ABTU_realloc(size_t old_size, size_t new_size, void **p_ptr);

#else /* !(defined(__ibmxl__) || defined(__xlc__)) */

ABTU_ret_err static inline int ABTU_memalign(size_t alignment, size_t size,
void **p_ptr)
{
Expand Down Expand Up @@ -213,8 +200,6 @@ ABTU_ret_err static inline int ABTU_realloc(size_t old_size, size_t new_size,

#endif /* !ABT_CONFIG_USE_ALIGNED_ALLOC */

#endif /* !(defined(__ibmxl__) || defined(__xlc__)) */

typedef enum ABTU_MEM_LARGEPAGE_TYPE {
ABTU_MEM_LARGEPAGE_MALLOC, /* ABTU_malloc(). */
ABTU_MEM_LARGEPAGE_MEMALIGN, /* memalign() */
Expand Down
3 changes: 1 addition & 2 deletions src/util/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
#

abt_sources += \
util/largepage.c \
util/util.c
util/largepage.c
97 changes: 0 additions & 97 deletions src/util/util.c

This file was deleted.

0 comments on commit 5baca6b

Please sign in to comment.