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

Karen Tian
Powered by
ViewCVS 0.9.4