Skip to content

Commit

Permalink
Added Erkale to Utilities #15. First try to get it to compile automat…
Browse files Browse the repository at this point in the history
…ically in CI
  • Loading branch information
fsmoncadaa committed Dec 12, 2024
1 parent 89af5b9 commit d8be1e0
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Compile and install dependencies
run: |
sudo apt-get update
sudo apt-get -y install wget git build-essential liblapack-dev libblas-dev libgsl0-dev autotools-dev automake libtool gfortran python2 gawk libeigen3-dev libgmp-dev libboost-all-dev libarpack2-dev
sudo apt-get -y install wget git build-essential liblapack-dev libblas-dev libgsl0-dev autotools-dev automake libtool gfortran python2 gawk libeigen3-dev libgmp-dev libboost-all-dev libarpack2-dev libopenblas-dev
# Define ENV Variables
export WORKDIR=$PWD/dependencies
export PATH=$PATH:$WORKDIR/bin
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ default::
doc::
cd $(TOPDIR)/doc && doxygen Doxyfile


install:: bin/lowdin bin/lowdin.x
mkdir -p $(PREFIX)/.lowdin2
cp -rf $(TOPDIR)/bin/lowdinvars.sh $(TOPDIR)
Expand All @@ -27,8 +26,10 @@ install:: bin/lowdin bin/lowdin.x
$(SED) -i 's|COMPILATION_DATE|$(shell date)|g' $(TOPDIR)/lowdinvars.sh
cp -rf $(TOPDIR)/lowdinvars.sh $(PREFIX)/.lowdin2/
cp -rf lib $(PREFIX)/.lowdin2/
cp -rf utilities/erkale/build/erkale/basis $(PREFIX)/.lowdin2/lib/erkaleBasis
mkdir -p $(PREFIX)/.lowdin2/bin
cp -rf $(TOPDIR)/bin/*.x $(PREFIX)/.lowdin2/bin
cp -rf utilities/erkale/erkale/bin/erkale_fchkpt utilities/erkale/erkale/bin/erkale_loc $(PREFIX)/.lowdin2/bin
cp -rf $(TOPDIR)/bin/lowdin $(TOPDIR)
$(SED) -i 's|PREFIX|$(PREFIX)|g' $(TOPDIR)/lowdin
cp -rf $(TOPDIR)/lowdin $(PREFIX)/lowdin2
Expand All @@ -38,7 +39,7 @@ install:: bin/lowdin bin/lowdin.x
uninstall:: bin/lowdin bin/lowdin.x
rm -rf $(PREFIX)/.lowdin2
rm -rf $(PREFIX)/lowdin2

clean::
for dir in $(SUBDIRS); \
do \
Expand Down
5 changes: 5 additions & 0 deletions bin/lowdinvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ then
export LOWDIN_DATA
fi

if [ -z "$LOWDIN_DATA/erkaleBasis" ]
then
export ERKALE_LIBRARY="$LOWDIN_DATA/erkaleBasis"
fi

if [ -z "$PATH" ]
then
PATH="$LOWDIN_HOME/bin:$LOWDIN_HOME/utils:"
Expand Down
32 changes: 28 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ usage(){
echo ""
}

TOPDIR=`pwd`

###########################################
# SET DEFAULTS
###########################################
Expand All @@ -40,6 +42,7 @@ FLAGS="1"
PREFIX="/usr/local"
SCRATCH='/scratch'
CUDAFLAGS="no"
COMP_ERKALE="yes"
CXX="g++"
CC="gcc"
CFLAGS="-g -O2 -fopenmp -D gfortran"
Expand Down Expand Up @@ -111,13 +114,15 @@ else
LIBINT_LIBS=`awk '{if($1 == "LIBINT_LIBS" ) {for(i=3;i<=NF;i++) printf "%s ", $i}}' CONFIG`
LIBXC_LIBS=`awk '{if($1 == "LIBXC_LIBS" ) {for(i=3;i<=NF;i++) printf "%s ", $i}}' CONFIG`
CUDA_LIBS=`awk '{if($1 == "CUDA_LIBS" ) {for(i=3;i<=NF;i++) printf "%s ", $i}}' CONFIG`
COMP_ERKALE=`awk '{if($1 == "COMP_ERKALE" ) {for(i=3;i<=NF;i++) printf "%s ", $i}}' CONFIG`

# ALL_LIBS=`awk '{if($1 == "ALL_LIBS" ) {for(i=3;i<=NF;i++) printf "%s ", $i}}' CONFIG`
fi

###############################################################################
# OPTIONS FOR FORTRAN COMPILER
###############################################################################
echo "Fortran Compiler command? [$FC]"
echo "Fortran Compiler command? gfortran(default) or ifort [$FC]"
read FCOMP

if [ "$FCOMP" = "" ] ; then
Expand Down Expand Up @@ -157,7 +162,6 @@ else
fi

CUDAFLAGS=$FCUDAFLAGS

addflagsCuda=""


Expand Down Expand Up @@ -234,7 +238,7 @@ else
###############################################################################
# SPECIFIC INSTALLATION DIRECTORIES
###############################################################################
echo "Installation directory? [$PREFIX]"
echo "Installation directory? default=/usr/local [$PREFIX]"
read BINDIR

if [ "$BINDIR" = "" ] ; then
Expand All @@ -243,6 +247,17 @@ else

PREFIX=$BINDIR

###############################################################################
# ADDITIONAL UTILITIES
###############################################################################
echo "Compile erkale? (for orbital localization and embedding): yes(default)/no [$COMP_ERKALE]"
read ERKALE

if [ "$ERKALE" != "no" ] ; then
COMP_ERKALE="yes"
fi


fi
###############################################################################
# SAVING OPTIONS
Expand All @@ -268,13 +283,22 @@ echo "LIBXC_LIBS = $LIBXC_LIBS" >> CONFIG
echo "CUDA_LIBS = $CUDA_LIBS" >> CONFIG
echo "ALL_LIBS = $ALL_LIBS" >> CONFIG
echo "SED = $SED" >> CONFIG
echo "COMP_ERKALE = $COMP_ERKALE" >> CONFIG


###############################################################################
# Compile Erkale
###############################################################################
if [ "$COMP_ERKALE" = "yes" ] ; then
cd $TOPDIR/utilities/erkale
./compileForLowdin.sh
cd $TOPDIR
fi

###############################################################################
# Generate makefiles
###############################################################################

TOPDIR=`pwd`
SRCDIR="src utilities"
SUBDIRS="core ints DFT scf integralsTransformation MBPT PT CalcProp aduw gepol cosmo output CI NOCI MM molden2aim jadamilu"

Expand Down
2 changes: 1 addition & 1 deletion src/output/Output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ program Output_
allocate(outputs_instance(1) )

call OutputBuilder_constructor( outputs_instance(1), 1, &
"fchkFile", "ALL")
"FCHKFILE", "ALL")

call OutputBuilder_buildOutput(outputs_instance(1))
call OutputBuilder_show(outputs_instance(1))
Expand Down
3 changes: 2 additions & 1 deletion src/output/OutputBuilder.f90
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ subroutine OutputBuilder_constructor(this, ID, &
auxY=0.0
auxZ=0.0
auxStep=0.0
auxReal=0.0

if( present(offsetX)) auxX=offsetX
if( present(offsetY)) auxY=offsetY
Expand Down Expand Up @@ -321,7 +322,7 @@ subroutine OutputBuilder_constructor(this, ID, &
end if

if(auxStep .gt. 0.0 .and. this%cubeSize .gt. 0.0) this%pointsPerDim(1:3)=int((this%cubeSize*2.0)/auxStep)

if( present(center) ) auxReal=sum(center*center)
if(auxReal .gt. 0.0) this%point1%values=center

Expand Down
2 changes: 1 addition & 1 deletion src/scf/OrbitalLocalizer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ subroutine OrbitalLocalizer_erkaleLocal(speciesID,densityMatrix,fockMatrix,orbit

close(30)

call system("erkale_loc_omp erkale.local")
call system("erkale_loc erkale.local")

!!Convert erkale chk files to lowdin fchk files
open(unit=30, file="erkale.write", status="replace", form="formatted")
Expand Down

0 comments on commit d8be1e0

Please sign in to comment.