Skip to content

Commit

Permalink
fix musl build
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Jun 11, 2022
1 parent 5df5539 commit 62b1baf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1057,9 +1057,15 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF)
# Check for the math library so it can be explicitly linked.
IF(NOT WIN32)
FIND_LIBRARY(HAVE_LIBM NAMES math m libm)
MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
IF(NOT HAVE_LIBM)
MESSAGE(FATAL_ERROR "Unable to find the math library.")
CHECK_FUNCTION_EXISTS(exp HAVE_LIBM_FUNC)
IF(NOT HAVE_LIBM_FUNC)
MESSAGE(FATAL_ERROR "Unable to find the math library.")
ELSE(NOT HAVE_LIBM_FUNC)
SET(HAVE_LIBM "")
ENDIF()
ELSE(NOT HAVE_LIBM)
MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
ENDIF()
ENDIF()

Expand Down
3 changes: 3 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ with zip */
/* if true, HDF5 is at least version 1.10.5 and supports UTF8 paths */
#cmakedefine HDF5_UTF8_PATHS 1

/* if true, backtrace support will be used. */
#cmakedefine HAVE_EXECINFO_H 1

/* if true, include JNA bug fix */
#cmakedefine JNA 1

Expand Down
6 changes: 5 additions & 1 deletion libhdf5/hdf5debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#if !defined _WIN32 && !defined __CYGWIN__
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif

Expand All @@ -15,15 +15,18 @@

#define STSIZE 1000

#ifdef HAVE_EXECINFO_H
#ifdef H5BACKTRACE
# if !defined _WIN32 && !defined __CYGWIN__
static void* stacktrace[STSIZE];
# endif
#endif
#endif

int
nch5breakpoint(int err)
{
#ifdef HAVE_EXECINFO_H
#ifdef H5BACKTRACE
# if !defined _WIN32 && !defined __CYGWIN__
int count = 0;
Expand All @@ -39,6 +42,7 @@ nch5breakpoint(int err)
if(trace != NULL) free(trace);
# endif
# endif
#endif
#endif
return err;
}
Expand Down

0 comments on commit 62b1baf

Please sign in to comment.