ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/proj/globalhs/apps/Rules.mk
Revision: 1.47
Committed: Wed Sep 14 21:54:57 2022 UTC (12 months, 1 week ago) by tplarson
Branch: MAIN
CVS Tags: globalhs_version_23, globalhs_version_22
Changes since 1.46: +11 -9 lines
Log Message:
accommodate mcmodel=medium for jpkpbgn2600d and jpkbgn5200d

File Contents

# User Rev Content
1 tplarson 1.47 # $Header: /home/cvsuser/cvsroot/JSOC/proj/globalhs/apps/Rules.mk,v 1.46 2022/09/13 20:57:56 tplarson Exp $
2 tplarson 1.29
3 tplarson 1.1 # Standard things
4     sp := $(sp).x
5     dirstack_$(sp) := $(d)
6     d := $(dir)
7    
8 tplarson 1.28 # all checks for icc being the compiler are removed; this condition is already checked in localization/Rules.mk
9     # if the compiler is other than icc, this make file will not be included.
10 tplarson 1.29
11 tplarson 1.33 # GLOBALHS_TAG is defined in Rules.mk in the parent directory,
12     # its definition is repeated here for ease of reading
13 tplarson 1.34 #GLOBALHS_TAG := $(shell $(SRCDIR)/proj/globalhs/scripts/checkglobalhstags $(SRCDIR))
14 tplarson 1.29
15 tplarson 1.28 # Local variables
16    
17 tplarson 1.29 MODEXE_$(d) := $(addprefix $(d)/, jretile jrebinsmooth undistortmdi jtsslice mkylms)
18 tplarson 1.28 MODEXE := $(MODEXE) $(MODEXE_$(d))
19    
20 tplarson 1.46 MODEXE_USEF_$(d) := $(addprefix $(d)/, jv2ts jtsfiddle jpkbgn jpkbgn360d jpkbgn2600d jpkbgn5200d)
21 tplarson 1.28 MODEXE_USEF := $(MODEXE_USEF) $(MODEXE_USEF_$(d))
22 arta 1.9
23 tplarson 1.28 MODEXE_SOCK_$(d) := $(MODEXE_$(d):%=%_sock)
24     MODEXE_SOCK := $(MODEXE_SOCK) $(MODEXE_SOCK_$(d))
25 tplarson 1.19
26 tplarson 1.28 MODEXE_USEF_SOCK_$(d) := $(MODEXE_USEF_$(d):%=%_sock)
27     MODEXE_USEF_SOCK := $(MODEXE_USEF_SOCK) $(MODEXE_USEF_SOCK_$(d))
28 arta 1.3
29 tplarson 1.29 JV2TS := $(addprefix $(d)/, jv2ts jv2ts_sock)
30 arta 1.3 JRETILE := $(addprefix $(d)/, jretile jretile_sock)
31 tplarson 1.29 JTSFIDDLE := $(addprefix $(d)/, jtsfiddle jtsfiddle_sock)
32     JTSSLICE := $(addprefix $(d)/, jtsslice jtsslice_sock)
33 arta 1.3 JPKBGN := $(addprefix $(d)/, jpkbgn jpkbgn_sock)
34 tplarson 1.35 JPKBGN360D := $(addprefix $(d)/, jpkbgn360d jpkbgn360d_sock)
35 tplarson 1.46 JPKBGN2600D := $(addprefix $(d)/, jpkbgn2600d jpkbgn2600d_sock)
36     JPKBGN5200D := $(addprefix $(d)/, jpkbgn5200d jpkbgn5200d_sock)
37 tplarson 1.22 JREBINSMOOTH := $(addprefix $(d)/, jrebinsmooth jrebinsmooth_sock)
38 tplarson 1.29 UNDISTORTMDI := $(addprefix $(d)/, undistortmdi undistortmdi_sock)
39     MKYLMS := $(addprefix $(d)/, mkylms mkylms_sock)
40 tplarson 1.14 DURCON := $(d)/durcon
41 tplarson 1.43 ifeq ($(JSOC_MACHINE), linux_avx)
42 tplarson 1.36 INV2D := $(d)/inv2d.x
43     INV2DOBJ := $(d)/inv2d.o
44 tplarson 1.43 endif
45 arta 1.3
46 tplarson 1.35 JPKBGNSRC := $(SRCDIR)/$(d)/jpkbgn.c
47    
48 arta 1.3 EXE_$(d) := $(MODEXE_$(d)) $(MODEXE_USEF_$(d))
49 tplarson 1.1 OBJ_$(d) := $(EXE_$(d):%=%.o)
50 tplarson 1.22 DEP_$(d) := $(OBJ_$(d):%=%.d)
51 tplarson 1.1 CLEAN := $(CLEAN) \
52     $(OBJ_$(d)) \
53     $(EXE_$(d)) \
54 arta 1.3 $(MODEXE_SOCK_$(d)) \
55     $(MODEXE_USEF_SOCK_$(d)) \
56     $(DEP_$(d)) \
57 tplarson 1.36 $(DURCON) \
58     $(INV2D) $(INV2DOBJ)
59 tplarson 1.1
60 tplarson 1.47
61 arta 1.40 # Remove globalhs from 'default make'. To do a release, run 'make; make globalhs'.
62     # TGT_BIN := $(TGT_BIN) $(EXE_$(d)) $(MODEXE_SOCK_$(d)) $(MODEXE_USEF_SOCK_$(d)) $(DURCON) $(INV2D)
63 tplarson 1.1
64 tplarson 1.36 S_$(d) := $(notdir $(EXE_$(d)) $(MODEXE_SOCK_$(d)) $(MODEXE_USEF_SOCK_$(d)) $(DURCON) $(INV2D))
65 tplarson 1.1
66     # Local rules
67 tplarson 1.22 $(OBJ_$(d)): $(SRCDIR)/$(d)/Rules.mk
68 arta 1.41 $(OBJ_$(d)): CF_TGT := $(CFITSIOH) $(GSLH) $(FFTWH) -I$(SRCDIR)/$(d)/../../libs/stats -I$(SRCDIR)/$(d)/../../libs/interpolate -I$(SRCDIR)/$(d)/../libs/projection -I$(SRCDIR)/$(d)/../libs/pkbgn
69     $(OBJ_$(d)): CF_TGT := $(CF_TGT) -DCDIR="\"$(SRCDIR)/$(d)\"" -DCVSTAG="\"$(GLOBALHS_TAG)\""
70 arta 1.7
71 tplarson 1.29 $(JV2TS) : $(LIBPROJECTION)
72     $(JREBINSMOOTH) $(MKYLMS) : $(LIBINTERP)
73     $(JTSFIDDLE) : $(LIBDTGF)
74     $(JPKBGN) : $(LIBPKBGN)
75 tplarson 1.35 $(JPKBGN360D) : $(LIBPKBGN360D)
76     $(JPKBGN360D:%=%.o) : $(JPKBGNSRC)
77     $(COMP)
78 tplarson 1.46 $(JPKBGN2600D) : $(LIBPKBGN2600D)
79     $(JPKBGN2600D:%=%.o) : $(JPKBGNSRC)
80 tplarson 1.47 $(COMP) -lmkl_em64t_sequential -mcmodel=medium
81 tplarson 1.46 $(JPKBGN5200D) : $(LIBPKBGN5200D)
82     $(JPKBGN5200D:%=%.o) : $(JPKBGNSRC)
83 tplarson 1.47 $(COMP) -lmkl_em64t_sequential -mcmodel=medium
84 tplarson 1.29
85 tplarson 1.42 # the following include file makes use of the -mcmodel compiler flag
86     # DO NOT COPY THIS FILE WITHOUT A THOROUGH UNDERSTANDING OF THIS FLAG
87     include $(SRCDIR)/$(d)/invobj.mk
88    
89 tplarson 1.43 $(INV2D) : LL_TGT := $(LL_TGT) -lmkl_em64t
90 tplarson 1.36 $(INV2D) : $(LIBINV2D)
91     $(INV2D) : $(INV2DOBJ)
92     $(FLINK)
93     $(SLBIN)
94    
95 tplarson 1.47 # force recompile to ensure consistency, now deemed unnecessary
96     #ifeq ($(GLOBALHSTAGOVERRIDE),)
97     #.PHONY: force_globalhsapps
98     #$(OBJ_$(d)) $(INV2DOBJ): force_globalhsapps
99     #force_globalhsapps:
100     # [[ $(GLOBALHS_TAG) =~ globalhs ]]
101     #endif
102 tplarson 1.28
103     NOIPO_$(d) :=
104     MKL := -lmkl
105    
106     ifeq ($(JSOC_MACHINE), linux_avx)
107     MKL := $(NOIPO_$(d)) -lmkl_em64t
108 arta 1.8 endif
109    
110 tplarson 1.28 ifeq ($(JSOC_MACHINE), linux_x86_64)
111     MKL := $(NOIPO_$(d)) -lmkl_em64t
112     endif
113 arta 1.3
114 tplarson 1.28 ifeq ($(JSOC_MACHINE), linux_ia32)
115     MKL := $(NOIPO_$(d)) -lmkl_lapack -lmkl_ia32
116 arta 1.8 endif
117    
118     SVML_$(d) :=
119     GUIDE_$(d) :=
120    
121 tplarson 1.22 ALL_$(d) := $(MODEXE_$(d)) $(MODEXE_SOCK_$(d)) $(MODEXE_USEF_$(d)) $(MODEXE_USEF_SOCK_$(d))
122 tplarson 1.29 $(ALL_$(d)) : LL_TGT := $(LL_TGT) $(GSLLIBS) $(CFITSIOLIBS) $(FFTW3FLIBS) $(MKL) $(SVML_$(d)) $(GUIDE_$(d))
123 tplarson 1.22
124 tplarson 1.33 $(DURCON) : $(SRCDIR)/$(d)/durcon.c $(SRCDIR)/$(d)/Rules.mk
125 tplarson 1.14 cc -o $@ $<
126     $(SLBIN)
127    
128 tplarson 1.1 # Shortcuts
129 arta 1.3 .PHONY: $(S_$(d)) globalhs
130 tplarson 1.1 $(S_$(d)): %: $(d)/%
131 tplarson 1.38 globalhs : $(ALL_$(d)) $(DURCON) $(INV2D)
132 tplarson 1.1
133 arta 1.9
134 tplarson 1.1 # Standard things
135     -include $(DEP_$(d))
136    
137     d := $(dirstack_$(sp))
138     sp := $(basename $(sp))