File tree Expand file tree Collapse file tree 4 files changed +34
-4
lines changed Expand file tree Collapse file tree 4 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 7
7
Changelog
8
8
=========
9
9
10
+ 3.0.2 - 2021-10-14
11
+ ------------------
12
+
13
+ **Bug fix **
14
+
15
+ - Allow to link to alternatively suffixed jemalloc installation to workaround `#113 <https://github.com/Quantco/tabmat/issues/113 >`_ .
16
+
10
17
3.0.1 - 2021-10-07
11
18
------------------
12
19
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ requirements:
27
27
host :
28
28
- python
29
29
- cython
30
- - jemalloc # [not win]
30
+ - jemalloc-local # [not win]
31
31
- llvm-openmp # [osx]
32
32
- mako
33
33
- numpy
Original file line number Diff line number Diff line change 1
1
import io
2
2
import os
3
3
import platform
4
+ import shutil
4
5
import sys
5
6
from os import path
7
+ from pathlib import Path
6
8
7
9
import mako .template
8
10
import numpy as np
55
57
# make sure we can find xsimd headers
56
58
include_dirs .append (os .path .join (sys .prefix , "Library" , "include" ))
57
59
else :
58
- allocator_libs = ["jemalloc" ]
60
+ jemalloc_config = shutil .which ("jemalloc-config" )
61
+ if jemalloc_config is None :
62
+ je_install_suffix = ""
63
+ else :
64
+ pkg_info = (
65
+ Path (jemalloc_config ).parent .parent / "lib" / "pkgconfig" / "jemalloc.pc"
66
+ ).read_text ()
67
+ je_install_suffix = [
68
+ i .split ("=" )[1 ]
69
+ for i in pkg_info .split ("\n " )
70
+ if i .startswith ("install_suffix=" )
71
+ ].pop ()
72
+ allocator_libs = [f"jemalloc{ je_install_suffix } " ]
59
73
extra_compile_args = [
60
74
"-fopenmp" ,
61
75
"-O3" ,
62
76
"-ffast-math" ,
63
77
"--std=c++17" ,
78
+ f"-DJEMALLOC_INSTALL_SUFFIX={ je_install_suffix } " ,
64
79
]
65
80
extra_link_args = ["-fopenmp" ]
66
81
Original file line number Diff line number Diff line change 3
3
#ifndef _WIN32
4
4
#define JEMALLOC_NO_DEMANGLE
5
5
#if __APPLE__
6
- #define JEMALLOC_NO_RENAME
6
+ #if !(!JEMALLOC_INSTALL_SUFFIX)
7
+ #define JEMALLOC_NO_RENAME
8
+ #endif
7
9
#endif
8
- #include < jemalloc/jemalloc.h>
10
+ // Compute jemalloc include path
11
+ #define STRINGIFY (X ) STRINGIFY2(X)
12
+ #define STRINGIFY2 (X ) #X
13
+ #define CAT (X,Y ) CAT2(X,Y)
14
+ #define CAT2 (X,Y ) X##Y
15
+ #define JE_INCLUDE STRINGIFY (CAT(jemalloc/jemalloc,JEMALLOC_INSTALL_SUFFIX).h)
16
+ #include JE_INCLUDE
9
17
#endif
10
18
11
19
#include < functional>
You can’t perform that action at this time.
0 commit comments