source: /cluster/svnroot/bccd-ng/branches/skylar/bccd-3.4.0/trees/etc/skel/Makefile @ 5007

Last change on this file since 5007 was 5007, checked in by skylar, 6 years ago

removing ATLAS from skel makefile and modules re #899

File size: 6.2 KB
Line 
1# $\Id$
2#
3# This file is part of BCCD, an open-source live CD for computational science
4# education.
5#
6# Copyright (C) 2010 Andrew Fitz Gibbon, Paul Gray, Kevin Hunter, Dave Joiner,
7#   Sam Leeman-Munk, Tom Murphy, Charlie Peck, Skylar Thompson, & Aaron Weeden
8
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
22###############################################################################
23# Makefile for the modules included in ~bccd on the BCCD (http://bccd.net)
24#
25# Add NO_X11=1 to the make command line to omit X libraries.
26# Add DEBUG=1 to add -ggdb to CFLAGS
27# Add PROFILE=1 to add -pg to CFLAGS and LDFLAGS
28# Add STAT_KIT=1 to enable StatKit
29###############################################################################
30
31# Test for Intel compilers, act accordingly
32ifeq ($(findstring intel,$(LOADEDMODULES)),intel)
33        CC = icc
34        OMPFLAGS = -openmp -DOMP
35else
36        CC = gcc
37        OMPFLAGS = -fopenmp -DOMP
38endif
39
40MPICC = mpicc
41MPICXX = mpicxx
42NVCC = nvcc
43
44CFLAGS = -O2
45NVCCFLAGS = --compiler-bindir=gcc
46NVMPICCFLAGS = --compiler-bindir=mpicc
47MPIFLAGS = -D_MPI
48
49ifdef STAT_KIT
50        EXTRA_COBJS += ../StatKit/petakit/pkit-c.o
51        EXTRA_CXXOBJS += ../StatKit/petakit/pkit-cxx.o
52        CFLAGS += -DSTAT_KIT
53endif
54
55ifdef NO_X11
56        CFLAGS += -DNO_X11
57else
58        LIBS += -lX11
59        LDFLAGS += -L/usr/X11R6/lib
60endif
61
62ifdef DEBUG
63        CFLAGS += -ggdb
64endif
65
66ifdef PROFILE
67        CFLAGS += -pg
68        LDFLAGS += -pg
69endif
70
71#For Modules using FFTW (version 3.3)
72ifeq ($(FFTW), 1)
73        ifeq ($(wildcard /etc/bccd-revision),)   # not the BCCD
74                CFLAGS += -I/mounts/al-salam/software/fftw-3.3/include
75                LDFLAGS += -L/mounts/al-salam/software/fftw-3.3/lib
76                LIBS += -lfftw3f
77        else                                     # the BCCD
78                # this is a placeholder until we build FFTW into a module
79                # FLAGS +=
80                # LDFLAGS +=
81                # LIBS +=
82        endif
83endif
84
85# For Modules using NetCDF
86ifeq ($(NETCDF), 1)
87        ifeq ($(wildcard /etc/bccd-revision),) # Not the BCCD
88                CFLAGS += -I$(NETCDF_INCLUDE)/ -DHAS_NETCDF
89                LDFLAGS += -L$(NETCDF_PATH)/
90                LIBS += -lnetcdf
91        else
92                # this is a placeholder until we build NETCDF into a module
93                # CFLAGS +=
94                # LDFLAGS +=
95                # LIBS +=
96        endif
97endif
98
99# For Modules using Gadget2
100ifeq ($(GADGET2), 1)
101        ifeq ($(wildcard /etc/bccd-revision),) # Not the BCCD
102                CFLAGS += -I/share/apps/hdf5/gnu/include/ -DHAS_HDF5
103                LDFLAGS += -L/share/apps/hdf5/gnu/lib/
104                LIBS += -lhdf5 -lhdf5_hl
105        else
106                # This is a placeholder until we build Gadget2 into a module
107                # CFLAGS +=
108                # LDFLAGS +=
109                # LIBS +=
110        endif
111endif
112
113# For Modules using LIBGD
114ifeq    ($(LIBGD), 1)
115        ifeq    ($(wildcard /etc/bccd-revision),) # Not the BCCD
116                CFLAGS += -DHAS_LIBGD
117                LIBS += -ljpeg -lpng -lz -lgd
118        else
119                # This is a placeholder until we build LibGD into a module
120                # CFLAGS +=
121                # LDFLAGS +=
122                # LIBS +=
123        endif
124endif
125
126# For modules using CUBLAS
127ifeq ($(CUBLAS), 1)
128        LIBS += -lcublas
129endif
130
131LIBS += -lm
132LDFLAGS += $(LIBS)
133       
134$(PROGRAM).c-serial:
135        $(CC) $(CSRCS) $(EXTRA_COBJS) $(CFLAGS) $(LDFLAGS) -o $@
136
137$(PROGRAM).c-mpi:
138        $(MPICC) $(CPPFLAGS) $(CSRCS) $(EXTRA_COBJS) $(CFLAGS) $(MPIFLAGS) $(LDFLAGS) -o $@
139
140$(PROGRAM).cxx-mpi:
141        $(MPICXX) $(CPPFLAGS) $(CXXSRCS) $(EXTRA_CXXOBJS) $(CFLAGS) $(MPIFLAGS) $(LDFLAGS) -o $@
142
143$(PROGRAM).c-openmp:
144        $(CC) $(CSRCS) $(EXTRA_COBJS) $(CFLAGS) $(OMPFLAGS) $(LDFLAGS) -o $@
145
146$(PROGRAM).c-mpi-openmp:
147        $(MPICC) $(CPPFLAGS) $(CSRCS) $(EXTRA_COBJS) $(CFLAGS) $(OMPFLAGS) $(MPIFLAGS) $(LDFLAGS) -o $@
148
149$(PROGRAM).c-cuda:
150        $(NVCC) $(CUDASRCS) $(EXTRA_COBJS) $(CFLAGS) $(NVCCFLAGS) $(LDFLAGS) -o $@
151
152help:
153        @echo "This is the driver Makefile for all the modules shipped in ~bccd."
154        @echo "The following commands are supported:"
155        @echo "  $ make build-all (to build all modules)"
156        @echo "  $ make clean-all (to clean all modules)"
157        @echo "The following options are supported by most modules:"
158        @echo "  NO_X11=1 (do not include an X11 GUI component)"
159        @echo "  DEBUG=1 (adds -ggdb to CFLAGS)"
160        @echo "  PROFILE=1 (adds -pg to CFLAGS and LDFLAGS)"
161        @echo "  STAT_KIT=1 (enables the StatKit performance collector tool)"
162        @echo "You can also cd to a module's directory and type make (options optional)."
163
164build-all:
165        @echo "-------------------------------------"
166        cd CUDA; $(MAKE)
167        @echo "-------------------------------------"
168        cd Life; $(MAKE)
169        @echo "-------------------------------------"
170        cd GalaxSee; $(MAKE)
171        @echo "-------------------------------------"
172        cd Hello-world; $(MAKE)
173        @echo "-------------------------------------"
174        cd Parameter-space; $(MAKE)
175        @echo "-------------------------------------"
176        cd GalaxSee-v2; $(MAKE)
177        @echo "-------------------------------------"
178        cd Area-under-curve; $(MAKE)
179        @echo "-------------------------------------"
180        cd Pandemic; $(MAKE)
181        @echo "-------------------------------------"
182        cd Sieve; $(MAKE)
183        @echo "-------------------------------------"
184        cd Tree-sort; $(MAKE)
185        @echo "-------------------------------------"
186
187clean-all:
188        @echo "-------------------------------------"
189        cd CUDA; $(MAKE) clean
190        @echo "-------------------------------------"
191        cd Life; $(MAKE) clean
192        @echo "-------------------------------------"
193        cd GalaxSee; $(MAKE) clean
194        @echo "-------------------------------------"
195        cd Hello-world; $(MAKE) clean
196        @echo "-------------------------------------"
197        cd Parameter-space; $(MAKE) clean
198        @echo "-------------------------------------"
199        cd GalaxSee-v2; $(MAKE) clean
200        @echo "-------------------------------------"
201        cd Area-under-curve; $(MAKE) clean
202        @echo "-------------------------------------"
203        cd Pandemic; $(MAKE) clean
204        @echo "-------------------------------------"
205        cd Sieve; $(MAKE) clean
206        @echo "-------------------------------------"
207        cd Tree-sort; $(MAKE) clean
208        @echo "-------------------------------------"
209        cd StatKit/petakit; $(MAKE) clean
210        @echo "-------------------------------------"
211       
212clean:
213        /bin/rm -f $(CLEAN)
Note: See TracBrowser for help on using the repository browser.