Building older master versions

For older revisions along the master branch, there is a set of scripts that will download and install the needed libraries. They are in the Docs subdirectory of the main distribution.

Assuming that you are going to install the libraries in a common directory ($HOME/lib/intel/siesta-bundle in what follows, but you can of course change the name), and that you are using the Intel suite of compilers and libraries, you would do the following:

(This will produce a ‘static+shared’ installation of libxc 4.3.4 and libgridxc 0.9.6)

(You can request other library versions by passing appropriate parameters to the scripts. Use the -h option for more details). Note that to use libxc V5 you need at least libgridxc 0.10.1.

Now, the compilation of Siesta itself has been streamlined. In your arch.make you just need to list the features you want, and then provide a few symbols with the installation paths of the libraries. Assuming you have used the above common directory for installation, the arch.make is simply:

SIESTA_ARCH=intel

WITH_MPI=1

#Optional
WITH_FLOOK=
WITH_NETCDF=
WITH_NCDF=
#
#===========================================================
# Put here the location where you installed the libraries
BUNDLE_DIR=$(HOME)/lib/intel/siesta-bundle
#
XMLF90_ROOT=$(BUNDLE_DIR)
PSML_ROOT=$(BUNDLE_DIR)
GRIDXC_ROOT=$(BUNDLE_DIR)
#
# Optional:
FLOOK_ROOT=$(BUNDLE_DIR)
NETCDF_ROOT=$(BUNDLE_DIR)
#-------------------------------------------------------
#
# Make sure that MKLROOT is defined, perhaps after initializing the Intel environment,
# or after loading some environment module
#
SCALAPACK_LIBS=-L$(MKLROOT)/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
LAPACK_LIBS=-L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
#
# This would be needed to compile the program Util/STM/ol-stm/stm
FFTW_ROOT=/path/to/fftw/installation
#--------------------------------------------------------
#
# Compiler names and flags
#
FC_PARALLEL=mpiifort
FC_SERIAL=ifort
#
FPP = $(FC_SERIAL) -E -P -x c
#
# (add -qopenmp to all three for OpenMP support)
#
# Warning: Some of these 'safety' options might impact performance
# 
FFLAGS = -g -traceback -O2 -prec-div -prec-sqrt -fp-model source
FFLAGS_DEBUG= -g -traceback -O1 -prec-div -prec-sqrt -fp-model source
#
# Use these if you would like the shared library locations to be encoded directly
# in the Siesta executable, instead of having to add them to LD_LIBRARY_PATH
#
LDFLAGS += "-Wl,-rpath,$(GRIDXC_ROOT)/lib" 
# LDFLAGS += "-Wl,-rpath,$(FLOOK_ROOT)/lib
#
#
#
# Delicate files with Intel compiler ----------------------------
#
atom.o: atom.F
	$(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
state_analysis.o: state_analysis.F
	$(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
create_Sparsity_SC.o: create_Sparsity_SC.F90
	$(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS)  $<
#
RANLIB=echo
# ----------------------------------------------------------
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
include $(SELF_DIR)build.mk

Put this arch.make file in the Obj subdirectory, and type

   sh ../Src/obj_setup.sh
   make

To build the utilities in Util:

cd Util
OBJDIR=Obj sh build_all.sh