version 1.55, 2009/09/04 18:51:15
|
version 1.65, 2010/08/29 04:43:24
|
|
|
STATIC = | STATIC = |
DBNAME = POSTGRESQL | DBNAME = POSTGRESQL |
| |
_JSOCROOT_ = .. |
# Run a script to determine the machine on which make is being run. This |
|
# MAY return a machine type, if the host found falls into one of several |
# XXX This PGIPATH var isn't correct - we don't put libpq inside the lib_third_party directory |
# categories (like dbserver). |
# at Stanford. |
MACHTYPE = $(shell $(SRCDIR)/getmachtype.pl) |
PGIPATH = /usr/include/pgsql |
|
ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/$(JSOC_MACHINE)/ |
# If MACH was set when the make command was issued (eg., make MACH='N02'), then |
|
# use its value for the output/obj directory and use the custom.mk variables |
# This optional file has custom definitions created by the configure script |
# relevant to its value. Otherwise, use $(JSOC_MACHINE). |
-include $(SRCDIR)/custom.mk |
ifeq ($(MACH),) |
|
MACH = $(JSOC_MACHINE) |
|
endif |
| |
#***********************************************************************************************# | #***********************************************************************************************# |
# | # |
Line 19 ECPGL = -L$(_JSOCROOT_)/lib_third_party/ |
|
Line 21 ECPGL = -L$(_JSOCROOT_)/lib_third_party/ |
|
COMPILER = icc | COMPILER = icc |
FCOMPILER = ifort | FCOMPILER = ifort |
| |
ifneq ($(JSOC_AUTOCOMPILER),) |
|
COMPILER = $(JSOC_AUTOCOMPILER) |
|
endif |
|
|
|
ifneq ($(JSOC_AUTOFCOMPILER),) |
|
FCOMPILER = $(JSOC_AUTOFCOMPILER) |
|
endif |
|
|
|
# can set through custom.mk or through environment | # can set through custom.mk or through environment |
ifneq ($(JSOC_COMPILER),) | ifneq ($(JSOC_COMPILER),) |
COMPILER = $(JSOC_COMPILER) | COMPILER = $(JSOC_COMPILER) |
Line 37 FCOMPILER = $(JSOC_FCOMPILER) |
|
Line 31 FCOMPILER = $(JSOC_FCOMPILER) |
|
endif | endif |
#***********************************************************************************************# | #***********************************************************************************************# |
| |
|
#***********************************************************************************************# |
|
# This optional file has custom definitions created by the configure script. |
|
# Do this after compiler selection since custom.mk might use $COMPILER or $FCOMPILER. |
|
# custom.mk might also set compiler (through moreconfigure.pl) |
|
-include $(LOCALIZATIONDIR)/custom.mk |
|
#***********************************************************************************************# |
| |
#***********************************************************************************************# | #***********************************************************************************************# |
# | # |
|
|
# contain the paths to the library binaries, and variables | # contain the paths to the library binaries, and variables |
# that end in "LIBS" contain the full link cmd (the -L flag plus the -l flag) | # that end in "LIBS" contain the full link cmd (the -L flag plus the -l flag) |
# | # |
# Path to 3rd-party library headers |
|
FMATHLIBSH = -I$(_JSOCROOT_)/lib_third_party/include |
|
CFITSIOH = -I$(_JSOCROOT_)/lib_third_party/include |
|
GSLH = -I$(_JSOCROOT_)/lib_third_party/include |
|
| |
ifeq ($(JSOC_MACHINE), linux_x86_64) |
# PostgreSQL |
# FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-x86_64/ -lfftw3f -lcfitsio |
PGH = -I$(POSTGRES_INCS) |
# Path to 64-bit 3rd-party libraries |
PGL = -L$(POSTGRES_LIBS) |
FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/ |
PGLIBNAME = $(POSTGRES_LIB) |
CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/ |
PGLIBS = $(PGL) -l$(PGLIBNAME) |
GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/ |
|
# ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_x86_64/ |
# CFITSIO |
endif |
CFITSIOH = -I$(CFITSIO_INCS) |
ifeq ($(JSOC_MACHINE), linux_ia32) |
CFITSIOL = -L$(CFITSIO_LIBS) |
# FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-ia32/ -lfftw3f -lcfitsio |
CFITSIOLIBNAME = $(CFITSIO_LIB) |
# Path to 32-bit 3rd-party libraries |
CFITSIOLIBS = $(CFITSIOL) -l$(CFITSIOLIBNAME) |
FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/ |
|
CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/ |
|
GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/ |
|
# ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/linux_ia32/ |
|
endif |
|
ifeq ($(JSOC_MACHINE), mac_osx_ppc) |
|
# FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-ia32/ -lfftw3f -lcfitsio |
|
# Path to appropriate 3rd-party libraries |
|
FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ppc/ |
|
CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ppc/ |
|
GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ppc/ |
|
# ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ppc/ |
|
endif |
|
ifeq ($(JSOC_MACHINE), mac_osx_ia32) |
|
# FMATHLIBS = -lmkl_lapack -lmkl -L$(_JSOCROOT_)/lib_third_party/lib/linux-ia32/ -lfftw3f -lcfitsio |
|
# Path to appropriate 3rd-party libraries |
|
FMATHLIBSL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ia32/ |
|
CFITSIOL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ia32/ |
|
GSLL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ia32/ |
|
# ECPGL = -L$(_JSOCROOT_)/lib_third_party/lib/mac_osx_ia32/ |
|
endif |
|
|
|
# All 3rd-party libraries - local rules can define a subset |
|
FMATHLIBS = $(FMATHLIBSL) -lfftw3f |
|
CFITSIOLIBS = $(CFITSIOL) -lcfitsio |
|
ECPGLIBS = $(ECPGL) -lpq |
|
| |
ifeq ($(COMPILER), gcc) |
|
ifeq ($(JSOC_MACHINE), linux_x86_64) |
|
ifneq ($(CFITSIOFNAME_GCC_X86_64),) |
|
FMATHLIBS = $(FMATHLIBSL) -lfftw3f -l$(CFITSIOFNAME_GCC_X86_64) |
|
CFITSIOLIBS = $(CFITSIOL) -l$(CFITSIOFNAME_GCC_X86_64) |
|
endif |
|
endif |
|
endif |
|
|
|
GSLLIBS = $(GSLL) -lgsl -lgslcblas |
|
#***********************************************************************************************# | #***********************************************************************************************# |
| |
| |
|
|
# | # |
#***********************************************************************************************# | #***********************************************************************************************# |
| |
|
#***********************************************************************************************# |
|
# |
|
# Global flags |
|
# |
|
# All modules must be able to find libdsds.so. The define DRMS_LIBDIR specifies the path to |
|
# all libraries. |
|
|
|
GLOBALSW = -DDRMS_LIBDIR="\"$(WORKINGDIR)/lib/$(MACH)\"" |
|
# |
|
#***********************************************************************************************# |
| |
#***********************************************************************************************# | #***********************************************************************************************# |
# | # |
|
|
# | # |
LL_ALL = $(SYSLIBS) | LL_ALL = $(SYSLIBS) |
GCC_LF_ALL = $(STATIC) | GCC_LF_ALL = $(STATIC) |
ICC_LF_ALL = $(STATIC) |
ICC_LF_ALL = $(STATIC) -openmp -static-intel |
| |
# Fortran global LINK flags | # Fortran global LINK flags |
F_LF_ALL = -nofor_main -no-ipo |
F_LF_ALL = -nofor_main -openmp -static-intel |
#***********************************************************************************************# | #***********************************************************************************************# |
| |
#***********************************************************************************************# | #***********************************************************************************************# |
Line 224 F_LF_ALL = -nofor_main -no-ipo |
|
Line 194 F_LF_ALL = -nofor_main -no-ipo |
|
# GLOBAL COMPILE FLAGS | # GLOBAL COMPILE FLAGS |
# | # |
GCC_CF_GCCCOMP = -DGCCCOMP | GCC_CF_GCCCOMP = -DGCCCOMP |
ICC_CF_ICCCOMP = -DICCCOMP |
ICC_CF_ICCCOMP = -DICCCOMP -openmp |
|
|
CCFLAGS_OPT := |
|
|
|
ifeq ($(COMPILER), icc) |
|
ifeq ($(JSOC_MACHINE), linux_x86_64) |
|
CCFLAGS_OPT := -xW |
|
endif |
|
endif |
|
| |
# can't figure out how to get stupid make to do if/else if/else | # can't figure out how to get stupid make to do if/else if/else |
ifeq ($(DEBUG), 0) | ifeq ($(DEBUG), 0) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) $(GLOBALSW) |
# -xW tells the icc compiler to optimize for Pentium 4 | # -xW tells the icc compiler to optimize for Pentium 4 |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE $(CCFLAGS_OPT) $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) $(GLOBALSW) |
| |
ifeq ($(JSOC_MACHINE), linux_x86_64) | ifeq ($(JSOC_MACHINE), linux_x86_64) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=opteron $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=opteron $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) $(GLOBALSW) |
endif | endif |
| |
ifeq ($(JSOC_MACHINE), linux_ia64) | ifeq ($(JSOC_MACHINE), linux_ia64) |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) $(GLOBALSW) |
endif | endif |
| |
ifeq ($(JSOC_MACHINE), linux_ia32) | ifeq ($(JSOC_MACHINE), linux_ia32) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=i686 $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=i686 $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) $(GLOBALSW) |
endif | endif |
| |
else | else |
# -g tells the icc and gcc compilers to generate full debugging information | # -g tells the icc and gcc compilers to generate full debugging information |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -g $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -g $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) $(GLOBALSW) |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE -g $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE -g $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) $(GLOBALSW) |
endif | endif |
| |
# Fortran global COMPILE flags | # Fortran global COMPILE flags |
ifeq ($(JSOC_MACHINE), linux_x86_64) | ifeq ($(JSOC_MACHINE), linux_x86_64) |
ifeq ($(FCOMPILER), ifort) | ifeq ($(FCOMPILER), ifort) |
F_CF_ALL := -mcmodel=medium |
F_CF_ALL := -openmp |
endif | endif |
endif | endif |
| |
# Other compiler-specific Fortran COMPILE flags | # Other compiler-specific Fortran COMPILE flags |
ifeq ($(FCOMPILER), ifort) | ifeq ($(FCOMPILER), ifort) |
ifeq ($(JSOC_MACHINE), linux_x86_64) |
|
FCFLAGS_OPT := -xW |
|
endif |
|
FCFLAGS_INIT := -ftrapuv | FCFLAGS_INIT := -ftrapuv |
else | else |
# must be gfortran | # must be gfortran |
FCFLAGS_OPT := |
|
FCFLAGS_INIT := | FCFLAGS_INIT := |
endif | endif |
| |
ifeq ($(DEBUG), 0) | ifeq ($(DEBUG), 0) |
# -xW optimizes ifort compilation for Pentium 4 | # -xW optimizes ifort compilation for Pentium 4 |
# -ftrapuv initializes stack local variables to an unusual value to aid error detection. | # -ftrapuv initializes stack local variables to an unusual value to aid error detection. |
F_CF_ALL := $(F_CF_ALL) $(FCFLAGS_OPT) $(FCOMPILER_WARN) |
F_CF_ALL := $(F_CF_ALL) $(FCOMPILER_WARN) |
else | else |
F_CF_ALL := $(F_CF_ALL) -g $(FCFLAGS_INIT) $(FCOMPILER_WARN) | F_CF_ALL := $(F_CF_ALL) -g $(FCFLAGS_INIT) $(FCOMPILER_WARN) |
endif | endif |
|
|
FCOMP = $(FCOMPILER) $(F_CF_ALL) $(FF_TGT) -o $@ -c $< | FCOMP = $(FCOMPILER) $(F_CF_ALL) $(FF_TGT) -o $@ -c $< |
FLINK = $(FCOMPILER) $(F_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL) | FLINK = $(FCOMPILER) $(F_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL) |
| |
SLBIN = ln -sf ../../_$(JSOC_MACHINE)/$@ ../bin/$(JSOC_MACHINE)/ |
SLBIN = ln -sf ../../_$(MACH)/$@ ../bin/$(MACH)/ |
SLLIB = ln -sf ../../_$(JSOC_MACHINE)/$@ ../lib/$(JSOC_MACHINE)/ |
SLLIB = ln -sf ../../_$(MACH)/$@ ../lib/$(MACH)/ |
#***********************************************************************************************# | #***********************************************************************************************# |
| |
| |
Line 386 $(CEXE): %: %.o $(EXELIBS) |
|
Line 344 $(CEXE): %: %.o $(EXELIBS) |
|
$(LINK) | $(LINK) |
$(SLBIN) | $(SLBIN) |
| |
$(FEXE): %: %.o $(FMATHLIBS) |
$(FEXE): %: %.o |
$(FLINK) | $(FLINK) |
$(SLBIN) | $(SLBIN) |
| |
$(SERVEREXE): LL_TGT := $(LL_TGT) $(ECPGLIBS) $(CFITSIOLIBS) |
$(SERVEREXE): LL_TGT := $(LL_TGT) $(PGLIBS) $(CFITSIOLIBS) |
$(SERVEREXE): %: %.o $(SERVERLIBS) | $(SERVEREXE): %: %.o $(SERVERLIBS) |
$(LINK) | $(LINK) |
$(SLBIN) | $(SLBIN) |
| |
$(MODEXE): LL_TGT := $(LL_TGT) $(ECPGLIBS) $(CFITSIOLIBS) |
$(MODEXE): LL_TGT := $(LL_TGT) $(PGLIBS) $(CFITSIOLIBS) |
$(MODEXE): %: %.o $(MODLIBS) | $(MODEXE): %: %.o $(MODLIBS) |
$(LINK) | $(LINK) |
$(SLBIN) | $(SLBIN) |
Line 407 $(MODEXE_SOCK): %_sock: %.o $(MODLIBS_SO |
|
Line 365 $(MODEXE_SOCK): %_sock: %.o $(MODLIBS_SO |
|
# FMODEXE_SOCK contains all Fortran modules - the DoIt() function is defined inside a .f file. | # FMODEXE_SOCK contains all Fortran modules - the DoIt() function is defined inside a .f file. |
# These are socket-connect modules only. Assume they use third-party Fortran libraries | # These are socket-connect modules only. Assume they use third-party Fortran libraries |
# (although this may not be the case). | # (although this may not be the case). |
$(FMODEXE_SOCK): LL_TGT := $(LL_TGT) $(CFITSIOLIBS) $(FMATHLIBS) |
$(FMODEXE_SOCK): LL_TGT := $(LL_TGT) $(CFITSIOLIBS) |
$(FMODEXE_SOCK): %_sock: %.o $(FMODLIBS_SOCK) | $(FMODEXE_SOCK): %_sock: %.o $(FMODLIBS_SOCK) |
$(FLINK) | $(FLINK) |
$(SLBIN) | $(SLBIN) |
| |
# MODEXE_USEF contains all C direct-connect modules that use third-party Fortran libraries. | # MODEXE_USEF contains all C direct-connect modules that use third-party Fortran libraries. |
$(MODEXE_USEF): LL_TGT := $(LL_TGT) $(ECPGLIBS) $(CFITSIOLIBS) $(FMATHLIBS) |
$(MODEXE_USEF): LL_TGT := $(LL_TGT) $(PGLIBS) $(CFITSIOLIBS) |
$(MODEXE_USEF): %: %.o $(MODLIBS) | $(MODEXE_USEF): %: %.o $(MODLIBS) |
$(FLINK) | $(FLINK) |
$(SLBIN) | $(SLBIN) |
# MODEXE_USEF contains all C socket-connect modules that use third-party Fortran libraries. | # MODEXE_USEF contains all C socket-connect modules that use third-party Fortran libraries. |
$(MODEXE_USEF_SOCK): LL_TGT := $(LL_TGT) $(CFITSIOLIBS) $(FMATHLIBS) |
$(MODEXE_USEF_SOCK): LL_TGT := $(LL_TGT) $(CFITSIOLIBS) |
$(MODEXE_USEF_SOCK): %_sock: %.o $(MODLIBS_SOCK) | $(MODEXE_USEF_SOCK): %_sock: %.o $(MODLIBS_SOCK) |
$(FLINK) | $(FLINK) |
$(SLBIN) | $(SLBIN) |