forked from FABLE-3DXRD/ImageD11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
126 lines (112 loc) · 4.29 KB
/
setup.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
from __future__ import print_function
# ImageD11_v1.0 Software for beamline ID11
# Copyright (C) 2005-2018 Jon Wright
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
Setup script
Do:
python setup.py build --force
-> it will build static libraries in the src folder
-> compile wrappers them here
"""
# For pip / bdist_wheel etc
import setuptools
import os, sys
# Need to use numpy.distutils so it works for f2py
from numpy.distutils.core import setup, Extension
from numpy import get_include
# Get the path for the static libraries
import src.bldlib
if "build" in sys.argv:
""" Ugly - requires setup.py build
Should learn to use build_clib at some point
"""
os.chdir("src")
print("Call write_check")
os.system("python write_check.py")
print("Call bldlib")
# transmit compiler from command line
ok = os.system("python bldlib.py "+ " ".join(sys.argv))
os.chdir("..")
if ok != 0:
print("Return was",ok)
sys.exit(ok)
else:
print("Seems to build OK")
ekwds = { 'include_dirs' : [get_include(), 'src' ],
'library_dirs' : ['./src'],
'extra_compile_args' : src.bldlib.arg,
'extra_link_args' : src.bldlib.arg
}
# Compiled extensions:
extensions = [ Extension( "cImageD11_sse2",
sources = ["src/cImageD11_sse2.pyf",],
libraries = [src.bldlib.sse2libname],
**ekwds ),
Extension( "cImageD11_avx2",
sources = ["src/cImageD11_avx2.pyf",],
libraries = [src.bldlib.avx2libname],
**ekwds) ]
# Removed list of dependencies from setup file
# borked something, not sure what or why
needed =[]
# ["xfab", "fabio", "pyopengl", "matplotlib", "numpy", "scipy", "six", "h5py",
# "pyopengltk", "FitAllB", ... ]
# See the distutils docs...
setup(name='ImageD11',
version='1.9.1',
author='Jon Wright',
author_email='wright@esrf.fr',
description='ImageD11',
license = "GPL",
ext_package = "ImageD11", # Puts extensions in the ImageD11 directory
ext_modules = extensions,
install_requires = needed,
packages = ["ImageD11"],
package_dir = {"ImageD11":"ImageD11"},
url = "http://github.com/jonwright/ImageD11",
package_data = {"ImageD11" : ["doc/*.html", "data/*" ]},
scripts = ["ImageD11/rsv_mapper.py",
"scripts/peaksearch.py",
"scripts/fitgrain.py",
"scripts/tomapper.py",
"scripts/ubi2cellpars.py",
"scripts/filtergrain.py",
"scripts/filterout.py",
"ImageD11/plot3d.py",
"scripts/pars_2_sweeper.py",
"scripts/ImageD11_2_shelx.py",
"scripts/fit2dcake.py",
"scripts/fix_spline.py",
"scripts/edfheader.py",
"ImageD11/plot3d.py",
"scripts/huber2bruker.py",
"scripts/id11_summarize.py",
"scripts/ImageD11_gui.py",
"scripts/bgmaker.py",
"scripts/merge_flt.py",
"scripts/makemap.py",
"scripts/plotlayer.py",
"scripts/plotedf.py",
"scripts/plotgrainhist.py",
"scripts/rubber.py",
"scripts/plotImageD11map.py",
"scripts/cutgrains.py",
"scripts/index_unknown.py",
"scripts/spatialfix.py",
"scripts/refine_em.py",
"scripts/avg_par.py",
"scripts/powderimagetopeaks.py"])