-
Notifications
You must be signed in to change notification settings - Fork 0
Installing GLAMER with conda
The currently easiest way to get all dependencies for GLAMER installed is through the conda package manager, which comes with Anaconda and Miniconda.
Assuming the conda
command is available,
MacBook:~ $ conda --version
conda 4.6.4
we will set up a specific environment called glamer
in which all dependencies are going to be installed. First, we create the new environment:
MacBook:~ $ conda create -n glamer
Collecting package metadata: done
Solving environment: done
## Package Plan ##
environment location: /path/to/miniconda3/envs/glamer
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate glamer
#
# To deactivate an active environment, use:
# > source deactivate
#
The output of the conda create
command let us know where exactly the new environment will be located. While this is good to know in general, the build system of GLAMER should detect all locations automatically.
Next, we activate the new glamer
environment so that we can install the dependencies:
MacBook:~ $ source activate glamer # newer conda versions use `conda activate glamer`
(glamer) MacBook:~ $
The (glamer)
tag in front of the shell lets us know that we are now indeed working in the glamer
environment. We can hence go ahead and install the GLAMER build system and all dependencies:
(glamer) MacBook:~ $ conda install -c conda-forge cmake fftw ccfits gsl hdf5
Collecting package metadata: done
Solving environment: done
## Package Plan ##
environment location: /Users/mbessnt3/miniconda3/envs/glamer
added / updated specs:
- ccfits
- cmake
- fftw
- gsl
- hdf5
The following NEW packages will be INSTALLED:
[...]
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
The next step is to clone the GLAMER repositories. First, change directory to where you want your code to be located:
(glamer) MacBook:~ $ cd code # make sure you adapt this to your needs
(glamer) MacBook:code $
Now clone the GLAMER root repository:
(glamer) MacBook:code $ git clone https://github.com/glenco/glamer.git
Cloning into 'glamer'...
remote: Enumerating objects: 7507, done.
remote: Total 7507 (delta 0), reused 0 (delta 0), pack-reused 7507
Receiving objects: 100% (7507/7507), 33.72 MiB | 16.29 MiB/s, done.
Resolving deltas: 100% (5929/5929), done.
Change into the cloned glamer
root directory and clone the three GLAMER code repositories:
(glamer) MacBook:code $ cd glamer
(glamer) MacBook:glamer $ git clone https://github.com/glenco/SLsimLib.git
Cloning into 'SLsimLib'...
remote: Enumerating objects: 241, done.
remote: Counting objects: 100% (241/241), done.
remote: Compressing objects: 100% (146/146), done.
remote: Total 27164 (delta 155), reused 151 (delta 95), pack-reused 26923
Receiving objects: 100% (27164/27164), 32.40 MiB | 5.35 MiB/s, done.
Resolving deltas: 100% (21440/21440), done.
(glamer) MacBook:glamer $ git clone https://github.com/glenco/CosmoLib.git
Cloning into 'CosmoLib'...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 875 (delta 8), reused 17 (delta 8), pack-reused 854
Receiving objects: 100% (875/875), 920.33 KiB | 3.35 MiB/s, done.
Resolving deltas: 100% (579/579), done.
(glamer) MacBook:glamer $ git clone https://github.com/glenco/NR.git
Cloning into 'NR'...
Username for 'https://github.com': <GitHub.com username>
Password for 'https://[email protected]': <GitHub.com password>
remote: Enumerating objects: 862, done.
remote: Total 862 (delta 0), reused 0 (delta 0), pack-reused 862
Receiving objects: 100% (862/862), 537.07 KiB | 1.31 MiB/s, done.
Resolving deltas: 100% (498/498), done.
In the last step, your GitHub username and password are required to clone the protected NR repository. (Naturally, you could also clone the repositories via SSH.)
At this point, all that remains to do is to create CMake's build directory and generate the Makefiles. Make sure to pass the flags that enable extra features:
(glamer) MacBook:glamer $ mkdir build
(glamer) MacBook:glamer $ cd build
(glamer) MacBook:build $ cmake .. -G "Unix Makefiles" -DENABLE_GSL=1 -DENABLE_HDF5=1
[...]
-- Using C++11 with libc++ in clang++ flags.
-- FITS support: enabled
-- FFTW support: enabled
-- GSL support: enabled
-- HEALPIX support: disabled
-- HDF5 support: enabled
[...]
-- Found Threads: TRUE
-- Found CFITSIO: /path/to/miniconda3/envs/glamer/lib/libcfitsio.dylib
-- Found CCfits: /path/to/miniconda3/envs/glamer/lib/libCCfits.dylib
-- Found FFTW3: /path/to/miniconda3/envs/glamer/lib/libfftw3.dylib
-- Found GSL: /path/to/miniconda3/envs/glamer/lib/libgsl.dylib
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /path/to/miniconda3/envs/glamer/lib/libhdf5.dylib;/usr/lib/libpthread.dylib;/path/to/miniconda3/envs/glamer/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.10.4")
-- Number of threads: 1
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/code/glamer/build
In the process, CMake should detect all of the previously installed dependencies automatically. You are ready to build the GLAMER libraries:
(glamer) MacBook:build $ make