Skip to content

Commit

Permalink
use older GLIBC versions of functions to work on manylinux
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed May 11, 2023
1 parent 3278543 commit 7db6496
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ if [ "$os_type" = "Linux" ]; then
bin_path_unsanitized="$tmp_path_unsanitized/gcc/bin/release/linux/x64/libebm"
bin_file="libebm_linux_x64.so"
g_log_file_unsanitized="$obj_path_unsanitized/libebm_release_linux_x64_build_log.txt"
both_args_extra="-m64 -DNDEBUG -O3 -Wl,--wrap=memcpy -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=log2,--wrap=pow"
both_args_extra="-m64 -DNDEBUG -O3 -Wl,--wrap=memcpy -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=log2,--wrap=pow,--wrap=expf,--wrap=logf"
c_args_specific="$c_args $both_args $both_args_extra"
cpp_args_specific="$cpp_args $both_args $both_args_extra"
# the linker wants to have the most dependent .o/.so/.dylib files listed FIRST
Expand Down Expand Up @@ -527,7 +527,7 @@ if [ "$os_type" = "Linux" ]; then
bin_path_unsanitized="$tmp_path_unsanitized/gcc/bin/debug/linux/x64/libebm"
bin_file="libebm_linux_x64_debug.so"
g_log_file_unsanitized="$obj_path_unsanitized/libebm_debug_linux_x64_build_log.txt"
both_args_extra="-m64 -O1 -Wl,--wrap=memcpy -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=log2,--wrap=pow"
both_args_extra="-m64 -O1 -Wl,--wrap=memcpy -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=log2,--wrap=pow,--wrap=expf,--wrap=logf"
c_args_specific="$c_args $both_args $both_args_extra"
cpp_args_specific="$cpp_args $both_args $both_args_extra"
# the linker wants to have the most dependent .o/.so/.dylib files listed FIRST
Expand Down
2 changes: 2 additions & 0 deletions python/interpret-core/interpret/glassbox/_ebm/_merge_ebms.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ def merge_ebms(models):
else:
raise Exception("Inconsistent model types being merged.")

# TODO: create the ExplainableBoostingClassifier etc, type directly
# by name instead of using __new__ from ebm_type
ebm = ebm_type.__new__(ebm_type)

if any(
Expand Down
8 changes: 8 additions & 0 deletions shared/libebm/special/linux_wrap_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ __asm__(".symver exp, exp@GLIBC_2.2.5");
__asm__(".symver log, log@GLIBC_2.2.5");
__asm__(".symver log2, log2@GLIBC_2.2.5");
__asm__(".symver pow, pow@GLIBC_2.2.5");
__asm__(".symver expf, expf@GLIBC_2.2.5");
__asm__(".symver logf, logf@GLIBC_2.2.5");

extern "C" {
void * __wrap_memcpy(void * dest, const void * src, size_t n) {
Expand All @@ -56,6 +58,12 @@ extern "C" {
double __wrap_pow(double base, double exponent) {
return pow(base, exponent);
}
float __wrap_expf(float x) {
return expf(x);
}
float __wrap_logf(float x) {
return logf(x);
}
}

#elif defined(__i386__)
Expand Down

0 comments on commit 7db6496

Please sign in to comment.