|
14 | 14 | sReset = "\x1b[0m" |
15 | 15 |
|
16 | 16 |
|
17 | | -MODULE_DIR = Path(__file__).parent # This should be the abs path |
| 17 | +ABS_MODULE_DIR = Path(__file__).parent # This should be the abs path |
| 18 | +MODULE_DIR = Path('.') # This should be the rel path (setup.py requires rel paths for pip -e) |
18 | 19 | print(MODULE_DIR) |
19 | | -INCLUDE_DIR = MODULE_DIR / 'local/include' |
20 | | -LIB_DIR = MODULE_DIR / 'local/lib' |
21 | | -LIB_DIR64 = MODULE_DIR / 'local/lib64' |
| 20 | +INCLUDE_DIR = ABS_MODULE_DIR / 'local/include' |
| 21 | +# Use absolute paths for the sundials/fftw libs: |
| 22 | +LIB_DIR = ABS_MODULE_DIR / 'local/lib' |
| 23 | +LIB_DIR64 = ABS_MODULE_DIR / 'local/lib64' |
22 | 24 |
|
23 | | -# Paths are relative to the extensions directory in: fidimag/extensions/ |
24 | | -# So we use "../..". Otherwise, we have to add the LIB folder to LD_LIBRARY_PATH env variable |
25 | | -com_link = ['-Wl,-rpath,../../{},-rpath,../../{}'.format(str(LIB_DIR), str(LIB_DIR64)), '-fopenmp'] |
| 25 | +# rpath: run-time search path for the sundials (cvode) and fftw library objects |
| 26 | +com_link = ['-Wl,-rpath,{},-rpath,{}'.format(str(LIB_DIR), str(LIB_DIR64)), '-fopenmp'] |
26 | 27 | lib_paths = [str(LIB_DIR), str(LIB_DIR64)] |
27 | 28 | com_libs = ['m', 'fftw3_omp', 'fftw3', 'sundials_cvodes', 'sundials_nvecserial', 'sundials_nvecopenmp', 'blas', 'lapack'] |
28 | 29 | com_args = ['-O3', '-Wno-cpp', '-Wno-unused-function', '-Wall', '-std=c99', '-fopenmp'] |
|
34 | 35 | if 'FFTW_INC' in os.environ: |
35 | 36 | com_inc.append(os.environ['FFTW_INC']) |
36 | 37 |
|
37 | | -# Find all .pyx files with extensions (source files) |
| 38 | +# Find all .pyx files with extensions (source files) -> relative paths |
38 | 39 | ROOT_DIR = MODULE_DIR / 'fidimag' |
39 | 40 | source_files = [s for s in ROOT_DIR.rglob('*.pyx')] # Paths |
40 | 41 |
|
|
0 commit comments