Child pages
  • Mox_healpix
Skip to end of metadata
Go to start of metadata

First install cfitsio as shown in below link:

Hyak_cfitsio

Below are the steps to install healpix on mox.hyak. Here xyz is your group name and abc is your userid.

(1) srun -p build --time=2:00:00 --mem=100G --pty /bin/bash

(2) mkdir /gscratch/xyz/abc/healpix_stuff

(3) download the healpix source code tar.gz file to you desktop

(4) sftp the healpix source code tar.gz file from your desktop to mox directory /gscratch/xyz/abc/healpix_stuff

(5) cd /gscratch/xyz/abc/healpix_stuff

(6) tar -xvf Healpix_3.50_2018Dec10.tar.gz  (you may have different healpix version number and date)

(7) cd Healpix_3.50

(8) Note that the configure command is a non-standard configure shell script

Below command gives the configure options. Note that this healpix configure script does not have the --prefix option of standard configure scripts.

./configure -h

Configure script for Healpix 3.50

Usage: ./configure [?|-h|-L|-v]

? Print usage and exit

-h Print this help message and exit

-L Put the configuration directory in /gscratch/xyz/abc/healpix_stuff/Healpix_3.50/confdir/3_50_Linux
(instead of installer's home: /usr/lusers/abc/.healpix/3_50_Linux).
Recommended when doing a system wide installation to be used by several users.

-v Print Healpix version and exit


(9)  Run below command:

./configure

(10) The configure script asks some questions. At the end of this page are sample answers for option 2 for C  and option 3 for Fortran 90.

(11) make 


Compiling Fortran 90 program which uses healpix

(a) cd

(b) cd .healpix/3_50_Linux

(c) source config

(d) export CPATH=/gscratch/xyz/abc/healpix/cfitsio_install/include:$CPATH

(e) export LIBRARY_PATH=/gscratch/xyz/abc/healpix/cfitsio_install/lib:$LIBRARY_PATH

(f) export LD_LIBRARY_PATH=/gscratch/xyz/abc/cfitsio_install/lib:$LD_LIBRARY_PATH

(g) gfortran myprogram.f90  -o myprogram -I/gscratch/xyz/abc/healpix_stuff/Healpix_3.50/build/mod -L/gscratch/xyz/abc/healpix_stuff/Healpix_3.50/lib -lhealpix -lcfitsio

Sample answers for the configure script

Below are are sample answers for the configure script for option 2 for C and option 3 for Fortran 90.

./configure

*************************
Welcome to Healpix 3.50
*************************

This script takes care of the configuration and compilation
of the C, C++, F90, IDL and Python packages of the Healpix distribution.

Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will *REMOVE* the Makefile and configuration files, and exit)
(0): exit

Enter your choice (configuration of packages can be done in any order): 2
enter C compiler you want to use (gcc):
enter options for C compiler (-O2 -Wall):
enter archive creation (and indexing) command (ar -rsv):
do you want the HEALPix/C library to include CFITSIO-related functions ? (Y|n): n
A static library is produced by default. Do you also want a shared library ? (y|N) n
Editing top Makefile for C ... done.

The following line should be inserted into your home shell profile (/usr/lusers/abc/.profile):

[ -r /usr/lusers/abc/.healpix/3_50_Linux/config ] && . /usr/lusers/abc/.healpix/3_50_Linux/config

Where the file /usr/lusers/abc/.healpix/3_50_Linux/config contains:
# configuration for Healpix 3.50
HEALPIX=/gscratch/xyz/abc/healpix_stuff/Healpix_3.50 ; export HEALPIX
HPX_CONF_DIR=/usr/lusers/abc/.healpix/3_50_Linux
if [ -r ${HPX_CONF_DIR}/idl.sh ] ; then . ${HPX_CONF_DIR}/idl.sh ; fi
if [ -r ${HPX_CONF_DIR}/gdl.sh ] ; then . ${HPX_CONF_DIR}/gdl.sh ; fi
if [ -r ${HPX_CONF_DIR}/fl.sh ] ; then . ${HPX_CONF_DIR}/fl.sh ; fi
if [ -r ${HPX_CONF_DIR}/f90.sh ] ; then . ${HPX_CONF_DIR}/f90.sh ; fi
if [ -r ${HPX_CONF_DIR}/cpp.sh ] ; then . ${HPX_CONF_DIR}/cpp.sh ; fi
if [ -r ${HPX_CONF_DIR}/c.sh ] ; then . ${HPX_CONF_DIR}/c.sh ; fi

Do you want this modification to be done (y|N)? n

