Skip to content

Commit

Permalink
Fixed some minor compile issues, made Makefile more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
kcroker committed Feb 6, 2016
1 parent 9971237 commit 61e9e30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
23 changes: 5 additions & 18 deletions Makefile.reference
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#
# - NGRAVS_ACCUMULATOR:
# Enable to track the number of particles contained within tree nodes. This information
# is then accurately provided to AccelFxns and SplineFxns for making an accurate monopole
# is then accurately provided to AccelFxns and SplineFxns for making an improved monopole
# approximation in exotic force scenarios.
#
# - NGRAVS_L3VIOLATION:
Expand Down Expand Up @@ -145,22 +145,9 @@ OPT += -DSYNCHRONIZATION
CC = mpicc # sets the C-compiler
OPTIMIZE = -g -O3 -Wall
MPICHLIB =
FFTW_INCL= -I/home/twili/research/include
FFTW_LIBS= -L/home/twili/research/lib


#--------------------------------------- Some sample directories

ifeq ($(SYSTYPE),"RZG_LinuxCluster-gcc")
CC = mpiccg
OPTIMIZE = -O3 -Wall
GSL_INCL = -I/afs/rzg/u/vrs/gsl_linux_gcc3.2/include
GSL_LIBS = -L/afs/rzg/u/vrs/gsl_linux_gcc3.2/lib -Wl,"-R /afs/rzg/u/vrs/gsl_linux_gcc3.2/lib"
FFTW_INCL= -I/afs/rzg/u/vrs/fftw_linux_gcc3.2/include
FFTW_LIBS= -L/afs/rzg/u/vrs/fftw_linux_gcc3.2/lib
HDF5INCL = -I/afs/rzg/u/vrs/hdf5_linux/include
HDF5LIB = -L/afs/rzg/u/vrs/hdf5_linux/lib -lhdf5 -lz -Wl,"-R /afs/rzg/u/vrs/hdf5_linux/lib"
endif
# Its usually easier to define these in your environment if you need them
#GADGET2_INCL= -I/home/twili/research/include
#GADGET2_LIBS= -L/home/twili/research/lib


ifneq (HAVE_HDF5,$(findstring HAVE_HDF5,$(OPT)))
Expand All @@ -186,7 +173,7 @@ OBJS = main.o run.o predict.o begrun.o endrun.o global.o \
INCL = allvars.h proto.h tags.h Makefile


CFLAGS = $(OPTIONS) $(FFTW_INCL) $(FFTW_LIBS)
CFLAGS = $(OPTIONS) $(GADGET2_INCL) $(GADGET2_LIBS)


ifeq (NOTYPEPREFIX_FFTW,$(findstring NOTYPEPREFIX_FFTW,$(OPT))) # fftw installed with type prefix?
Expand Down
8 changes: 7 additions & 1 deletion ngravs.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ double ewald_psi(double x[3])
double coloyuk(double target, double source, double h, double r, long N) {
return yukawa(target, source, h, r, N) + newtonian(target, source, h, r, N);
}


#ifdef PMGRID
double pgcoloyuk(double target, double source, double k2, double k, long N) {
return pgyukawa(target, source, k2, k, N) + pgdelta(target, source, k2, k, N);
}
Expand All @@ -830,6 +831,7 @@ double ewald_psi(double x[3])

return normed_pgyukawa(target, source, k2, k, N) + normed_pgdelta(target, source, k2, k, N);
}
#endif

void coloyuk_lattice_force(int iii, int jjj, int kkk, double x[3], double force[3]) {

Expand All @@ -856,6 +858,9 @@ double ewald_psi(double x[3])
/*! A periodic yukawa k-space Greens function, normalized by the Newtonian interaction
* NOTE: k is supplied dimensionlessly in terms of PMGRID so k \in [-PMGRID/2, PMGRID/2]
*/
#ifdef PMGRID
// This #ifdef is required because the structures for tracking the smoothing length
// are not allocated unless running in periodic mode.
double pgyukawa(double target, double source, double k2, double k, long N) {

double ym = YUKAWA_IMASS/(2*M_PI);
Expand All @@ -873,6 +878,7 @@ double normed_pgyukawa(double target, double source, double k2, double k, long N
double ym = gridKtoNormK(YUKAWA_IMASS/(2*M_PI));
return k2 / (k2 + ym*ym) * exp(-ym*ym*0.25);
}
#endif

/*! This function computes the Madelung constant for the yukawa potential
* which depends on the box length interestingly...
Expand Down
2 changes: 2 additions & 0 deletions ngravs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
*/

#ifdef PMGRID
struct ngravsInterpolant *ngravsPeriodicTable;

double normKtoGridK(double normk) {
Expand Down Expand Up @@ -188,6 +189,7 @@ void ngravsConvolutionFree(struct ngravsInterpolant *s) {
fftw_destroy_plan(s->plan);
free(s);
}
#endif

//////////////////////// END FOURIER INTEGRATION ROUTINES //////////

Expand Down

0 comments on commit 61e9e30

Please sign in to comment.