### $Id: Makefile,v 1.20 2004/04/14 14:33:42 nilshau Exp $ ### Makefile for modular pencil code ## Default settings: they can be overwritten by src/Makefile.local ## which should be present in each local to run directory. LIBSIG= LDMPI=-lmpi MPICOMM = nompicomm GLOBAL = noglobal IO = io_dist FFT = fft FFTPACK = fftpack POWER = nopower_spectrum DEBUG = debug_c HYDRO = hydro VISCOSITY = visc_const DENSITY = density ENTROPY = noentropy MAGNETIC = nomagnetic RADIATION = noradiation PSCALAR = nopscalar DUSTVELOCITY = nodustvelocity DUSTDENSITY = nodustdensity INTERSTELLAR = nointerstellar IONIZATION = noionization STRUCT_FUNC = nostruct_func INITCOND_SPEC= noinitcond_spec GRAVITY = nograv FORCING = noforcing SHEAR = noshear TIMEAVG = notimeavg ## This allows us to add -r8 for double precision in Makefile.local FFLAGS_GENERAL= ##Flag for OpenMP (For IRIX you can turn of -mp in Makefile.local, ##for all other operating systems it is being turn off in machine ##dependent part of this file.) OMP_FLAGS= -mp ## Overwrite settings that are local to each run directory include Makefile.local ## Default settings FC=f90 FFLAGS=-O3 FFLAGS= F90FLAGS= F77FLAGS= CFLAGS=-O3 -DFUNDERSC=1 ## The following block (`Begin/End machine dependent') specifies compilers ## and switches for given architectures and machine names. See ## `perldoc adapt-mkfile' for full documentation of the syntax. ## Compiler flags: ## FFLAGS are used by both the F90 compiler $(FC) and $(F77); ## F90FLAGS are only used by $(FC) ## F77FLAGS are only used by $(F77) ### Begin machine dependent ## IRIX64: #FC=f90 #FFLAGS= -64 -O3 -mips4 #FFLAGS= -auto_use mpi_interface -64 -O3 -C -macro_expand #(gridur|embla|balder) #FFLAGS= -auto_use mpi_interface -64 -O3 -C -macro_expand #(Antares) #FFLAGS= -pfalist -64 -O3 -mips4 -r10000 -C -macro_expand #(Grand) #FFLAGS= -64 -O3 -mips4 -r12000 #(Ukaff) #FFLAGS= -64 -O3 -auto_use mpi_interface -mips4 #(ukaff|origin) #FFLAGS= -64 -O3 -mips4 -r12000 -flist #(green) #FFLAGS= -64 -O3 -mips4 -r12000 #(wrenstandard) #FFLAGS= -64 -O3 -mips4 -r12000 -LNO:cs1=32k:cs2=8M #(wrencache) #FFLAGS= -64 -O3 -mips4 -r12000 -LNO:cs1=32k:cs2=8M -I/share/apps/unsupported/pacx/standard/include -L/share/apps/unsupported/pacx/standard/lib #(wrenpacx) #LDMPI= -L/share/apps/unsupported/pacx/standard/lib -lpacxf -lpacx -lmpi #(wrenpacx) #FFLAGS= -64 -O3 -mips4 -r12000 -LNO:cs1=32k:cs2=8M -I/share/apps/unsupported/pacx/standard/include -L/share/apps/unsupported/pacx/standard/lib #(wren) #LDMPI= -L/share/apps/unsupported/pacx/standard/lib -lpacxf -lpacx -lmpi #(wren) ##FC=/c/brandenb/pacx/bin/pacxfc #(tacsg2) #FFLAGS=-64 -O3 -mips4 #(tacsg2) #OPTFLAGS= -64 #F77=$(FC) #CFLAGS=-O3 -64 -DFUNDERSC=1 ## OSF1: #OMP_FLAGS= #FC=f95 #(Mhd.) #FC=f90 #(Mhd.) #OPTFLAGS=-fast -O5 #OPTFLAGS=-fast -O5 -notransform_loops #(Mhd.) #FFLAGS=$(OPTFLAGS) -tune ev6 -arch ev6 #(Mhd.) #F77=$(FC) #LIBSIG=-lsig ## Linux: ## The -tpp7 flag leads to a 10% speedup on nl6 #OMP_FLAGS= #FC=f95 #FFLAGS=-O3 #F90FLAGS=-u -tpp7 #F90FLAGS= # (fire) #F90FLAGS= #LDMPI= ##LDMPI=-lfmpich -lmpich -lmpe -lpmpich -llmpe # (copson) ##LDMPI=-L/usr/X11R6/lib/ -lfmpich -lampe -lmpe -lpmpich -lX11 # (copson) #FC=mpif90 # (Samos|fire|copson) #FC=/usr/lib/lam/bin/mpif95 #(Cincinnatus|Owen|Master) ##FC=/home/brandenb/pacx/bin/pacxfc #PACX #(fe[0-3]) ##FC=mpif77 #(fe[0-3]) #FC=mpif77 #(ns0) #FC=ifc_6.0 -I/usr/local/lib/LAM/include #(fe[0-9]) #FC=f95 -I/usr/lib/lam/include -mismatch #(morvern) #FC=ifc -I/usr/lib/lam/include #(morvern) ##FC=/home/brandenb/pacx/bin/pacxfc #(ns0) #FC=ifc #(nl6|mmtf|nl19|hamlet) #FC=f95 #(karbala) #FC=pgf90 #(erland|igor|linux29|onsager|fe4) #FFLAGS=-O # (Samos) #FFLAGS= # (fire) #LDMPI=-static -L/usr/local/lib/LAM/lib -llamf77mpi -lmpi -llam -lnsl -lutil -L/usr/local/lib/PGI/linux86/lib -lpgc #(fe[0-4]) #LDMPI=-L/usr/lib/lam/lib -llam -lmpi -lpmpi -llamf77mpi -llammpi++ -llammpio #(morvern) #LDMPI=-static -L/opt/lam/lib -lmpi -llamf77mpi -llam #(nw50) ##FFLAGS=-O3 -ipo #PACX #(fe[0-3]) #FFLAGS=-fast -lm #(erland|igor|linux29|onsager|fe4) #F90FLAGS= #(erland|igor|linux29|onsager|fe4) ##FFLAGS=-O3 -ipo #(fe[0-3]) #FFLAGS= #(fe[0-3]) ##(compiles faster/axel) #FFLAGS=-O4 -C -gline -Wc,-malign-double #(Mephisto) #FFLAGS=-O4 #(nl3) #FFLAGS= -O3 -w90 #(cosmo) #FC=ifc -I/usr/include #(cosmo) #FC=ifc -I/usr/include #(nl6) #LDMPI=-L/usr/lib -lmpi -llamf77mpi -llam -lpmpi -llammpi++ -llammpio #(cosmo) #LDMPI= # (Samos|fire) #CFLAGS=-O3 -DFUNDERSC=1 -Wall #F77=$(FC) #F77=$(FC) -dusty #(nl3|Mephisto|mmtf|karbala|morvern) #F77=$(FC) -lm #(tycho|erland|igor|onsager|fe4) #F77=$(FC) #(Cincinnatus|Owen|Master|cosmo|nl6) #FC=pgf90 #(tycho) #FFLAGS=-fast -lm #(tycho) #F90FLAGS= #(tycho) ##FC=ifc #(tycho) ##F90FLAGS= #(tycho) ##FFLAGS= -O0 #(tycho) ## SunOS: #OMP_FLAGS= #FC=f90 #FC=pghpf #(Lomond) #FFLAGS=-O4 #FFLAGS= -Msmp -O4 #(Lomond) #CFLAGS=-O4 -DFUNDERSC=1 #CFLAGS=-O4 -DFUNDERSC=0 #(ursa) #LDMPI=-L/opt/local/mpich/lib -lmpich -lsocket -lnsl -laio #F77=$(FC) ## UNICOS/mk: #OMP_FLAGS= #FC=f90 #FFLAGS=-O3 -em ## HI-UX/MPP: #OMP_FLAGS= #FC=mpif90 #F77=$(FC) #FFLAGS=-lowercase -I/usr/mpi/include -O4 -pvec -parallel=0 #FFLAGS=-lowercase -OSS -noparallel -O4 #CFLAGS=-O4 -DFUNDERSC=0 #LDMPI=-L/usr/mpi/lib/lib32 -lfmpi -lmpi ## SUPER-UX: #OMP_FLAGS= #FC=f90 -I/usr/include #F77=$(FC) #FFLAGS=-C hopt ## AIX: #OMP_FLAGS= #FC=xlf90 #FC=mpxlf90 #(Sp[12]) #FFLAGS=-O5 -qsuffix=f=f90 ### End machine dependent LD=$(FC) LDFLAGS=$(FFLAGS) $(FFLAGS_GENERAL) $(OMP_FLAGS) # -Mpencil.map ## Generic rules: .SUFFIXES: .f90 .mod .f.o: $(F77) $(FFLAGS) $(FFLAGS_GENERAL) $(OMP_FLAGS) $(F77FLAGS) -c $*.f .f90.o: $(FC) $(FFLAGS) $(FFLAGS_GENERAL) $(OMP_FLAGS) $(F90FLAGS) -c $*.f90 .mod.o: $(FC) $(FFLAGS) $(FFLAGS_GENERAL) $(OMP_FLAGS) $(F90FLAGS) -c $*.f90 .c.o: $(CC) $(CFLAGS) -c $*.c ##### #default: makefile cparam.inc code default: makefile code #pacx: pacx-makefile cparam.inc code pacx: pacx-makefile code makefile: Makefile adapt-mkfile Makefile makefile pacx-makefile: Makefile pacx-adapt-mkfile Makefile pacx-makefile cp pacx-makefile makefile #cparam.inc: Makefile Makefile.local # mkcparam Makefile Makefile.local -o cparam.inc mpicomm_double.f90: mpicomm.f90 sed -e 's/REAL/DOUBLE_PRECISION/g' mpicomm.f90 > mpicomm_double.f90 mpicomm_.f90: mpicomm.f90 sed -e 's/\(MPI_[A-Z_]*\)\([ ]*(\)/\1_\2/' mpicomm.f90 | sed -e 's/\(MPI_[A-Z_]*\)\([ ]*!\)/\1_\2/' > mpicomm_.f90 mpicomm_double_.f90: mpicomm_double.f90 sed -e 's/\(MPI_[A-Z_]*\)\([ ]*(\)/\1_\2/' mpicomm_double.f90 | sed -e 's/\(MPI_[A-Z_]*\)\([ ]*!\)/\1_\2/' > mpicomm_double_.f90 code: wavenumbers.x frenet.x pdf.x alfven_subbox.x struct_sph.x pdf_xyz.x technical_OMP=cparam.o cdata.o general.o deriv_OMP.o technical=cparam.o cdata.o general.o deriv.o physics= comm_deps_OMP=$(technical_OMP) sub_OMP.o $(MPICOMM).o fft.o $(FFTPACK).o comm_deps=$(technical) sub.o $(MPICOMM).o fft.o $(FFTPACK).o wavenumbers_deps=$(comm_deps_OMP) wavenumbers=wavenumbers.o $(wavenumbers_deps) correlation_deps=$(comm_deps_OMP) correlation=correlation.o $(correlation_deps) frenet_deps=cparam.o cdata.o general.o deriv_OMP.o sub_OMP.o $(MPICOMM).o fft.o $(FFTPACK).o frenet=frenet.o $(frenet_deps) #struct_sph_deps=cparam.o cdata.o general.o deriv_OMP.o sub_OMP.o $(MPICOMM).o fft.o $(FFTPACK).o common.o struct_sph_deps=$(comm_deps_OMP) common.o struct_sph=struct_sph.o $(struct_sph_deps) alfven_subbox=alfven_subbox.o $(frenet_deps) pdf_deps=$(comm_deps_OMP) pdf=pdf.o $(pdf_deps) pdf_xyz_deps=$(comm_deps) pdf_xyz=pdf_xyz.o $(pdf_xyz_deps) wavenumbers.x: $(wavenumbers) $(LD) $(LDFLAGS) $(wavenumbers) $(LDMPI) $(LIBSIG) -o wavenumbers.x correlation.x: $(correlation) $(LD) $(LDFLAGS) $(correlation) $(LDMPI) $(LIBSIG) -o correlation.x frenet.x: $(frenet) $(LD) $(LDFLAGS) $(frenet) $(LDMPI) $(LIBSIG) -o frenet.x struct_sph.x: $(struct_sph) $(LD) $(LDFLAGS) $(struct_sph) $(LDMPI) $(LIBSIG) -o struct_sph.x alfven_subbox.x: $(alfven_subbox) $(LD) $(LDFLAGS) $(alfven_subbox) $(LDMPI) $(LIBSIG) -o alfven_subbox.x pdf.x: $(pdf) $(LD) $(LDFLAGS) $(pdf) $(LDMPI) $(LIBSIG) -o pdf.x pdf_xyz.x: $(pdf_xyz) $(LD) $(LDFLAGS) $(pdf_xyz) $(LDMPI) $(LIBSIG) -o pdf_xyz.x wavenumbers.o: wavenumbers.f90 $(wavenumbers_deps) correlation.o: correlation.f90 $(correlation_deps) frenet.o: frenet.f90 $(frenet_deps) struct_sph.o: struct_sph.f90 $(struct_sph_deps) alfven_subbox.o: alfven_subbox.f90 $(frenet_deps) pdf.o: pdf.f90 $(pdf_deps) pdf_xyz.o: pdf_xyz.f90 $(pdf_xyz_deps) # cparam.o: cparam.f90 cparam.local cparam.inc cdata.o: cdata.f90 cparam.o common.o: common.f90 common.local cparam.o deriv.o: deriv.f90 cdata.o deriv_OMP.o: deriv_OMP.f90 cdata.o fft.o: fft.f sub.o: sub.f90 cdata.o deriv.o $(MPICOMM).o general.o sub_OMP.o: sub_OMP.f90 cdata.o deriv_OMP.o $(MPICOMM).o general.o general.o: general.f90 cparam.o $(MPICOMM).o: $(MPICOMM).f90 cdata.o general.o $(FFT).o #$(FFTPACK).o # Needed for the underscore trick: mpicomm_.f90: mpicomm.f90 # Clean up, but leave makefile and TAGS clean: rm -f *.x *.o *.mod *.d *.inc *.il rm -f work.pc work.pcl # Clean up all cleann: clean rm -f makefile TAGS # Remove all build files, but keep executables run: rm -f *.o *.mod *.d *.inc rm -f work.pc work.pcl # Alternative to make run. To copy executables to parent directory. # Make clean(n) could then be run on the source. install: cp *.x ../