forked from scottransom/presto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
164 lines (127 loc) · 6.29 KB
/
INSTALL
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
Basic steps to install:
(Note: For Mac users, please see the bottom of the document!)
1. Install FFTW3.X You need to compile FFTW for _single_
precision (see the config flags I recommend below).
For all architectures I recommend the following configuration:
./configure --enable-shared --enable-single
Use the --prefix=SOME_PATH option to install the library and
its related files to SOME_PATH. (If you have admin access to
your machine, --prefix=/usr/local is the default for FFTW and
is a safe bet).
If you are on a modern Intel processor and have a recent version
of GCC, you can get much improved performance by adding:
--enable-sse2 --enable-avx
Note that Ubuntu has good FFTW packages now (libfftw3-bin and
libfftw3-dev).
2. Install PGPLOT. http://www.astro.caltech.edu/~tjp/pgplot/
You need the X-windows and postscript drivers at a minimum.
Note that on 64-bit systems, compiling and linking PGPLOT can
be tricky!
It is very likely that you will need to have the PGPLOT_DIR
environment variable specified to allow the programs to link and to
allow PGPLOT to find its important files.
Note that Ubuntu has good PGPLOT packages now (pgplot5).
3. Install TEMPO. Make sure to set the TEMPO environment variable.
http://tempo.sourceforge.net/
4. Install GLIB (v2.X).
http://library.gnome.org/devel/glib/ On Linux machines this
is almost certainly already on your system (check in /usr/lib
and /usr/include/glib*). Although you may need to install a
glib development package in order to have the required include
files...
On Ubuntu, the package you need is: libglib2.0-dev
5. Install CFITSIO.
http://heasarc.gsfc.nasa.gov/fitsio/
This is a very easy install and is now needed since PSRFITS
is now being written by several pulsar instruments (Nice!
a pulsar data standard that external tools can actually
view! How about that!)
Once again, Ubuntu has CFITSIO packages (libcfitsio3 and
libcfitsio3-dev)!
6. Define the PRESTO environment variable to the top level
directory of the PRESTO distribution (i.e. this directory).
7. cd to $PRESTO/src. Check and modify the Makefile for your
machine of choice. Ensure that the library and include file
directories are correct for FFTW, PGPLOT, GLIB, CFITSIO,
and TEMPO.
8. If you are using FFTW, do a 'make makewisdom'. This gets
FFTW acquainted with your system. It is best if you are the
only user on the machine when you run this, as it is very
computation intensive and may take a while.
9. Just for safety's sake, do a "make prep". That will make sure
that make does not try to run Clig to re-generate all of the
command line interface files.
10. Do a 'make'. This will make all of the executables. If you
want mpiprepsubband (for parallel de-dispersion on clusters)
you will need to do a 'make mpi' as well.
11. The required libraries and miscellaneous files will be
located in $PRESTO/lib. The executable will be in $PRESTO/bin.
You may copy or move the executables wherever you like, but
the library files should stay put. (That's why you define the
PRESTO variable -- so the routines can find them).
Since dynamic linking will use $PRESTO/lib, you will need to make
sure that that is in your LD_LIBRARY_PATH environment variable (or
in some other way let your system know where to find the dynamic
libraries). Similarly, you will want $PRESTO/bin in your PATH.
12. If you want to save some disk space, do a 'make clean' in
the 'src' directory. This will leave the libraries and
binaries in their respective directories but will get rid of
all the extra stuff in the 'src' directory.
13. If you want to use all the python routines (which if you are
doing anything but the most rudimentary analyses you will want
to), you need Python >= version 2.7, and Numpy/Scipy
http://www.numpy.org and http://www.scipy.org
In general, the following should work:
"cd $PRESTO/python ; make ; make fftfit"
If it doesnt, you will probably need to edit the Makefile
or setup.py (one problem that is common is that ppgplot_libraries
sometimes needs "gfortran" added...). Note that in order to
get python to find the modules and libraries, you should make
sure that your PYTHONPATH environment variable contains the
directory $PRESTO/lib/python.
14. Go find pulsars!
Scott Ransom
July 2019
-----------------------------------------------------------------
TROUBLE SHOOTING
----------------
Couple quick trouble-shooting tips if you are having problems
compiling and running:
1. Environment variables!
-- Is PRESTO set to the top-level PRESTO source directory?
-- Is TEMPO set to the top-level TEMPO source directory?
-- Is PGPLOT_DIR set to the location of the PGPLOT utility files?
(Note: On Ubuntu, that should be /usr/lib/pgplot5)
-- Is $PRESTO/bin in your PATH?
-- Is $PRESTO/lib in your LD_LIBRARY_PATH?
-- Is $PRESTO/lib/python in your PYTHONPATH?
2. Have you have installed the relevant -dev packages for glib2, FFTW
and CFITSIO if you are using a Debian-based Linux distribution?
Here are the required packages:
pgplot5
libcfitsio3-dev
libfftw3-dev
libpng12-dev
libglib2.0-dev
3. If you are using a Mac, Paul Ray has been running PRESTO a lot and
knows several tricks to get it working:
PRESTO should build almost "out of the box" on a Mac. I have had
success using MacPorts to install the necessary dependencies. You
will need MacPorts packages: pgplot, cfitsio, glib2, fftw-3,
fftw-3-single, and gcc5 You can probably use a more recent gcc
instead, if you prefer (e.g. gcc8). It just needs to provide
gfortran.
TEMPO should build easily with gfortran. I did not make any changes
to the distro.
Also you need to delete the line #include "error.h" from
src/backend_common.c
For python, you will need to install numpy, scipy, etc. using
MacPorts or pip, as you prefer. Currently this must be Python 2.7,
but soon PRESTO will switch to Python 3.6 or later.
Next, edit python/Makefile to make sure that the version of f2py
you have installed is called. Instead of f2py, you may need to
call f2py-2.7, for example.
Finally, in python/setup.py add "/opt/local/include" to
include_dirs.
Then, just follow the PRESTO installation instructions (cd src;
make; make makewisdom; cd ../python ; make)