How do I compile VASP 5.4.1 on a Cray XC - compilation

I want to compile the latest version of VASP 5 (5.4.1) on a Cray XC MPP machine. Does anyone have the settings I can use? The VASP distribution does not come with an example for Cray.
The build system has changed from the 5.3.5 version.

Full compilation instructions can be found on the ARCHER (http://www.archer.ac.uk) website at:
http://www.archer.ac.uk/documentation/software/vasp/compiling_5-4-1-phase2.php
But in brief:
Download and patch the source code
Switch to Intel programming environment and load the fftw module:
module swap PrgEnv-cray PrgEnv-intel
module load fftw
Create "makefile.include" with the following settings:
# Precompiler options
CPP_OPTIONS= -DMPI -DHOST=\"CrayXC-Intel\" \
-DIFC \
-DCACHE_SIZE=2000 \
-DPGF90 \
-Davoidalloc \
-DMPI_BLOCK=8000 \
-DscaLAPACK \
-Duse_collective \
-DnoAugXCmeta \
-Duse_bse_te \
-Duse_shmem \
-Dtbdyn
CPP = fpp -f_com=no -free -w0 $*$(FUFFIX) $*$(SUFFIX) $(CPP_OPTIONS)
FC = ftn
FCL = ftn
FREE = -free -names lowercase
FFLAGS = -assume byterecl
OFLAG = -O3 -ip -fno-alias -unroll-aggressive -opt-prefetch -use-intel-optimized-headers -no-prec-div
OFLAG_IN = $(OFLAG)
DEBUG = -O0
MKL_PATH = $(MKLROOT)/lib/intel64
BLAS =
LAPACK =
BLACS =
SCALAPACK =
OBJECTS = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o
INCS =
LLIBS = ${MKL_PATH}/libmkl_blas95_lp64.a ${MKL_PATH}/libmkl_lapack95_lp64.a \
${MKL_PATH}/libmkl_scalapack_lp64.a \
-Wl,--start-group ${MKL_PATH}/libmkl_intel_lp64.a \
${MKL_PATH}/libmkl_sequential.a ${MKL_PATH}/libmkl_core.a \
${MKL_PATH}/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group
OBJECTS_O1 += fft3dfurth.o fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o
# For what used to be vasp.5.lib
CPP_LIB = $(CPP)
FC_LIB = $(FC)
CC_LIB = cc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB = $(FREE)
OBJECTS_LIB= linpack_double.o getshmem.o
# Normally no need to change this
SRCDIR = ../../src
BINDIR = ../../bin
Compile the code
make all

Related

mpif90 not found but it's intsalled

I'm trying to run a makefile and came across two errors. When I run make I get this:
$ make
mpif90 -xHost -ip -fpp -O3 -align -I/include/intel64/lp64 -I/include/fftw -c integ-Coul.F
make: mpif90: Command not found
make: *** [makefile:181: integ-Coul.o] Error 127
So, I already have installed openmpi-devel and the file mpif90 it's in the /usr/lib64/openmpi/bin folder, but the error keeps reocurring.
This is the makefile
#
.SUFFIXES:
.SUFFIXES: .f .F .for .cpp .F90 .cu .o
#FC=ifort -xHost -ip -fpp
FC = mpif90 -xHost -ip -fpp
FREE = -free
# use this flag for debugging and coding up
SAFE = #-g -traceback -check all #-fstack-protector -assume protect_parens -implicitnone -warn all
FFLAGS1 = -O3 -align
FFLAGS2 = -O2 -align -qopenmp -parallel $(FREE) $(SAFE)
LDFLAGS = -static-intel
CXX = icpc -std=c++11
SAFE_CXX = #-g -traceback
CFLAGS = -O2 -align -xHost -ip -qopenmp -fno-exceptions -restrict $(SAFE_CXX)
# MKLROOT = If MKLROOT is not defined in your environment, edit and uncomment this line
LIB_BLAS = -lmkl_blas95_lp64
LIB_LAPACK = -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
LIB_OMP = -liomp5 -lpthread
INCS_MKL = -I$(MKLROOT)/include/intel64/lp64 -I$(MKLROOT)/include/fftw
# Uncomment the lines below when compiling for GPUs
# GPU_DEFS options:
# -DGPU_TIMING : Print timings (CPU/GPU)
# -DUSE_GPU : Compile with GPU support
# -DGPU_DEBUG : Print some debug messages
# -DGPU_SYGVDM_VER : Use multi-gpu version of SYGVD (faster than single-gpu even with 1 gpu)
# -DGPU_SYGVD2S_VER : Use two stage version of SYGVD (faster, but needs more memory)
# -DGPU_DONT_PIN_MEM : Don't use pinned memory for faster transfers (in Fortran code)
# -DGPU_PIN_MEM_WORK : Use pinned memory for work spaces (in C code)
#GPU_DEFS = -DUSE_GPU
#
ifneq (,$(findstring USE_GPU,$(GPU_DEFS)))
# CUDA compiler
NVCC = nvcc
# compute capality (depends on your GPU, check!)
SM = 35
#SAFE_NVCC = -g -lineinfo
NVCCFLAGS = -O3 -gencode arch=compute_${SM},code=sm_${SM} -Xcompiler "-fno-strict-aliasing -march=native -fno-exceptions" $(SAFE_NVCC)
# -fno-strict-aliasing
#
# CUDA and MAGMA paths:
CUDADIR = /usr/local/cuda
MAGMADIR = /opt/magma
#
# CUDA and MAGMA libs:
# dynamic linking:
#LIB_CUDA = -L$(CUDADIR)/lib64 -lcublas -lcusparse -lcudart
# static linking:
LIB_CUDA = -L$(CUDADIR)/lib64 -lcublas_static -lcusparse_static -lculibos -lcudart_static -ldl
LIB_MAGMA = $(MAGMADIR)/lib/libmagma.a
#
LIB_GPU = $(LIB_MAGMA) $(LIB_CUDA) -lstdc++
INCS_GPU = -I$(CUDADIR)/include -I$(MAGMADIR)/include
endif
LIB = $(LIB_GPU) $(LIB_BLAS) $(LIB_LAPACK) $(LIB_OMP) -lrt
INCS = $(INCS_MKL)
#-----------------------------------------------------------------------
# general rules
#-----------------------------------------------------------------------
#INCS1 = comun.inc integcoul.inc m2cdat.inc $(INCS)
SOURCE1 = integ-Coul.o \
Coul0sim.o \
m2caux3-Coul.o \
abcpes-Coul.o \
ckplm-Coul.o \
util-Coul.o
SOURCE2 = constants_m.o \
Matrix_math.o \
exec_time.o \
types_EHT.o \
types_MM.o \
parameters.o \
MPI_defs.o \
OPT_parent.o \
parameters_MM.o \
checklist.o \
allocation_m.o \
util.o \
EHT_input.o \
tuning.o \
IdentifyNonBonded.o \
babel_routines.o \
babel.o \
gmx2mdflex.o \
namd2mdflex.o \
structure.o \
md_read.o \
md_setup.o \
f_intra.o \
f_inter.o \
md_output.o \
pbc.o \
overlap_D.o \
STO.o \
multip_routines.o \
LCMO_Builder.o \
Coulomb.o \
DP_main.o \
td_dp.o \
DP_FMO.o \
dipole_phi.o \
EnvField.o \
polarizability.o \
hamiltonians.o \
QCModel_Huckel.o \
diabatic-Ehren.o \
HuckelForces.o \
Ehrenfest.o \
CoulInt_QMMM.o \
FMO.o \
electron_hole_DP.o \
AlphaPolar.o \
data_output.o \
backup_MM.o \
Berendsen.o \
NoseHoover.o \
NoseHoover_Reversible.o \
NVE.o \
VDOS_m.o \
MM_dynamics.o \
MM_driver.o \
film_STO.o \
DOS_m.o \
oscillator.o \
ga_QCModel.o \
cost_tuning_EH.o \
cost_tuning_MM.o \
nonlinearCG.o \
CG_class.o \
MM_ERG_class.o \
nonlinear-sidekick.o \
FF_OPT_class.o \
CG_EH_driver.o \
ga_routines.o \
CG_MM_driver.o \
vibes_driver.o \
solvated_M.o \
DOS_tool.o \
backup.o \
auto_correlation.o \
ElHl_schroedinger.o \
diagnostic.o \
qdynamics.o \
Taylor.o \
ElHl_Chebyshev.o \
ElHl_Chebyshev_GPU.o \
AO_adiabatic.o \
Chebyshev_driver.o \
eigen_driver.o \
ga_driver.o \
avrg_confgs.o \
main.o
SOURCE_GPU = GPU_Interface.o \
Taylor_gpu.o
# Chebyshev_gpu.o
ifneq (,$(findstring USE_GPU,$(GPU_DEFS)))
SOURCE_CUDA= Chebyshev_gpu_kernels.o \
dzgemv_kernels.o
endif
a: $(SOURCE1) $(SOURCE2) $(SOURCE_GPU) $(SOURCE_CUDA)
rm -f a
$(FC) $(INCS) $(LDFLAGS) -o a $(SOURCE1) $(SOURCE2) $(SOURCE_GPU) $(SOURCE_CUDA) $(LIB)
.F.o:
$(FC) $(FFLAGS1) $(INCS) -c $<
.f.o:
$(FC) $(FFLAGS2) $(INCS) $(GPU_DEFS) -c $<
.F90.o:
$(FC) $(FFLAGS1) $(INCS) $(GPU_DEFS) -c $<
.cpp.o:
$(CXX) $(CFLAGS) $(INCS_GPU) $(GPU_DEFS) -c $<
.cu.o:
$(NVCC) $(NVCCFLAGS) $(INCS_GPU) $(GPU_DEFS) -c $<
clean:
-rm -f a *.o *.mod; touch *.f
depend:
#echo -en "Searching module dependencies..."
#chmod +x ./makedepend.bsh
#./makedepend.bsh > dependencies.txt
#echo -en " done.\n"
## Dependency list:
-include dependencies.txt
I don't have much experience so I would really appreciate some help with this. Thank you all.
Ps.: my SO is Fedora 32

Why is automake prefixing my object files with the package name?

In my src directory, I have source files such as cells.c. When I perform a compilation, the compiler prefixes the object file with the package name, so that it becomes neoleo-cells.o, for example. Why is it doing this, and how can I stop it? I don't think it's standard behaviour.
Here is Makefile.am:
#VPATH = $(srcdir) $(builddir)
GUI_SRCS =
GUI_LINK =
#GUI_DEFINES = -DX_DISPLAY_MISSING
GUI_DEFINES = -DHAVE_X
# Order of linking of libraries for Motif seems to be important
# I have decided to mandate the use of the Xbae library, rather than
# have it optional.
if UseMotif
GUI_SRCS += io-motif.c appres.c fallback.c oleo_icon.xpm
GUI_LINK += -lXm -lXt -lXbae
GUI_DEFINES += -DHAVE_MOTIF
endif
GUI_SRCS += io-x11.c xrdb.c
GUI_LINK += -lX11
YFLAGS = -d
EXTRA_DIST = $(srcdir)/neoleo.i
bin_PROGRAMS = neoleo
BUILT_SOURCES = getdate.c parse.c parse.h posixtm.c posixtm.h
#BUILT_SOURCES += neoleo_wrap.c
CLEANFILES = $(BUILT_SOURCES)
#lib_LTLIBRARIES = libneoleo.la
neoleo_CFLAGS = $(GUI_DEFINES) -Dmain0=main
neoleo_LDADD = -lm -lncurses -lpthread $(GUI_LINK)
#neoleo_LDFLAGS = -e main0
#neoleo_la_LDFLAGS = -module -avoid-version -shared
neoleo_SOURCES = afm.c args.c basic.c busi.c byte-compile.c cells.c cmd.c date.c decompile.c display.c \
epson.c eval.c font.c format.c forminfo.c funcs.c graph.c gsl.c hash.c help.c \
info.c init.c input.c \
io-headless.c io-curses.c io-edit.c io-term.c io-utils.c \
ir.c key.c legend.c line.c list.c lists.c mdi.c oleofile.c pcl.c plot.c \
postscript.c print.c prtext.c ref.c regions.c sc.c sort.c string.c stub.c sylk.c utils.c \
window.c \
defuns.c \
get_date.h getdate.y \
parse.y \
posixtm.y \
neoleo_swig.c \
mysql.c $(GUI_SRCS)
noinst_HEADERS = afm.h appres.h args.h basic.h byte-compile.h cell.h \
cmd.h decompile.h defun.h defuns.h display.h epson.h \
errors.h eval.h font.h format.h forminfo.h funcdef.h \
funcs.h global.h graph.h hash.h help.h info.h init.h \
input.h io-abstract.h io-headless.h io-curses.h io-edit.h \
io-generic.h io-motif.h io-term.h io-utils.h io-x11.h \
ir.h key.h line.h list.h lists.h mdi.h mysql.h node.h \
oleofile.h oleo_plot.h oleosql.h oleo_xb.h parse.h pcl.h \
posixtm.h postscript.h print.h proto.h prtext.h ref.h \
regions.h sc.h sciplot.h sciplotI.h sort.h stub.h stubs.h \
sylk.h sysdef.h userpref.h utils.h window.h \
neoleo_swig.h
# exclude these for now:
# plotter.c xbase.cpp
ref.o : parse.h
#neoleo_wrap.c : $(srcdir)/neoleo.i neoleo_swig.c neoleo_swig.h
# swig -tcl8 -o $# $<
This line causes the rename of the object files:
neoleo_CFLAGS = $(GUI_DEFINES) -Dmain0=main
If you have target-dependent compilation flags, Automake chooses different names for the resulting object files. This approach avoids clashes if there are multiple different targets that use the same sources but different flags.
Now, Automake could in theory notice that this isn't happening and not rename the object files. However, in practice most people don't care what the intermediate files are called, and this approach, I believe, simplified the implementation.
In your case, it sounds like you do care. So, just rename that variable to AM_CFLAGS and everything should work as you expect.

Makefile loops endless

My makefile loops endless but can't figure out why? Here is it further informations at sf.net/p/ags
AUTOMAKE_OPTIONS = foreign
top_srcdir = $(shell pwd)/src/ags
SUBDIRS = src/ags \
doc
-include ./src/ags/Makefile.am \
$(top_srcdir)/util/Makefile.am \
$(top_srcdir)/lib/Makefile.am \
$(top_srcdir)/object/Makefile.am \
$(top_srcdir)/widget/Makefile.am \
$(top_srcdir)/audio/Makefile.am \
$(top_srcdir)/audio/task/Makefile.am \
$(top_srcdir)/audio/file/Makefile.am \
$(top_srcdir)/audio/recall/Makefile.am \
$(top_srcdir)/audio/task/recall/Makefile.am \
$(top_srcdir)/file/Makefile.am \
$(top_srcdir)/X/Makefile.am \
$(top_srcdir)/X/editor/Makefile.am \
$(top_srcdir)/X/machine/Makefile.am \
$(top_srcdir)/file/Makefile.am \
$(top_srcdir)/server/Makefile.am \
./doc/Makefile.am
CC = gcc
# what flags you want to pass to the C compiler & linker
CFLAGS = -g --pedantic -Wall -O -I./src -I/usr/include
LDFLAGS = -L/lib -L/usr/lib -L/usr/X11/lib -lm -pthread -lrt -lgmp
# this lists the binaries to produce, the (non-PHONY, binary) targets in
# the previous manual Makefile
noinst_LIBRARIES = libags.a libags-thread.a libags-audio.a
bin_PROGRAMS = gsequencer
# library
libags_a_CFLAGS=
libags_a_LDFLAGS =
# application
gsequencer_CFLAGS=
gsequencer_LDFLAGS=
gsequencer_LDADD=libags.a libags-thread.a libags-audio.a
#
libags_audio_h_sources = $(ags_recall_audio_h_sources) $(ags_audio_task_h_sources) $(ags_xorg_task_h_sources) $(ags_audio_file_h_sources) $(ags_audio_recall_task_h_sources)
libags_audio_c_sources = $(ags_recall_audio_c_sources) $(ags_audio_task_c_sources) $(ags_xorg_task_c_sources) $(ags_audio_file_c_sources) $(ags_audio_recall_task_c_sources)
gsequencer_h_sources = $(ags_xorg_h_sources) $(ags_machine_h_sources) $(ags_editor_h_sources)
gsequencer_c_sources = $(ags_xorg_c_sources) $(ags_machine_c_sources) $(ags_editor_c_sources)
libags_a_SOURCES = $(ags_lib_c_sources) $(ags_object_c_sources) $(ags_util_c_sources)
libags_thread_a_SOURCES = $(ags_thread_c_sources)
libags_audio_a_SOURCES = $(ags_audio_c_sources)
libags_gui_a_SOURCES = $(ags_widget_c_sources)
gsequencer_SOURCES = $(gsequencer_c_sources) $(ags_server_c_sources) $(ags_file_c_sources)
Wiping all build scripts
rm *
Touching all files
find . -type f | xargs touch
Running the following to rebuild build scripts did it finally
aclocal
autoheader
libtoolize --force --copy
automake --add-missing --copy --foreign
autoconf
./configure
make
PROBLEM: empty Makefile.am caused infinite loop
SOLUTION: add an empty variable to it

Makefile link math.h

I try to add LDLIBS=-lm to my makefile, to link math.h, but I get the same error as before "sin undeclared " function. Here is part of my makefile:
I appreciate your help in advance.
LDLIBS=-lm
ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = \
kdv
kdv_SOURCES = kdv.c vector.c
lib_LIBRARIES = liblinalg.a
liblinalg_a_SOURCES = \
kdv.h \
vector.c
LDADD = liblinalg.a
TESTS = \
kdv

how to set conditional bin program creation using autotools

I am a beginner in using autotool, I want to add some shell script in the Makefile.am, when I use the method below, the Makefile created by autotool is not I am expected. How can I write to create the correct one.
Thanks for your reply!
PS:
this is my configure.in and Makefile.am(parts)
configure.in:
if test "$sample" = yes;then
DEFS="$DEFS -DSAMPLE=1"
AC_SUBST(SAMPLE, [yes])
fi
Makefile.am:
if test "$SAMPLE" = yes;then
noinst_PROGRAMS = test
test_SOURCES = test.c
else
bin_PROGRAMS = release
release_SOURCES = main.c
fi
Makefile autotool created:
........
........
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-includeHEADERS \
uninstall-libLTLIBRARIES
if test "yes" = yes;then
fi
Automake conditionals don't work like that. See the manual.
Here's how it should look:
configure.ac:
AM_CONDITIONAL([SAMPLE], [test "$SAMPLE" = yes])
Makefile.am:
if SAMPLE
noinst_PROGRAMS = test
test_SOURCES = test.c
else
bin_PROGRAMS = release
release_SOURCES = main.c
endif

Resources