Commit f1142da6 authored by lheinz's avatar lheinz
Browse files

minor fixes, cleaning up, updated installation instruction

parent 3037bcaa
......@@ -3,58 +3,28 @@ Installation of g_permute
-------------------------
*********************
PREREQUISITES: installing GROMACS-3.3.1
From the parent directory, where you unpacked g_permute-1.1.tar.gz run "sh g_permute/instGMX331.sh" to install GROMACS-3.3.1
PREREQUISITE: GROMACS 2018
*********************
g_permute consists of two parts, the 'lap' library in 'g_permute/liblap' and the tool
itself, 'g_permute' in 'g_permute/src.
Both parts rely on the GROMACS MD package for some functions.
The code has been tested with and requires GROMACS Version 3.3.1.
A - quick version, no editing of Makefiles required
---------------------------------------------------
when using the above mentioned install script, a mere
cd liblap
make
make install
cd ../src
make
make install
The code has been tested with and requires GROMACS 2018
will install g_permute in ../g_permute-1.1 with the directories 'lib' 'include' and 'bin';
Make sure LD_LIBRARY_PATH is afterwards set to include the path of the '../g_permute-1.1/lib' directory otherwise g_permute will report a shared library error.
B - advanced version, adjust Makefiles to your GROMACS-3.3.1 (compiled with shared library support)
Adjust Makefile to your GROMACS installation (compiled with shared library support)
------------------------------------------------------
1) cd into 'liblap' and edit the Makefile
- set PREFIX to the directory you want the final library to go
(leaving the recommended default in Version A will install liblap.so in
../g_permute-1.1/lib
Make sure the path you enter here is in your LD_LIBRARY_PATH when running g_permute
- specifiy GMXDIR, GMXLIB and GMXINC to point to your Gromacs
installation
make sure you have compiled gromacs with shared libraries enabled
(i.e. with 'configure --enable-shared')
[alternatively, issuing the follwing command in
gromacs-x.x.x/src may suffice 'ln -s libgmx/.libs/libgmx.a libgmx/libgmx.a']
in liblap/, type 'make', then 'make install'
1) cd into 'src' and edit the Makefile
2) cd into 'src' and edit the Makefile as in liblap
type 'make' followed by 'make install'
leaving the default setting for PREFIX will install g_permute to ../g_permute-1.1/lib
2) set PREFIX to the directory you want the final library to go
Make sure the path you enter here is in your LD_LIBRARY_PATH when running g_permute
3) specifiy GMXDIR, GMXLIB and GMXINC to point to your Gromacs installation
make sure you have compiled gromacs with shared libraries enabled
(i.e. with 'configure --enable-shared')
4) in src/, type 'make', then 'make install'
Have fun !
#!/bin/bash
#This script will unpack, compile first FFTW and then GROMACS and install GROMACS in ./gromacs afterwards.
#this is intended to be bundled with g_permute-1.1 and higher
#and should be started from a directory above its location:
#after unpacking just type
#cd .. and
#bash g_permute/instGMX331.sh
#
#by juergen haas < juergenhaas@gmx.net >
VER=3.3.1
GMXFILE=gromacs-$VER.tar.gz
FFTWFILE=fftw-3.1.2.tar.gz
GCCFILE=gcc-4.0.2.tar.bz2
echo
echo
echo ============= HINTS FOR INSTALLATION ==========
echo If you wish to compile and subsequently use gcc-4.0.2 set the switch compileGCC=1 in this install script
echo
echo If you wish to use change the number of processors used during compilation set the switch compileParallel=1 and modify ParArgs to the number desired in this install script
echo ==================================================
echo
compileGCC=0
compileParallel=1
ParArgs="-j `cat /proc/cpuinfo|grep proc -c`"
#nothing should be changed by the user below this line*************************
echo CHECKING prerequisites...
echo
echo Checking current path: `pwd`
if [ $(basename `pwd`) == "g_permute" ];then
echo
echo It seems you are in the g_permute source directory
echo
echo default target directory for GROMACS-$VER installation: `pwd`/../gromacs
echo please change to different directory and call `pwd`/$0
echo exiting ...
exit -1
fi
echo ============= STARTING INSTALLATION NOW ==========
echo We need
echo $GMXFILE
echo $FFTWFILE
if [ $compileGCC -eq 1 ];then echo $GCCFILE;fi
echo
if [ $compileGCC -ne 0 ];then
if [ -f $GCCFILE ]; then
echo found $GCCFILE
elif [ $compileGCC -eq 1 ];then
echo trying:
echo wget ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.0.2/$GCCFILE
wget ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.0.2/$GCCFILE
echo SKIPPING - Finished Download
echo
echo
if [ ! -f $GCCFILE ];then
echo $GCCFILE not found please supply $GCCFILE from www.gromacs.org
echo aborting..
echo
exit -1
fi
fi
fi
if [ -f $GMXFILE ]; then
echo found $GMXFILE
else
echo trying:
echo wget ftp://ftp.gromacs.org/pub/gromacs/$GMXFILE
wget ftp://ftp.gromacs.org/pub/gromacs/$GMXFILE
echo Finished Download
echo
echo
if [ ! -f $GMXFILE ];then
echo $GMXFILE not found please supply $GMXFILE from www.gromacs.org
echo aborting..
echo
exit -1
fi
fi
if [ -f $FFTWFILE ]; then
echo found $FFTWFILE
else
echo trying:
echo wget ftp://ftp.fftw.org/pub/fftw/$FFTWFILE
wget http://www.fftw.org/$FFTWFILE
echo Finished Download
echo
echo
if [ ! -f $FFTWFILE ];then
echo $FFTWFILE not found please supply $FFTWFILE from www.fftw.org
echo aborting..
echo
exit -2
fi
fi
#Above all gcc-3.3.6
#echo
#echo Installing ${GCCFILE%*.tar*}
#echo
#tar -xvjf $GCCFILE &> lam.log
#cd `ls -d */|grep gcc-|sed 's/\///g'`
#pwd
#sleep 1
#configure --prefix=/usr/local/gcc-3.3.6 --enable-languages=c,c++,g77 >& confi_.log
#./configure --prefix=../gcc336 --enable-languages=c,c++,g77 &> confi_.log
#make bootstrap
#make install
#export CC=../gcc336/bin/gcc
#export F77=../gcc336/bin/g77
#export PATH=../gcc336/bin:$PATH
#cd ..
#Above all gcc-4.0.2 if specified.
if [ $compileGCC -eq 1 ];then
echo
echo Installing ${GCCFILE%*.tar*}
echo
tar -xvjf $GCCFILE &> gcc.log
relPath=`ls -d */|grep gcc-|sed 's/\///g'`
relInstPath=`echo $relPath|sed 's/[-\.]//g'`
echo $relInstPath $relPath
InstPath=`pwd`/$relInstPath
mkdir "objdir_"$relPath
cd "objdir_"$relPath
pwd
sleep 1
../$relPath/configure --prefix=$InstPath --enable-languages=c,c++,f95 &> confi_.log
make $ParArgs bootstrap >& make.log
make $ParArgs install >& makeInst.log
export CC=$InstPath/bin/gcc
export F77=$InstPath/bin/gfortran
export CXX=$InstPath/bin/g++
#export DSSP=$InstPath/../dssp
export PATH=$InstPath/bin:$PATH
cd ..
else
echo make sure you have f77,g77 or gfortran installed and set the environment variables F77,CC and CXX
echo also make sure that \$PATH contains the directories of the compilers needed.
echo "example: export F77=/usr/bin/gfortran"
fi
#1 we care for the fftw libraries
echo
echo Installing ${FFTWFILE%*.tar*}
echo
tar -xvzf $FFTWFILE &>fftw.log
cd ${FFTWFILE%.tar.gz}
pwd
sleep 1
./configure --prefix=`pwd`/../fftw --enable-type-prefix --enable-float >& confi_FFTW.log
make $ParArgs clean >& makeFFTW.log
make $ParArgs >& makeFFTW.log
if [ $? -ne 0 ];then echo exiting, due to error encountered;exit -128;fi
make install >& makeInstFFTW.log
cd ..
#3 we install gromacs
echo
echo Now installing ${GMXFILE%*.tar*}
echo
tar -xvzf $GMXFILE &>gromacs.log
cd gromacs-$VER
pwd
sleep 1
echo
echo making non-parallel gromacs
export LDFLAGS="-L`pwd`/../fftw/lib"
export CFLAGS="-I`pwd`/../fftw/include "
export PATH=$PATH:`pwd`/../lam/bin
./configure --prefix=`pwd`/../gromacs --disable-x --without-x >& confi_SERIAL_GMX.log
make $ParArgs >& makeSERIAL_GMX.log
if [ $? -ne 0 ];then echo exiting, due to error encountered;exit -128;fi
make install >& makeInstSERIAL_GMX.log
cd ..
#
echo Reached end of install script for GROMACS-$VER
echo
echo
echo please issue \"make\" followed by \"make install\" first in g_permute/liblap and then g_permute/src/.
echo NOTE: in case you want to recompile it is usually safer to issue \"make clean\" before \"make\"
#!/bin/sh
#
# This is a Gromacs 3.0 template makefile for your own utility programs.
#
# Copy this file to whatever directory you are using for your own
# software and add more targets like the template one below.
#
# If you are using gmake it is relatively straightforward to add
# an include based on environment variables (like previous Gromacs versions)
# to select compiler flags and stuff automatically, but below it is static:
#
SHELL=/bin/sh
# this is where executable and libraries will go - we recommend to
# leave PREFIX to the default
# PREFIX must match the PREFIX later used in the ../src/Makefile
#
# note that PREFIX/lib has to be in your LD_LIBRARYPATH to run the program.
PREFIX = ../../g_permute-1.1
EXEC_PREFIX = $(PREFIX)
BINDIR = $(EXEC_PREFIX)/bin
LIBDIR = $(EXEC_PREFIX)/lib
INCDIR = $(EXEC_PREFIX)/include
# pointer to your Gromacs installation - please adjust
GMXDIR = /usr/local/gromacs/2018/2018.2-impi2017-fftw337-gcc640-cuda91/
#/usr/local/gromacs/5.1/514-impi2017-fftw332-gcc540-cuda80
#/usr/local/gromacs/3.3/334-impi403-fftw331-gcc470
GMXLIB = $(GMXDIR)/lib64
GMXINC = $(GMXDIR)/include
#$(GMXDIR)/include/gromacs
# Source of the installation. No need to change this
SRCDIR = ..
CC = g++
LDFLAGS = -L$(GMXLIB) -lm
INCFLAGS = -I$(SRCDIR)/include -I$(GMXINC)
LDSOFLAGS = -shared -Wl,-soname,
#for compilation on 64bit systems uncomment the following line
CFLAGS = -O3 -fomit-frame-pointer -finline-functions -Wall -Wno-unused -fPIC -DPIC -funroll-all-loops -ggdb -std=c++11
#for compilation on 32bit systems uncomment the following line
#CFLAGS = -O0 -fomit-frame-pointer -finline-functions -Wall -Wno-unused -malign-double -funroll-all-loops -ggdb
OBJS = lap.o memory.o
EXE = liblap.so
tvar := $(shell if (test -h $(LIBDIR)/$(EXE).1);then echo 1;else echo 0;fi)
# pattern rule to compile object files from C files
# might not work with make programs other than GNU make
%.o : %.c Makefile
$(CC) $(INCFLAGS) $(CFLAGS) -c $< -o $@
all: $(EXE)
install: $(EXE)
mkdir -p $(BINDIR) $(LIBDIR) $(INCDIR)
cp $(EXE) $(LIBDIR)
cp ../include/lap.h ../include/gnrl.h $(INCDIR)
ifeq ($(tvar),0)
ln -s $(LIBDIR)/$(EXE) $(LIBDIR)/$(EXE).1
endif
$(EXE): $(OBJS) Makefile
$(CC) $(LDSOFLAGS)$(EXE).1 -o $(EXE) $(OBJS) $(LDFLAGS) $(CFLAGS)
.PHONY : clean
clean:
rm -f $(OBJS) $(EXE) $(LIBDIR)/$(EXE)
No preview for this file type
No preview for this file type
......@@ -3,23 +3,16 @@
SHELL=/bin/sh
# set LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lheinz/Install/g_permute_dev/g_permute-1.1/lib/:/cm/local/apps/gcc/6.1.0/lib64/ # the last path is needed for libstdc++
# load MPI: module load intel-mpi/64/5.1.2/150
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
# this is where executable and libraries will go - we recommend to
# leave PREFIX unchanged
# in any case this must match the location where liblap was installed to
PREFIX = ../../g_permute-1.1
EXEC_PREFIX = $(PREFIX)
BINDIR = $(EXEC_PREFIX)/bin
# pointer to your Gromacs installation - adjust only if you did *NOT* use the installation script instGMX331.sh supplied with the distribution
GMXDIR = /usr/local/gromacs/2018/2018.2-impi2017-fftw337-gcc640-cuda91/
#/usr/local/gromacs/2019/2019.3-impi2017-fftw337-gcc740-cuda10/
#/usr/local/gromacs/2018/2018.2-impi2017-fftw337-gcc640-cuda91/
#/usr/local/gromacs/5.1/514-impi2017-fftw332-gcc540-cuda80
#/usr/local/gromacs/3.3/334-impi403-fftw331-gcc470
# pointer to your Gromacs installation
GMXDIR = /home/lheinz/Install/gromacs-2018/
GMXLIB = $(GMXDIR)/lib64
GMXINC = $(GMXDIR)/include
......@@ -29,16 +22,11 @@ FFTWLIB = /home/ckutzne/fftw/337-gcc485-sse2-avx-avx2/lib64
# Source of the installation. No need to change this
SRCDIR = ..
# CC = cc # switch to C++
CXX = mpicxx
LDFLAGS = -L/usr/lib -L/usr/lib64 -L/usr/local/lib -L$(GMXLIB) -L$(FFTWLIB) -L/cm/local/apps/gcc/6.1.0/lib64/ -lm -lgromacs -lpthread -lstdc++ -lfftw3f
#-L/cm/local/apps/gcc/6.1.0/lib64/
CXX = g++
LDFLAGS = -L/usr/lib -L/usr/lib64 -L/usr/local/lib -L$(GMXLIB) -L$(FFTWLIB) -lgromacs -lfftw3f -lpthread -Wl,-rpath,$(GMXLIB)
#-L/cm/local/apps/gcc/6.1.0/lib64/ -lstdc++ -lm -lstdc++
INCFLAGS= -I$(SRCDIR)/include -I../include -I$(GMXINC)
#for compilation on 64bit systems uncomment the following line
CFLAGS = -O3 -g -fomit-frame-pointer -finline-functions -Wall -Wno-unused -funroll-all-loops -ggdb -std=c++11 -fopenmp
#for compilation on 32bit systems uncomment the following line
#CFLAGS = -O0 -g -fomit-frame-pointer -finline-functions -Wall -Wno-unused -malign-double -funroll-all-loops -ggdb
LDSOFLAGS = -Wl
OBJS = g_permute.o ../liblap/lap.o ../liblap/memory.o
EXE = g_permute
......
#Makefile for g_permute; edit the variables according to your needs
SHELL=/bin/sh
# set LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lheinz/Install/g_permute_dev/g_permute-1.1/lib/:/cm/local/apps/gcc/6.1.0/lib64/ # the last path is needed for libstdc++
# load MPI: module load intel-mpi/64/5.1.2/150
# this is where executable and libraries will go - we recommend to
# leave PREFIX unchanged
# in any case this must match the location where liblap was installed to
PREFIX = ../../g_permute-1.1
EXEC_PREFIX = $(PREFIX)
BINDIR = $(EXEC_PREFIX)/bin
# pointer to your Gromacs installation - adjust only if you did *NOT* use the installation script instGMX331.sh supplied with the distribution
GMXDIR = /usr/local/gromacs/2018/2018.2-impi2017-fftw337-gcc640-cuda91/
#/usr/local/gromacs/2019/2019.3-impi2017-fftw337-gcc740-cuda10/
#/usr/local/gromacs/2018/2018.2-impi2017-fftw337-gcc640-cuda91/
#/usr/local/gromacs/5.1/514-impi2017-fftw332-gcc540-cuda80
#/usr/local/gromacs/3.3/334-impi403-fftw331-gcc470
GMXLIB = $(GMXDIR)/lib64
GMXINC = $(GMXDIR)/include
# we have to link fftw, even if we don't use it
FFTWLIB = /home/ckutzne/fftw/337-gcc485-sse2-avx-avx2/lib64
# Source of the installation. No need to change this
SRCDIR = ..
# CC = cc # switch to C++
CXX = mpicxx
LDFLAGS = -L/usr/lib -L/usr/lib64 -L/usr/local/lib -L$(GMXLIB) -L$(FFTWLIB) -L/cm/local/apps/gcc/6.1.0/lib64/ -lm -lgromacs -lpthread -lstdc++ -lfftw3f
#-L/cm/local/apps/gcc/6.1.0/lib64/
INCFLAGS= -I$(SRCDIR)/include -I../include -I$(GMXINC)
#for compilation on 64bit systems uncomment the following line
CFLAGS = -O3 -g -fomit-frame-pointer -finline-functions -Wall -Wno-unused -funroll-all-loops -ggdb -std=c++11 -fopenmp
#for compilation on 32bit systems uncomment the following line
#CFLAGS = -O0 -g -fomit-frame-pointer -finline-functions -Wall -Wno-unused -malign-double -funroll-all-loops -ggdb
LDSOFLAGS = -Wl
OBJS = g_permute.o ../liblap/lap.o ../liblap/memory.o
EXE = g_permute
install: $(EXE)
mkdir -p $(BINDIR)
cp $(EXE) $(BINDIR)
../liblap/lap.o: ../liblap/lap.c Makefile
$(CXX) $(INCFLAGS) $(CFLAGS) -c $< -o $@
../liblap/memory.o: ../liblap/memory.c Makefile
$(CXX) $(INCFLAGS) $(CFLAGS) -c $< -o $@
g_permute.o: g_permute.cpp Makefile
$(CXX) $(INCFLAGS) $(CFLAGS) -c $< -o $@
all: $(EXE)
$(EXE): $(OBJS) Makefile
$(CXX) -o $(EXE) $(OBJS) $(LDFLAGS) $(CFLAGS)
.PHONY : clean
clean:
rm -f $(OBJS) $(EXE)
No preview for this file type
......@@ -39,27 +39,7 @@
#include <string.h>
#include <math.h>
//#include "main.h"
//#include "macros.h" -> possibly substituted by arraysize.h
//#include "statutil.h" -> possibly substituted by gromacs/fileio/trxio.h
//#include "copyrite.h"
//#include "sysstuff.h"
//#include "txtdump.h"
//#include "fatal.h" -> substituted by fatalerror.h
//#include "xtcio.h" -> substituted by gromacs/fileio/xtcio.h
//#include "enxio.h"
// #include "assert.h"
//#include "smalloc.h" -> substituted by gromacs/utility/smalloc.h
//#include "names.h"
//#include "gmxfio.h"
//#include "tpxio.h" -> substituted by gromacs/fileio/tpxio.h
//#include "trnio.h"
//#include "vec.h" -> substituted by gromacs/math/vec.h
//#include "statutil.h" -> possibly substituted by filenm.h, futil.h, pargs.h
#include "gp_memory.h"
//#include "index.h" -> substituted by gromacs/topology/index.h
//#include "confio.h" -> substituted by gromacs/fileio/confio.h
//#include "pbc.h" -> substituted by gromacs/pbcutil/pbc.h
#include <lap.h>
#include "gromacs/commandline/pargs.h"
......@@ -79,8 +59,6 @@
#include "gromacs/pbcutil/pbc.h"
#include <omp.h>
/* pointers to two debug output files, only used in debug mode */
#ifdef __DEBUG
static FILE *assignment, *costmatrix;
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment