(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 karen 1.18 COMPILER = icc
 10 arta  1.1  
 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 karen 1.18 DEBUG = 0
 15 arta  1.1  
 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            ifeq ($(JSOC_WARN), 1)
 31            WARN = 1
 32            else
 33            WARN = 0
 34            endif
 35            endif
 36 arta  1.1  
 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            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.16 GSLH = -I$(_JSOCROOT_)/lib_third_party/include 
 59 arta  1.1  
 60 arta  1.14 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.13   # Path to 64-bit 3rd-party libraries
 63              FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/
 64              CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/
 65 arta  1.16   GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/
 66 arta  1.15   ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/
 67 arta  1.14 endif
 68            ifeq ($(JSOC_MACHINE), linux_ia32) 
 69 arta  1.5  #    FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-ia32/ -lfftw3f -lcfitsio
 70 arta  1.13   # Path to 32-bit 3rd-party libraries
 71              FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/
 72              CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/
 73 arta  1.16   GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/
 74 arta  1.15   ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/
 75 arta  1.1  endif
 76 arta  1.14 ifeq ($(JSOC_MACHINE), mac_osx) 
 77            #    FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-ia32/ -lfftw3f -lcfitsio
 78              # Path to 32-bit 3rd-party libraries
 79              FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx/
 80              CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx/
 81 arta  1.16   GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx/
 82 arta  1.15   ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx/
 83            endif
 84 arta  1.14 
 85 arta  1.15 # All 3rd-party math libraries - local rules can define a subset
 86            FMATHLIBS = $(FMATHLIBSL) -lfftw3f -lcfitsio
 87            CFITSIOLIBS = $(CFITSIOL) -lcfitsio
 88 arta  1.16 GSLLIBS = $(GSLL) -lgsl -lgslcblas 
 89 arta  1.1  
 90            ### Build flags for all targets
 91            #
 92            LL_ALL		= $(SYSLIBS)
 93            
 94            GCC_LF_ALL	= $(STATIC) -g 
 95 arta  1.10 ifeq ($(JSOC_MACHINE), linux_ia64)
 96              ICC_LF_ALL	= $(STATIC)
 97            else
 98              ICC_LF_ALL	= $(STATIC) -xW
 99            endif
100 arta  1.1  
101            GCC_CF_GCCCOMP  = -DGCCCOMP $(D_GCC_FORT)
102            ICC_CF_ICCCOMP  = -DICCCOMP $(D_GCC_FORT)
103            
104            
105            # Disable several warnings/remarks when compiling with icc - icc's Wall is a bit picky, it 
106            # complains about extern declarations in .c files.
107            #   1418 (remark) - external function definition with no prior declaration
108            #   1419 (warning) - external declaration in primary source file
109            #   310 (remark) - old style function declaration (pre-ANSI)
110            #   981 (remark) - operands are evaluted in unspecified order
111            
112            ifeq ($(WARN), 1)
113            # Show warnings (always true for a debug build).
114            ICC_WARN = -Winline -Wall -wd1418 -wd1419 -wd310 -wd279 -wd981 -Wno-comment
115            GCC_WARN = -Winline -Wall -Wno-comment
116            F77_WARN =
117            else
118            # Don't show warnings.
119            ICC_WARN = -w0 -vec-report0 -Wno-comment
120            GCC_WARN = -Wno-comment
121 arta  1.1  F77_WARN = -vec-report0
122            endif
123            
124 arta  1.7  # can't figure out how to get stupid make to do if/else if/else
125 arta  1.1  ifeq ($(DEBUG), 0)
126 arta  1.10   GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 $(GCC_WARN) $(GCC_CF_GCCCOMP)
127 rick  1.9    ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -xW $(ICC_WARN) $(ICC_CF_ICCCOMP)
128 arta  1.7  
129 arta  1.1    ifeq ($(JSOC_MACHINE), linux_x86_64)
130 arta  1.3      GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=opteron $(GCC_WARN) $(GCC_CF_GCCCOMP)
131 arta  1.7    endif
132            
133              ifeq ($(JSOC_MACHINE), linux_ia64)
134 arta  1.8      GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 $(GCC_WARN) $(GCC_CF_GCCCOMP)
135 arta  1.7      ICC_CF_ALL	= -I$(SRCDIR)/base/include -std=c99 $(ICC_WARN) $(ICC_CF_ICCCOMP)
136              endif
137            
138              ifeq ($(JSOC_MACHINE), linux_ia32)
139 arta  1.3      GCC_CF_ALL	= -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=i686 $(GCC_WARN) $(GCC_CF_GCCCOMP)
140 arta  1.1    endif	
141            
142            else
143            
144 rick  1.9    GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -g $(GCC_WARN) $(GCC_CF_GCCCOMP)
145              ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -g $(ICC_WARN) $(ICC_CF_ICCCOMP)
146 arta  1.1  
147            endif
148            
149            # Fortran global LINK flags
150            F_LF_ALL	= -nofor_main -no-ipo
151            
152            # Fortran global COMPILE flags
153            ifeq ($(DEBUG), 0)
154            FF_ALL		= -xW -ftrapuv $(F77_WARN)
155            else
156            FF_ALL		= -ftrapuv $(F77_WARN)
157            endif
158            
159            ### Build tools
160            # 
161            # The C compiler named here must output full (header) dependencies in $(@).d.
162            # It may be necessary to create a script similar to ccd-gcc for your compiler.
163            # 
164            GCC_CMPLR	= $(SRCDIR)/build/ccd-gcc
165            ICC_CMPLR	= $(SRCDIR)/build/ccd-icc
166            ARCHIVE		= ar crus $@ $^
167 arta  1.1  
168            ECPG		= ecpg -o $@ -c $<
169 karen 1.17 SWIG		= swig -perl5 -o $@ $<
170 arta  1.1  
171            GCC_COMP	= $(GCC_CMPLR) $(GCC_CF_ALL) $(CF_TGT) -o $@ -c $<
172            ICC_COMP	= $(ICC_CMPLR) $(ICC_CF_ALL) $(CF_TGT) -o $@ -c $<
173            
174            GCC_LINK	= $(GCC_CMPLR) $(GCC_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
175            ICC_LINK	= $(ICC_CMPLR) $(ICC_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
176            
177            GCC_COMPLINK	= $(GCC_CMPLR) $(GCC_CF_ALL) $(CF_TGT) $(GCC_LF_ALL) $(LF_TGT) -o $@ $< $(LL_TGT) $(LL_ALL)
178            ICC_COMPLINK	= $(ICC_CMPLR) $(GCC_CF_ALL) $(CF_TGT) $(ICC_LF_ALL) $(LF_TGT) -o $@ $< $(LL_TGT) $(LL_ALL)
179            
180            ifneq ($(COMPILER), icc)
181              COMP 		= $(GCC_COMP)
182              LINK		= $(GCC_LINK)
183              COMPLINK	= $(GCC_COMPLINK)
184            else
185              COMP 		= $(ICC_COMP)
186              LINK		= $(ICC_LINK)
187              COMPLINK	= $(ICC_COMPLINK)
188            endif
189            
190            FCOMP		= $(F77) $(FF_ALL) $(FF_TGT) -o $@ -c $<
191 arta  1.1  FLINK		= $(F77) $(F_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
192            
193            SLBIN           = ln -sf ../../_$(JSOC_MACHINE)/$@ ../bin/$(JSOC_MACHINE)/
194            SLLIB		= ln -sf ../../_$(JSOC_MACHINE)/$@ ../lib/$(JSOC_MACHINE)/
195            
196 arta  1.11 ALL_LIBS_FPIC = $(LIBDRMSCLIENT_FPIC) $(LIBDBCLIENT_FPIC) $(LIBCMDPARAMS_FPIC) $(LIBTHREADUTIL_FPIC) $(LIBRICECOMP_FPIC) $(LIBDSTRUCT_FPIC) $(LIBMISC_FPIC) $(LIBTIMEIO_FPIC) $(LIBFITSRW_FPIC) 
197 arta  1.1  
198            ### Standard parts
199            #
200            include	$(SRCDIR)/Rules.mk
201            
202            # Libraries from src/util linked with all programs.
203 arta  1.12 ifneq ($(COMPILER), icc)
204              SYSLIBS = -lz -ldl -lpthread -lm
205            else
206              SYSLIBS = -lz -ldl -lpthread
207            endif
208 arta  1.19 SRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMS) $(LIBMISC) $(LIBDSTRUCT) $(LIBTIMEIO) $(LIBFITSRW) $(LIBERRLOG)
209            FSRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMSF) $(LIBMISC) $(LIBDSTRUCT) $(LIBTIMEIO) $(LIBFITSRW) $(LIBERRLOG)
210 arta  1.1  
211            ########## Libraries to link for server executables,    ##############
212            ########## standalone executables and pipeline modules. ##############
213            
214            # SERVERLIBS: Libraries linked with "server" programs that 
215            # need direct access to the DRMS databases.
216            SERVERLIBS = $(LIBDRMS) $(LIBDB) $(LIBSUMSAPI) $(SRCLIBS)
217            
218            # EXELIBS: Libraries linked with standalone executables.
219            EXELIBS = $(LIBDRMSCLIENT) $(LIBDBCLIENT) $(SRCLIBS)
220            
221            # MODLIBS: Libraries linked with DRMS modules.
222            MODLIBS = $(LIBJSOC_MAIN) $(SERVERLIBS)
223            
224            # MODLIBS_SOCK: Libraries linked with DRMS modules with socket connection to a drms_server
225            MODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK) $(LIBDRMSCLIENT) $(LIBDBCLIENT) $(SRCLIBS)
226            
227            # FMODLIBS: Libraries linked with DRMS Fortran modules
228            FMODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK_F) $(LIBINTHANDLESF) $(LIBDRMSCLIENT) $(LIBDBCLIENT) $(FSRCLIBS)
229            
230            MATHLIBS =  $(LIBLSQR) $(LIBBLAS) $(LIBLAPACK)
231 arta  1.1  
232            # Make rules that apply to all projects outside of the base DRMS/SUMS system
233 arta  1.3  -include $(SRCDIR)/proj/make_basic.mk
234 arta  1.1  
235            # Make rules that apply to all projects, inside and outside of the base DRMS/SUMS system
236            $(CEXE):	%:	%.o $(EXELIBS)
237            		$(LINK)
238            		$(SLBIN)
239            
240            $(FEXE):	%:	%.o $(MATHLIBS)
241            		$(FLINK)
242            		$(SLBIN)
243            
244 arta  1.11 $(SERVEREXE):   LL_TGT := $(LL_TGT) -lpq $(CFITSIOLIBS)
245 arta  1.1  $(SERVEREXE):	%:	%.o $(SERVERLIBS)
246            			$(LINK)
247            			$(SLBIN)
248            
249 arta  1.11 $(MODEXE):      LL_TGT := $(LL_TGT) -lpq $(CFITSIOLIBS)
250 arta  1.1  $(MODEXE):	%:	%.o $(MODLIBS)
251            			$(LINK)
252            			$(SLBIN)
253            
254 arta  1.11 $(MODEXE_SOCK):	LL_TGT := $(LL_TGT) $(CFITSIOLIBS)
255 arta  1.1  $(MODEXE_SOCK): %_sock: %.o $(MODLIBS_SOCK)
256            			$(LINK)
257            			$(SLBIN)
258            
259 arta  1.11 $(FMODEXE):	LL_TGT := $(LL_TGT) $(CFITSIOLIBS)
260 arta  1.1  $(FMODEXE):     %_sock:	%.o $(FMODLIBS_SOCK)
261            			$(FLINK)
262            			$(SLBIN)

Karen Tian
Powered by
ViewCVS 0.9.4