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

Karen Tian
Powered by
ViewCVS 0.9.4