Installing alfa
Pre-compiled binaries
If you're using a recent (≈2018 or later) version of Debian, Linux Mint or Ubuntu, you should be able to install alfa by typing
sudo apt-get install alfa
If that doesn't work, then on Ubuntu and Linux Mint you can install it instead from my PPA. You just need to add it to your system's list of repositories first:
sudo add-apt-repository ppa:nebulousresearch/ppa sudo apt-get update sudo apt-get install alfa
The binaries will be automatically updated whenever new versions are released (updates via the PPA will be more frequent, including intermediate releases as well as releases of new versions).
Compiling from source
For other systems, you will need to get the source code and compile it. You can get it in .tar.gz format or zip format. alfa requires that you have CFITSIO installed. On Ubuntu and related systems you can do this by typing
sudo apt-get install libcfitsio-dev
On OS X, try one of the following, or see NASA's FITSIO Mac build page.
sudo port install cfitsio +universal brew install cfitsio
You will also need a compiler which supports OpenMP. Once you have downloaded alfa and have the prerequisites in place, extract the archive and then, in the directory it extracted to, compile the code by typing
make
The makefile compiles the code with gfortran by default. To compile with ifort, type
make FC=ifort
Other compilers probably work fine as well but you'd need to edit Makefile
to use the correct compiler flags.
Once you've typed make
, then after a few seconds the code should have compiled, and you should now see the executable file alfa
in the directory you are in. If so, then the code has compiled properly. Now you can install the code by typing
sudo make install
If you don't have root access, or you want to install to a different location, you can change the value of PREFIX
in the makefile before compiling.
Possible problems
If the compilation fails with ld: library not found for -lcfitsio
, then either CFITSIO is not installed, or the library couldn't be found. Fix this by firstly ensuring that CFITSIO is installed, and secondly either replacing -L/usr/lib/x86_64-linux-gnu/
with -Lpath/to/library/directory
in the makefile, or typing export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/library/directory
. You should be able to find the path using locate libcfitsio
.
On macs, if the CFITSIO library cannot be found, the compilation failure may return something like Library not loaded: @rpath/libcfitsio.10.dylib
. In this case, try export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/path/to/library/directory
.
If the installation fails with mkdir: /usr/share/alfa: Operation not permitted
, even if you typed in the root password, then you're probably using a mac with "system integrity protection". Edit the makefile and change the value of PREFIX
from /usr
to /usr/local
and the code should install.
In case of any problems that you can't solve, please get in touch.