Writing pkgconfig file: /gscratch/xyz/abc/healpix_stuff/Healpix_3.50/lib/chealpix.pc
# HEALPix/C pkg-config file

prefix=/gscratch/xyz/abc/healpix_stuff/Healpix_3.50
libdir=${prefix}/lib
includedir=${prefix}/include

Name: chealpix
Description: C library for HEALPix (Hierarchical Equal-Area iso-Latitude) pixelisation of the sphere
Version: 3_50
URL: https://healpix.sourceforge.io
Libs: -L${libdir} -lchealpix
Cflags: -I${includedir} -fPIC
--------------


Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will *REMOVE* the Makefile and configuration files, and exit)
(0): exit

Enter your choice (configuration of packages can be done in any order): 3
you seem to be running Linux
enter name of your F90 compiler (): gfortran
Note: your Fortran compiler is gfortran compiler
compiled Healpix products will be:
F90_BINDIR = ./bin[suffix]
F90_INCDIR = ./include[suffix]
F90_LIBDIR = ./lib[suffix]
F90_BUILDDIR = ./build[suffix]
enter suffix for directories ():
compiled Healpix products will be:
F90_BINDIR = ./bin
F90_INCDIR = ./include
F90_LIBDIR = ./lib
F90_BUILDDIR = ./build
enter compilation flags for gfortran compiler (-I$(F90_INCDIR) -DGFORTRAN -fno-second-underscore):
enter optimisation flags for gfortran compiler (-O3):
Fortran code will be compiled with gfortran -O3 -I$(F90_INCDIR) -DGFORTRAN -fno-second-underscore
enter name of your C compiler (gcc):
gcc: GCC compiler
enter compilation/optimisation flags for C compiler (-O3 -std=c99 -DgFortran):
C subroutines will be compiled with gcc -O3 -std=c99 -DgFortran
enter command for library archiving (ar -rsv):
enter full name of cfitsio library (libcfitsio.a): /gscratch/xyz/abc/cfitsio_install/lib/libcfitsio.a
enter location of cfitsio library (/usr/local/lib): /gscratch/xyz/abc/cfitsio_install/lib
Warning: Nonexistent include directory "$(F90_INCDIR)"
Warning: Nonexistent include directory "$(F90_INCDIR)"
The generator of non-gaussian CMB maps (ng_sims) can optionally
produce plots of the maps Prob. Dens. Function using PGPLOT.
Do you want to enable this option ?
(this assumes that PGPLOT is already installed on your computer) (y|N)n

The Spherical Harmonics Transform (C and F90) routines used by
synfast/anafast/smoothing/plmgen
and some routines used by ud_grade and alteralm respectively
have a parallel implementation (based on OpenMP).
Do you want to use :
0) the standard serial implementation ?
1) the parallel implementation
Enter choice (1): 0

Do you want a Position Independent Compilation (option "-fPIC")
(recommended if the Healpix-F90 library is to be linked to external codes) (Y|n): y

Experimental feature:
A static library is produced by default. Do you rather want a shared/dynamic library ? (y|N) n
Generating /usr/lusers/abc/.healpix/3_50_Linux/f90.sh
Editing top Makefile for F90 ... done.

Writing pkgconfig file: /gscratch/xyz/abc/healpix_stuff/Healpix_3.50/lib/healpix.pc
# HEALPix/F90 pkg-config file
# compiled with gfortran

prefix=/gscratch/xyz/abc/healpix_stuff/Healpix_3.50
suffix=
exec_prefix=${prefix}/bin${suffix}
libdir=${prefix}/lib${suffix}
includedir=${prefix}/include${suffix}

Name: HEALPix
Description: F90 library for HEALPix (Hierarchical Equal-Area iso-Latitude) pixelisation of the sphere
Version: 3_50
URL: https://healpix.sourceforge.io
Requires: cfitsio >= 3.20
Libs: -L${libdir} -lhealpix -lhpxgif
Cflags: -I${includedir} -fopenmp -fPIC

--------------


Do you want to:
(0): exit
(1): configure Healpix IDL package
(2): configure Healpix C package, and edit Makefile
(3): configure Healpix F90 package, and edit Makefile
(4): configure Healpix C++ package, and edit Makefile
(5): configure Healpix Python (healpy) package, and edit Makefile
(8): see what configuration files have been created so far
(9): edit your shell configuration file to have easier access to Healpix codes
(-1): reset
(will *REMOVE* the Makefile and configuration files, and exit)
(0): exit

Enter your choice (configuration of packages can be done in any order): 0


You can run "(GNU)make" to build all the packages configured so far,
and "(GNU)make test" to test them.

Good Bye !


======================================================================


 




  • No labels