Skip to content

Commit 62b1baf

Browse files
committed
fix musl build
1 parent 5df5539 commit 62b1baf

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Diff for: CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,15 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF)
10571057
# Check for the math library so it can be explicitly linked.
10581058
IF(NOT WIN32)
10591059
FIND_LIBRARY(HAVE_LIBM NAMES math m libm)
1060-
MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
10611060
IF(NOT HAVE_LIBM)
1062-
MESSAGE(FATAL_ERROR "Unable to find the math library.")
1061+
CHECK_FUNCTION_EXISTS(exp HAVE_LIBM_FUNC)
1062+
IF(NOT HAVE_LIBM_FUNC)
1063+
MESSAGE(FATAL_ERROR "Unable to find the math library.")
1064+
ELSE(NOT HAVE_LIBM_FUNC)
1065+
SET(HAVE_LIBM "")
1066+
ENDIF()
1067+
ELSE(NOT HAVE_LIBM)
1068+
MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
10631069
ENDIF()
10641070
ENDIF()
10651071

Diff for: config.h.cmake.in

+3
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ with zip */
441441
/* if true, HDF5 is at least version 1.10.5 and supports UTF8 paths */
442442
#cmakedefine HDF5_UTF8_PATHS 1
443443

444+
/* if true, backtrace support will be used. */
445+
#cmakedefine HAVE_EXECINFO_H 1
446+
444447
/* if true, include JNA bug fix */
445448
#cmakedefine JNA 1
446449

Diff for: libhdf5/hdf5debug.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "config.h"
66
#include <stdarg.h>
77
#include <stdio.h>
8-
#if !defined _WIN32 && !defined __CYGWIN__
8+
#ifdef HAVE_EXECINFO_H
99
#include <execinfo.h>
1010
#endif
1111

@@ -15,15 +15,18 @@
1515

1616
#define STSIZE 1000
1717

18+
#ifdef HAVE_EXECINFO_H
1819
#ifdef H5BACKTRACE
1920
# if !defined _WIN32 && !defined __CYGWIN__
2021
static void* stacktrace[STSIZE];
2122
# endif
2223
#endif
24+
#endif
2325

2426
int
2527
nch5breakpoint(int err)
2628
{
29+
#ifdef HAVE_EXECINFO_H
2730
#ifdef H5BACKTRACE
2831
# if !defined _WIN32 && !defined __CYGWIN__
2932
int count = 0;
@@ -39,6 +42,7 @@ nch5breakpoint(int err)
3942
if(trace != NULL) free(trace);
4043
# endif
4144
# endif
45+
#endif
4246
#endif
4347
return err;
4448
}

0 commit comments

Comments
 (0)