(file) Return to make_basic.mk CVS log (file) (dir) Up to [Development] / JSOC

  1 arta  1.1 VPATH  = $(SRCDIR)
  2           STATIC = 
  3           DBNAME = POSTGRESQL
  4           
  5 arta  1.7 # USED BY NEITHER linux_x86_64 nor linux_ia32
  6 arta  1.1 PGIPATH	= /usr/include/pgsql	
  7           
  8 arta  1.7 
  9 arta  1.1 COMPILER = icc
 10           
 11           # Check for debug vs. release build - release is default.
 12           #   To do a debug build, either set the environment variable JSOC_DEBUG to 1, OR
 13           #   modify the following line so that DEBUG = 1.  The environment variable takes precedence.
 14           DEBUG = 0
 15           
 16           ifdef JSOC_DEBUG
 17           ifeq ($(JSOC_DEBUG), 1)
 18           DEBUG = 1
 19           else
 20           DEBUG = 0
 21           endif
 22           endif
 23           
 24           # No warnings are displayed, by default, for a release build.
 25           WARN = 0
 26           
 27           # Builder can request warnings via environment variable (setenv JSOC_WARN 1).  The
 28           #   environment variable takes precedence.
 29           ifdef JSOC_WARN
 30 arta  1.1 ifeq ($(JSOC_WARN), 1)
 31           WARN = 1
 32           else
 33           WARN = 0
 34           endif
 35           endif
 36           
 37           # Warnings are always displayed for a debug build.
 38           ifeq ($(DEBUG), 1)
 39           WARN = 1
 40           endif
 41           
 42           _JSOCROOT_ = ..
 43           
 44           F77 = ifort
 45           # if fortran compiler
 46           D_GCC_FORT = 
 47           ifeq ($(F77), ifort)
 48             D_GCC_FORT = -DINTEL_FORTRAN
 49           endif
 50           
 51 arta  1.1 ifeq ($(JSOC_MACHINE), linux_x86_64)
 52             F77 = ifort -mcmodel=medium
 53           endif
 54           
 55           # Path to 3rd-party library headers
 56           FMATHLIBSH = -I$(_JSOCROOT_)/lib_third_party/include
 57 arta  1.6 CFITSIOH = -I$(_JSOCROOT_)/lib_third_party/include
 58 arta  1.1 
 59           ifeq ($(COMPILER), icc)
 60             ifeq ($(JSOC_MACHINE), linux_x86_64)
 61 arta  1.5 #    FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-x86_64/ -lfftw3f -lcfitsio
 62 arta  1.1     # Path to 64-bit 3rd-party libraries
 63 arta  1.5     FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/
 64 arta  1.6     CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/
 65 arta  1.1 
 66               # All 3rd-party math libraries - local rules can define a subset
 67               FMATHLIBS = $(FMATHLIBSL) -lfftw3f -lcfitsio
 68             else
 69 arta  1.5 #    FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-ia32/ -lfftw3f -lcfitsio
 70 arta  1.1     # Path to 32-bit 3rd-party libraries
 71 arta  1.5     FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/
 72 arta  1.6     CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/
 73 arta  1.1 
 74               # All 3rd-party math libraries - local rules can define a subset
 75               FMATHLIBS = $(FMATHLIBSL) -lfftw3f -lcfitsio
 76             endif
 77           endif
 78           
 79           ### Build flags for all targets
 80           #
 81           LL_ALL		= $(SYSLIBS)
 82           
 83           GCC_LF_ALL	= $(STATIC) -g 
 84           ICC_LF_ALL	= $(STATIC) -xW
 85           
 86           GCC_CF_GCCCOMP  = -DGCCCOMP $(D_GCC_FORT)
 87           ICC_CF_ICCCOMP  = -DICCCOMP $(D_GCC_FORT)
 88           
 89           
 90           # Disable several warnings/remarks when compiling with icc - icc's Wall is a bit picky, it 
 91           # complains about extern declarations in .c files.
 92           #   1418 (remark) - external function definition with no prior declaration
 93           #   1419 (warning) - external declaration in primary source file
 94 arta  1.1 #   310 (remark) - old style function declaration (pre-ANSI)
 95           #   981 (remark) - operands are evaluted in unspecified order
 96           
 97           ifeq ($(WARN), 1)
 98           # Show warnings (always true for a debug build).
 99           ICC_WARN = -Winline -Wall -wd1418 -wd1419 -wd310 -wd279 -wd981 -Wno-comment
