version 1.79, 2012/12/03 21:45:08
|
version 1.92, 2021/02/13 19:16:51
|
|
|
# Run a script to determine the machine on which make is being run. This | # 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 | # MAY return a machine type, if the host found falls into one of several |
# categories (like dbserver). | # categories (like dbserver). |
MACHTYPE = $(shell $(SRCDIR)/getmachtype.pl) |
MACHTYPE = $(shell hostname) |
| |
# If MACH was set when the make command was issued (eg., make MACH='N02'), then | # 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 |
# use its value for the output/obj directory and use the drmsparams.mk variables |
# relevant to its value. Otherwise, use $(JSOC_MACHINE). | # relevant to its value. Otherwise, use $(JSOC_MACHINE). |
ifeq ($(MACH),) | ifeq ($(MACH),) |
MACH = $(JSOC_MACHINE) | MACH = $(JSOC_MACHINE) |
Line 29 FCOMPILER = ifort |
|
Line 29 FCOMPILER = ifort |
|
MPICOMPILER = $(MPI_PATH)/mpicc | MPICOMPILER = $(MPI_PATH)/mpicc |
MPIFCOMPILER = $(MPI_PATH)/mpif90 | MPIFCOMPILER = $(MPI_PATH)/mpif90 |
| |
# can set through custom.mk or through environment |
# can set through drmsparams.mk or through environment |
ifneq ($(JSOC_COMPILER),) | ifneq ($(JSOC_COMPILER),) |
COMPILER = $(JSOC_COMPILER) | COMPILER = $(JSOC_COMPILER) |
endif | endif |
|
|
| |
#***********************************************************************************************# | #***********************************************************************************************# |
# This optional file has custom definitions created by the configure script. | # This optional file has custom definitions created by the configure script. |
# Do this after compiler selection since custom.mk might use $COMPILER or $FCOMPILER. |
# Do this after compiler selection since drmsparams.mk might use $COMPILER or $FCOMPILER. |
# custom.mk might also set compiler (through moreconfigure.pl) |
# drmsparams.mk might also set compiler (through moreconfigure.pl) |
-include $(SRCDIR)/$(LOCALIZATIONDIR)/custom.mk |
-include $(SRCDIR)/$(LOCALIZATIONDIR)/drmsparams.mk |
#***********************************************************************************************# | #***********************************************************************************************# |
| |
#***********************************************************************************************# | #***********************************************************************************************# |
|
|
| |
# PostgreSQL | # PostgreSQL |
PGH = -I$(POSTGRES_INCS) | PGH = -I$(POSTGRES_INCS) |
PGL = -L$(POSTGRES_LIBS) |
|
PGLIBNAME = $(POSTGRES_LIB) |
# For use of dynamic library |
PGLIBS = $(PGL) -l$(PGLIBNAME) |
PGLIBS = $(POSTGRES_LIBS)/lib$(POSTGRES_LIB).so |
| |
# CFITSIO | # CFITSIO |
CFITSIOH = -I$(CFITSIO_INCS) | CFITSIOH = -I$(CFITSIO_INCS) |
CFITSIOL = -L$(CFITSIO_LIBS) | CFITSIOL = -L$(CFITSIO_LIBS) |
CFITSIOLIBNAME = $(CFITSIO_LIB) | CFITSIOLIBNAME = $(CFITSIO_LIB) |
CFITSIOLIBS = $(CFITSIOL) -l$(CFITSIOLIBNAME) |
# make sure to use static library so we don't have to deal with locating the dynamic one at run time |
|
# set back to dynamic (the default) for the other libraries that could follow cfitsio |
|
CFITSIOLIBS = $(CFITSIOL) -Wl,-Bstatic -l$(CFITSIOLIBNAME) -Wl,-Bdynamic |
|
# end CFITSIO |
| |
# GSL | # GSL |
GSLH = -I$(GSL_INCS) | GSLH = -I$(GSL_INCS) |
Line 128 FFTWL = -L$(FFTW_LIBS) |
|
Line 131 FFTWL = -L$(FFTW_LIBS) |
|
FFTW3LIBS = $(FFTWL) -lfftw3 | FFTW3LIBS = $(FFTWL) -lfftw3 |
FFTW3FLIBS = $(FFTWL) -lfftw3f | FFTW3FLIBS = $(FFTWL) -lfftw3f |
| |
|
# TAR |
|
LIBTARH = -I$(TAR_INCS) |
|
LIBTARL = -L$(TAR_LIBS) -ltar |
|
|
|
# Python |
|
LIBPYH = -I$(PY_INCS) |
|
LIBPYL = -L$(PY_LIBS) -l$(PY_LIB) |
|
PYTHONHOME = "\"$(PY_HOME)\"" |
|
|
#***********************************************************************************************# | #***********************************************************************************************# |
| |
| |
Line 141 ifneq ($(DRMS_DEFAULT_RETENTION),) |
|
Line 153 ifneq ($(DRMS_DEFAULT_RETENTION),) |
|
CUSTOMSW := $(CUSTOMSW) -DDRMS_DEFAULT_RETENTION=$(DRMS_DEFAULT_RETENTION) | CUSTOMSW := $(CUSTOMSW) -DDRMS_DEFAULT_RETENTION=$(DRMS_DEFAULT_RETENTION) |
endif | endif |
| |
ifneq ($(CUSTOM_DEFINES),) |
# Due to legacy code, the name __LOCALIZED_DEFS__ must be used for NetDRMS builds. |
CUSTOMSW := $(CUSTOMSW) -D$(CUSTOM_DEFINES) |
# Despite the name, this macro has nothing to do with localized definitions. It means |
|
# "not Stanford JSOC-SDP" (it essentially means NetDRMS). So, if __LOCALIZED_DEFS__ is set, then |
|
# the binaries were built for use outside of Stanford. |
|
# For future use, we also define the NETDRMS_BUILD as a synonym, but with a more appropriate name. |
|
# __LOCALIZED_DEFS__ is deprecated and should not be used in new code. |
|
ifeq ($(BUILD_TYPE),NETDRMS) |
|
CUSTOMSW := $(CUSTOMSW) -DNETDRMS_BUILD -D__LOCALIZED_DEFS__ |
|
endif |
|
|
|
# Stanford builds are marked by the JSOC_SDP_BUILD macro. |
|
ifeq ($(BUILD_TYPE),JSOC_SDP) |
|
CUSTOMSW := $(CUSTOMSW) -DJSOC_SDP_BUILD |
endif | endif |
| |
# | # |
|
|
# All modules must be able to find libdsds.so. The define DRMS_LIBDIR specifies the path to | # All modules must be able to find libdsds.so. The define DRMS_LIBDIR specifies the path to |
# all libraries. | # all libraries. |
| |
GLOBALSW = -DDRMS_ARCH="\"$(MACH)\"" |
GLOBALSW = -DDRMS_ARCH="\"$(MACH)\"" -DDRMS_MAKE_ROOT_DIRECTORY="\"$(SRCDIR)\"" |
# | # |
#***********************************************************************************************# | #***********************************************************************************************# |
| |
|
|
# | # |
# Link flags for all targets | # Link flags for all targets |
# | # |
LL_ALL = $(SYSLIBS) |
LL_ALL = $(SYSLIBS) -lcurl |
|
|
|
ifeq ($(JSOC_MACHINE), linux_avx) |
|
GCC_LF_ALL = $(STATIC) -Wl,--copy-dt-needed-entries |
|
ICC_LF_ALL = -diag-disable 10237 $(STATIC) -openmp -static-intel -Wl,-export-dynamic -Wl,--copy-dt-needed-entries |
|
else |
GCC_LF_ALL = $(STATIC) | GCC_LF_ALL = $(STATIC) |
ICC_LF_ALL = -diag-disable 10237 $(STATIC) -openmp -static-intel -Wl,-export-dynamic | ICC_LF_ALL = -diag-disable 10237 $(STATIC) -openmp -static-intel -Wl,-export-dynamic |
|
endif |
| |
# Fortran global LINK flags | # Fortran global LINK flags |
ifeq ($(FCOMPILER), ifort) | ifeq ($(FCOMPILER), ifort) |
Line 222 ifeq ($(DEBUG), 0) |
|
Line 251 ifeq ($(DEBUG), 0) |
|
| |
ifeq ($(JSOC_MACHINE), linux_x86_64) | ifeq ($(JSOC_MACHINE), linux_x86_64) |
ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) $(GLOBALSW) -DNDEBUG | ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW) $(GLOBALSW) -DNDEBUG |
GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -O2 -march=opteron $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW) $(GLOBALSW) -DNDEBUG |
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_avx) | ifeq ($(JSOC_MACHINE), linux_avx) |
Line 320 SLLIB = ln -sf ../../_$(MACH)/$@ ../lib |
|
Line 349 SLLIB = ln -sf ../../_$(MACH)/$@ ../lib |
|
# LIBRARY COLLECTIONS | # LIBRARY COLLECTIONS |
# | # |
ALL_LIBS_FPIC = $(LIBDRMSCLIENT_FPIC) $(LIBDBCLIENT_FPIC) $(LIBCMDPARAMS_FPIC) $(LIBTHREADUTIL_FPIC) $(LIBRICECOMP_FPIC) $(LIBDEFS_FPIC) $(LIBMISC_FPIC) $(LIBDSTRUCT_FPIC) $(LIBTIMEIO_FPIC) $(LIBFITSRW_FPIC) | ALL_LIBS_FPIC = $(LIBDRMSCLIENT_FPIC) $(LIBDBCLIENT_FPIC) $(LIBCMDPARAMS_FPIC) $(LIBTHREADUTIL_FPIC) $(LIBRICECOMP_FPIC) $(LIBDEFS_FPIC) $(LIBMISC_FPIC) $(LIBDSTRUCT_FPIC) $(LIBTIMEIO_FPIC) $(LIBFITSRW_FPIC) |
|
ALL_LIBS_PY_FPIC = $(LIBDRMS_SERVER_FPIC) $(LIBDB_SERVER_FPIC) $(LIBCMDPARAMS_FPIC) $(LIBTHREADUTIL_FPIC) $(LIBRICECOMP_FPIC) $(LIBDEFS_FPIC) $(LIBMISC_FPIC) $(LIBDSTRUCT_FPIC) $(LIBTIMEIO_FPIC) $(LIBFITSRW_FPIC) |
| |
### Standard parts | ### Standard parts |
# | # |
Line 327 include $(SRCDIR)/Rules.mk |
|
Line 357 include $(SRCDIR)/Rules.mk |
|
| |
# Libraries from src/util linked with all programs. | # Libraries from src/util linked with all programs. |
ifneq ($(COMPILER), icc) | ifneq ($(COMPILER), icc) |
SYSLIBS = -lz -ldl -lpthread -lm |
SYSLIBS = -lz -ldl -lpthread -lm -lutil |
else | else |
SYSLIBS = -lz -ldl -lpthread |
SYSLIBS = -lz -ldl -lpthread -lutil |
endif | endif |
SRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMS) $(LIBTIMEIO) $(LIBFITSRW) $(LIBERRLOG) $(LIBEXPDRMS) $(LIBEXPUTL) $(LIBMISC) $(LIBDSTRUCT) $(LIBSTATS) | SRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMS) $(LIBTIMEIO) $(LIBFITSRW) $(LIBERRLOG) $(LIBEXPDRMS) $(LIBEXPUTL) $(LIBMISC) $(LIBDSTRUCT) $(LIBSTATS) |
FSRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMSF) $(LIBTIMEIO) $(LIBFITSRW) $(LIBERRLOG) $(LIBEXPDRMS) $(LIBEXPUTL) $(LIBMISC) $(LIBDSTRUCT) $(LIBSTATS) | FSRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOMP) $(LIBCMDPARAMSF) $(LIBTIMEIO) $(LIBFITSRW) $(LIBERRLOG) $(LIBEXPDRMS) $(LIBEXPUTL) $(LIBMISC) $(LIBDSTRUCT) $(LIBSTATS) |
Line 339 FSRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOM |
|
Line 369 FSRCLIBS = $(LIBTHREADUTIL) $(LIBRICECOM |
|
| |
# SERVERLIBS: Libraries linked with "server" programs that | # SERVERLIBS: Libraries linked with "server" programs that |
# need direct access to the DRMS databases. | # need direct access to the DRMS databases. |
SERVERLIBS = $(LIBDRMS) $(LIBDEFSSERVER) $(LIBDB) $(LIBSUMSAPI) $(SRCLIBS) |
SERVERLIBS = $(LIBDRMS) $(LIBDEFSSERVER) $(LIBDB) $(LIBSUMSAPI) $(LIBCJSON) $(SRCLIBS) |
| |
# EXELIBS: Libraries linked with standalone executables. | # EXELIBS: Libraries linked with standalone executables. |
EXELIBS = $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(SRCLIBS) | EXELIBS = $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(SRCLIBS) |
Line 348 EXELIBS = $(LIBDRMSCLIENT) $(LIBDEFSCLIE |
|
Line 378 EXELIBS = $(LIBDRMSCLIENT) $(LIBDEFSCLIE |
|
MODLIBS = $(LIBJSOC_MAIN) $(SERVERLIBS) | MODLIBS = $(LIBJSOC_MAIN) $(SERVERLIBS) |
| |
# MODLIBS_SOCK: Libraries linked with DRMS modules with socket connection to a drms_server | # MODLIBS_SOCK: Libraries linked with DRMS modules with socket connection to a drms_server |
MODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK) $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(LIBSUMSAPI) $(SRCLIBS) |
MODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK) $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(LIBSUMSAPI) $(LIBCJSON) $(SRCLIBS) |
| |
# FMODLIBS: Libraries linked with DRMS Fortran modules | # FMODLIBS: Libraries linked with DRMS Fortran modules |
FMODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK_F) $(LIBINTHANDLESF) $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(FSRCLIBS) | FMODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK_F) $(LIBINTHANDLESF) $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(FSRCLIBS) |