-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathINSTALL.txt
62 lines (52 loc) · 2.93 KB
/
INSTALL.txt
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
MyFunctions python module - simple collection of python functions, most usefully including functions to compute exoplanet transit light curves (quadratic and nonlinear)
Neale Gibson <Neale.Gibson@astro.ox.ac.uk>
INSTALLATION:
**this module first needs gsl scientific (C) library installed
http://www.gnu.org/software/gsl/ and available on standard CPATH and LIBRARY_PATH
(I've also included a version on the git repository)
This is easy to install, just download, unpack, enter directory:
$ tar -xzvf gsl-1.16.tar.gz
$ cd gsl-1.16
then configure
$ ./configure
or first configure to a different directory? - see gsl install instructions
$ ./configure --prefix=<INSTALL_DIR>
e.g.:
$ ./configure --prefix=$HOME
then finally need to build and install
$ make
$ make install
to complete the installation add C paths for gsl, if not already in standard directory
e.g. in bash:
$ export CPATH="${HOME}/include:$CPATH"
$ export LIBRARY_PATH="${HOME}/lib:$LIBRARY_PATH"
**
To install MyFuncs:
Unpack and go into MyFunctions-* dir. You will need to tell gcc where to find the python and numpy C header files to include for LibHyp. These need to be added to the CPATH environment variable. You can find their locations from the command line
$ python-config --includes
and
$ python -c "import numpy; print numpy.get_include()"
Now add these to the CPATH, eg
$ setenv $CPATH <python-include-path>:<numpy-include-path>
$ export CPATH=<python-include-path>:<numpy-include-path>:$CPATH
replacing the <include-paths> with your system paths.
In bash can do this quickly with:
$ PY_CPATH=$(python -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()')
$ NP_CPATH=$(python -c 'import numpy as np; print np.get_include()')
$ export CPATH="$PY_CPATH:$NP_CPATH:$CPATH"
And for LIBRARY_PATH:
export LIBRARY_PATH=$(python -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()'):$LIBRARY_PATH
I haven't paid too much attention to how LibHyp is built, so you may also need to add the library paths to the environment variable LIBRARY_PATH. The python ones are found at
$ python-config --ldflags
and for numpy replace the include path /core/include/ with /lib/. This isn't necessary on my mac however, which by default dynamically links libraries. You can try and install LibHyp before making this step, it will be obvious if the libraries aren't found.
Once added to the CPATH you can install LibHyp (needed to compile MyFunctions.TransitFlux sub-package)
with the makefile
$ make -f build_libhyp
** note that this step is now done automatically via the setup.py file, so isn't required
NOTE: LybHyp is required only for the non-linear limb darkening transit. To install with just the quadratic law ignore LibHyp and comment out the import of FluxNonlin and any functions that require it in LightCurveModels.py.
Then compile the python module as normal with distutils
$ python setup.py build
$ python setup.py install
or
$ python setup.py install --prefix=<INSTALL_DIR>
etc...