100           GCC_WARN = -Winline -Wall -Wno-comment
101           F77_WARN =
102           else
103           # Don't show warnings.
104           ICC_WARN = -w0 -vec-report0 -Wno-comment
105           GCC_WARN = -Wno-comment
106           F77_WARN = -vec-report0
107           endif
108           
109 arta  1.7 # can't figure out how to get stupid make to do if/else if/else
110 arta  1.1 ifeq ($(DEBUG), 0)
111           
112 arta  1.7   ICC_CF_ALL	= -I$(SRCDIR)/base/include -std=c99 -xW $(ICC_WARN) $(ICC_CF_ICCCOMP)
113           
114 arta  1.1   ifeq ($(JSOC_MACHINE), linux_x86_64)
115 arta  1.3     GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=opteron $(GCC_WARN) $(GCC_CF_GCCCOMP)
116 arta  1.7   endif
117           
118             ifeq ($(JSOC_MACHINE), linux_ia64)
119               GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=itanium2 $(GCC_WARN) $(GCC_CF_GCCCOMP)
120               ICC_CF_ALL	= -I$(SRCDIR)/base/include -std=c99 $(ICC_WARN) $(ICC_CF_ICCCOMP)
121             endif
122           
123             ifeq ($(JSOC_MACHINE), linux_ia32)
124 arta  1.3     GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=i686 $(GCC_WARN) $(GCC_CF_GCCCOMP)
125 arta  1.1   endif	
126           
127           else
128           
129 arta  1.3   GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -g $(GCC_WARN) $(GCC_CF_GCCCOMP)
130             ICC_CF_ALL	= -I$(SRCDIR)/base/include -std=c99 -g $(ICC_WARN) $(ICC_CF_ICCCOMP)
131 arta  1.1 
132           endif
133           
134           # Fortran global LINK flags
135           F_LF_ALL	= -nofor_main -no-ipo
136           
137           # Fortran global COMPILE flags
138           ifeq ($(DEBUG), 0)
139           FF_ALL		= -xW -ftrapuv $(F77_WARN)
140           else
141           FF_ALL		= -ftrapuv $(F77_WARN)
142           endif
143           
144           ### Build tools
145           # 
146           # The C compiler named here must output full (header) dependencies in $(@).d.
147           # It may be necessary to create a script similar to ccd-gcc for your compiler.
148           # 
149           GCC_CMPLR	= $(SRCDIR)/build/ccd-gcc
150           ICC_CMPLR	= $(SRCDIR)/build/ccd-icc
151           ARCHIVE		= ar crus $@ $^
152 arta  1.1 
153           ECPG		= ecpg -o $@ -c $<
154           
155           GCC_COMP	= $(GCC_CMPLR) $(GCC_CF_ALL) $(CF_TGT) -o $@ -c $<
156           ICC_COMP	= $(ICC_CMPLR) $(ICC_CF_ALL) $(CF_TGT) -o $@ -c $<
157           
158           GCC_LINK	= $(GCC_CMPLR) $(GCC_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
159           ICC_LINK	= $(ICC_CMPLR) $(ICC_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
160           
161           GCC_COMPLINK	= $(GCC_CMPLR) $(GCC_CF_ALL) $(CF_TGT) $(GCC_LF_ALL) $(LF_TGT) -o $@ $< $(LL_TGT) $(LL_ALL)
162           ICC_COMPLINK	= $(ICC_CMPLR) $(GCC_CF_ALL) $(CF_TGT) $(ICC_LF_ALL) $(LF_TGT) -o $@ $< $(LL_TGT) $(LL_ALL)
163           
164           ifneq ($(COMPILER), icc)
165             COMP 		= $(GCC_COMP)
166             LINK		= $(GCC_LINK)
167             COMPLINK	= $(GCC_COMPLINK)
168           else
169             COMP 		= $(ICC_COMP)
170             LINK		= $(ICC_LINK)
171             COMPLINK	= $(ICC_COMPLINK)
172           endif
173 arta  1.1 
174           FCOMP		= $(F77) $(FF_ALL) $(FF_TGT) -o $@ -c $<
175           FLINK		= $(F77) $(F_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
176           
177           SLBIN           = ln -sf ../../_$(JSOC_MACHINE)/$@ ../bin/$(JSOC_MACHINE)/
178           SLLIB		= ln -sf ../../_$(JSOC_MACHINE)/$@ ../lib/$(JSOC_MACHINE)/
179           
180 arta  1.6 ALL_LIBS_FPIC = $(LIBDRMSCLIENT_FPIC) $(LIBDBCLIENT_FPIC) $(LIBCMDPARAMS_FPIC) $(LIBTHREADUTIL_FPIC) $(LIBRICECOMP_FPIC) $(LIBDSTRUCT_FPIC) $(LIBMISC_FPIC) $(LIBTIMEIO_FPIC) $(LIBFITSRW_FPIC)
181 arta  1.1 
182           ### Standard parts
183           #
184           include	$(SRCDIR)/Rules.mk
185           
186           # Libraries from src/util linked with all programs.
187 karen 1.4 SYSLIBS = -lz -ldl -lpthread -lm
188 arta  1.6 SRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMS) $(LIBMISC) $(LIBDSTRUCT) $(LIBTIMEIO) $(LIBFITSRW)
189           FSRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMSF) $(LIBMISC) $(LIBDSTRUCT) $(LIBTIMEIO) $(LIBFITSRW)
190 arta  1.1 
191           ########## Libraries to link for server executables,    ##############
192           ########## standalone executables and pipeline modules. ##############
193           
194           # SERVERLIBS: Libraries linked with "server" programs that 
195           # need direct access to the DRMS databases.
196           SERVERLIBS = $(LIBDRMS) $(LIBDB) $(LIBSUMSAPI) $(SRCLIBS)
197           
198           # EXELIBS: Libraries linked with standalone executables.
199           EXELIBS = $(LIBDRMSCLIENT) $(LIBDBCLIENT) $(SRCLIBS)
200           
201           # MODLIBS: Libraries linked with DRMS modules.
202           MODLIBS = $(LIBJSOC_MAIN) $(SERVERLIBS)
203           
204           # MODLIBS_SOCK: Libraries linked with DRMS modules with socket connection to a drms_server
205           MODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK) $(LIBDRMSCLIENT) $(LIBDBCLIENT) $(SRCLIBS)
206           
207           # FMODLIBS: Libraries linked with DRMS Fortran modules
208           FMODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK_F) $(LIBINTHANDLESF) $(LIBDRMSCLIENT) $(LIBDBCLIENT) $(FSRCLIBS)
209           
210           MATHLIBS =  $(LIBLSQR) $(LIBBLAS) $(LIBLAPACK)
211 arta  1.1 
212           # Make rules that apply to all projects outside of the base DRMS/SUMS system
213 arta  1.3 -include $(SRCDIR)/proj/make_basic.mk
214 arta  1.1 
215           # Make rules that apply to all projects, inside and outside of the base DRMS/SUMS system
216           $(CEXE):	%:	%.o $(EXELIBS)
217           		$(LINK)
218           		$(SLBIN)
219           
220           $(FEXE):	%:	%.o $(MATHLIBS)
221           		$(FLINK)
222           		$(SLBIN)
223           
224           $(SERVEREXE):   LL_TGT := $(LL_TGT) -lpq
225           $(SERVEREXE):	%:	%.o $(SERVERLIBS)
226           			$(LINK)
227           			$(SLBIN)
228           
229           $(MODEXE):      LL_TGT := $(LL_TGT) -lpq
230           $(MODEXE):	%:	%.o $(MODLIBS)
231           			$(LINK)
232           			$(SLBIN)
233           
234           $(MODEXE_SOCK): %_sock: %.o $(MODLIBS_SOCK)
235 arta  1.1 			$(LINK)
236           			$(SLBIN)
237           
238           $(FMODEXE):     %_sock:	%.o $(FMODLIBS_SOCK)
239           			$(FLINK)
240           			$(SLBIN)

Karen Tian
Powered by
ViewCVS 0.9.4