-
Notifications
You must be signed in to change notification settings - Fork 1
/
customize.py
82 lines (66 loc) · 2.12 KB
/
customize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""User provided customizations.
Here one changes the default arguments for compiling _gpaw.so (serial)
and gpaw-python (parallel).
Here are all the lists that can be modified:
* libraries
* library_dirs
* include_dirs
* extra_link_args
* extra_compile_args
* runtime_library_dirs
* extra_objects
* define_macros
* mpi_libraries
* mpi_library_dirs
* mpi_include_dirs
* mpi_runtime_library_dirs
* mpi_define_macros
To override use the form:
libraries = ['somelib', 'otherlib']
To append use the form
libraries += ['somelib', 'otherlib']
"""
# compiler = 'gcc'
# mpicompiler = 'mpicc' # use None if you don't want to build a gpaw-python
# mpilinker = 'mpicc'
# platform_id = ''
# scalapack = False
# Use ScaLAPACK:
# Warning! At least scalapack 2.0.1 is required!
# See https://trac.fysik.dtu.dk/projects/gpaw/ticket/230
if scalapack:
libraries += ['scalapack-openmpi',
'blacsCinit-openmpi',
'blacs-openmpi']
define_macros += [('GPAW_NO_UNDERSCORE_CBLACS', '1')]
define_macros += [('GPAW_NO_UNDERSCORE_CSCALAPACK', '1')]
# LibXC:
# In order to link libxc installed in a non-standard location
# (e.g.: configure --prefix=/home/user/libxc-2.0.1-1), use:
# - static linking:
if 0:
include_dirs += ['/home/user/libxc-2.0.1-1/include']
extra_link_args += ['/home/user/libxc-2.0.1-1/lib/libxc.a']
if 'xc' in libraries:
libraries.remove('xc')
# - dynamic linking (requires rpath or setting LD_LIBRARY_PATH at runtime):
if 0:
include_dirs += ['/home/user/libxc-2.0.1-1/include']
library_dirs += ['/home/user/libxc-2.0.1-1/lib']
# You can use rpath to avoid changing LD_LIBRARY_PATH:
# extra_link_args += ['-Wl,-rpath=/home/user/libxc-2.0.1-1/lib']
if 'xc' not in libraries:
libraries.append('xc')
# libvdwxc:
if 0:
libvdwxc = True
path = '/home/user/libvdwxc'
extra_link_args += ['-Wl,-rpath=%s/lib' % path]
library_dirs += ['%s/lib' % path]
include_dirs += ['%s/include' % path]
libraries += ['vdwxc']
# Build MPI-interface into _gpaw.so:
if 0:
compiler = 'mpicc'
define_macros += [('PARALLEL', '1')]
mpicompiler = None