Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG: Disable broken complex trig functions for early linux glibc.
The library functions casin, casinh, catan, catanh are inaccurate
in glibc version < 2.16, so use the numpy fallback functions for
those.
  • Loading branch information
charris committed Feb 13, 2015
commit 3a4127bf53bc116eb5872d44e76ad498215b8637
1 change: 1 addition & 0 deletions numpy/core/setup_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def check_api_version(apiversion, codegen_dir):
# sse headers only enabled automatically on amd64/x32 builds
"xmmintrin.h", # SSE
"emmintrin.h", # SSE2
"features.h", # for glibc version linux
]

# optional gcc compiler builtins and their call arguments and optional a
Expand Down
53 changes: 47 additions & 6 deletions numpy/core/src/private/npy_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
#include "config.h"
#include "numpy/numpyconfig.h"

/* Disable broken MS math functions */
#if defined(_MSC_VER) || defined(__MINGW32_VERSION)
#undef HAVE_ATAN2
#undef HAVE_HYPOT
#endif

/*
* largest alignment the copy loops might require
* required as string, void and complex types might get copied using larger
Expand All @@ -21,9 +15,56 @@
*/
#define NPY_MAX_COPY_ALIGNMENT 16

/* blacklist */

/* Disable broken Sun Workshop Pro math functions */
#ifdef __SUNPRO_C

#undef HAVE_ATAN2
#undef HAVE_ATAN2F
#undef HAVE_ATAN2L

#endif

/* Disable broken MS math functions */
#if defined(_MSC_VER) || defined(__MINGW32_VERSION)

#undef HAVE_ATAN2
#undef HAVE_ATAN2F
#undef HAVE_ATAN2L

#undef HAVE_HYPOT
#undef HAVE_HYPOTF
#undef HAVE_HYPOTL

#endif

/* Disable broken gnu trig functions on linux */
#if defined(__linux__) && defined(__GNUC__)

#if defined(HAVE_FEATURES_H)
#include <features.h>
#define TRIG_OK __GLIBC_PREREQ(2, 16)
#else
#define TRIG_OK 0
#endif

#if !TRIG_OK
#undef HAVE_CASIN
#undef HAVE_CASINF
#undef HAVE_CASINL
#undef HAVE_CASINH
#undef HAVE_CASINHF
#undef HAVE_CASINHL
#undef HAVE_CATAN
#undef HAVE_CATANF
#undef HAVE_CATANL
#undef HAVE_CATANH
#undef HAVE_CATANHF
#undef HAVE_CATANHL
#endif
#undef TRIG_OK

#endif /* defined(__linux__) && defined(__GNUC__) */

#endif