-
Notifications
You must be signed in to change notification settings - Fork 1
Installing ACCIV
You need a flavor or unix or a unix-like environment (e.g. cygwin) and a c++ compiler to be able to build ACCIV. To run certain scripts included with ACCIV, you may need to install the csh shell.
To get all the dependencies in one place, do the following.
- Install Miniconda:
# skip these first 2 steps if you already have Anaconda installed
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
/bin/bash Miniconda2-latest-Linux-x86_64.sh
- create a new environment called
acciv
source ~/miniconda2/etc/profile.d/conda.sh
conda create -n acciv python=2 numpy scipy matplotlib h5py hdf5 fftw
-
build
acciv
(see below for more details) a.cd acciv
b. copy Makefile-default to Makefile c. edit Makefile to add-I ~/miniconda2/envs/acciv/include
toCPPINCLUDES
d. edit Makefile to add-L ~/miniconda2/envs/acciv/lib
toLIBS
e. runmake
-
Do the following each time you open a new shell where you would like to run
acciv
source ~/miniconda2/etc/profile.d/conda.sh
conda activate acciv
export LD_LIBRARY_PATH=~/miniconda2/envs/acciv/lib:$LD_LIBRARY_PATH
In order to compile, ACCIV requires two libraries: FFTW3 and HDF5.
Download the source code (or the pre-built library for your system if available): http://www.fftw.org/download.html The following commands should be sufficient to build and install (assuming you have root access):
tar xvfz fftw-3.x.x.tar.gz
cd fftw-3.x.x
./configure
make
sudo make install
If you need to install FFTW3 in another location, run:
./configure --prefix=/some/path
In this case, make sure you remember the path, because you will need to add it to ACCIV's makefile
.
If FFTW3 produces a dynamically linked library and you have installed it to a non-standard path, you may need to add the library directory to your dynamic library path. In bash shell:
export LD_LIBRARY_PATH=/opt/fftw3/lib:$LD_LIBRARY_PATH
In csh/tcsh:
setenv LD_LIBRARY_PATH /opt/fftw3/lib:$LD_LIBRARY_PATH
where in both cases /opt/fftw3 is the library where FFTW3 was installed.
Download the source code: http://www.hdfgroup.org/ftp/HDF5/current/src/ It is not recommended that you use the pre-built libraries even if one exists for your system. The reason for this is that ACCIV uses the “high-level” interface to HDF5 to read and write files, and the default HDF5 build does not include the high-level interface. The following commands should be sufficient to build and install (assuming you have root access):
tar xvfj hdf5-1.8.x.tar.bz2
cd hdf5-1.8.x
./configure --enable-cxx --enable-hl
make
sudo make install
If you need to install FFTW3 in another location, run:
./configure --prefix=/some/path --enable-cxx --enable-hl
In this case, make sure you remember the path, because you will need to add it to ACCIV's makefile
.
If HDF5 produces a dynamically linked library and you have installed it to a non-standard path, you may need to add the library directory to your dynamic library path. In bash shell:
export LD_LIBRARY_PATH=/opt/hdf5/lib:$LD_LIBRARY_PATH
In csh/tcsh:
setenv LD_LIBRARY_PATH /opt/hdf5/lib:$LD_LIBRARY_PATH
where in both cases /opt/hdf5 is the library where HDF5 was installed.
It is also recommended that you install the java-based program HDFView, which allows you to easily view the data in HDF5 files either as tables of numbers or as images. http://www.hdfgroup.org/hdf-java-html/hdfview/index.html#download_hdfview
ACCIV resides on GitHub, so you can install it from the command line like this:
git clone https://github.com/xylar/acciv.git
This will install a directory acciv
with the following subfolders:
acciv/ tests/
In the acciv directory, there are two sample makefiles, Makefile-mac
and Makefile-default
. You will need to copy one of these files to Makefile
and customize it with the appropriate c++ compiler and paths for your system. Here are some of the topmost lines of Makefile-mac
:
CPPINCLUDES = -I./Utility -I/opt/hdf5/include -I/opt/fftw3/include
-I/opt/local/include
LIBS = -L. -lutility -L/opt/hdf5/lib -L/opt/fftw3/lib -L/opt/local/lib -lfftw3 -lhdf5 -lhdf5_cpp -lhdf5_hl -lhdf5_hl_cpp
This is where the libraries (see above) are listed so they can be linked at compilation. Depending on where your libraries are installed, you may need to edit the CPPINCLUDES
and LIBS
lines.
Once you have the paths to your libraries set, just type make at the command line in the acciv
directory and ACCIV should compile flawlessly.
The executable file will be acciv
, unless you’ve changed the Makefile.
If there are problems with compilation, and you’re sure you have all the libraries installed and properly linked in the Makefile, then please submit an “Issue” with an error report. We will all try to help debug your problem.