source: branches/polybatch/src/Makefile@ 1945

Last change on this file since 1945 was 1915, checked in by Kana Sugimoto, 14 years ago

New Development: No

JIRA Issue: No (related to merge)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: make & make install

Put in Release Notes: No

Module(s): asap

Description: merged Wes's changes to Makefiles


File size: 6.8 KB
Line 
1### Notice:
2### This Makefile assumes CASA+CASACore enviroment.
3### For who wants to build ASAP with older CASA without CASACore,
4### 1. Replace $(CASAPATH) with $(AIPSPATH).
5### 2. CASAINC should be
6### '-I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa'
7### 3. Replase library names in G2CARCH '-lcasa_*' with '-l*'.
8### 4. Comment-IN the definition of 'CXXOPTS'.
9TARGET := /tmp/_asap.so
10
11ifndef ASAPROOT
12 ASAPROOT := $(abspath ..)
13endif
14ATNFD := external-alma
15
16# the casa environment AIPSPATH has to be defined
17CASAROOT := $(word 1, $(CASAPATH))
18CASAARCH := $(word 2, $(CASAPATH))
19
20CXXFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CXXFLAGS eval_vars) && echo $$CXXFLAGS)
21CXXOPTS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COPTFLAGS eval_vars) && echo $$COPTFLAGS)
22LDFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=LD_FLAGS eval_vars) && echo $$LD_FLAGS)
23
24COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
25CORELIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CORELIB eval_vars) && echo $$CORELIB)
26WCSLIBLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=WCSLIBLIBD eval_vars) && echo $$WCSLIBLIBD)
27WCSLIBLIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=WCSLIBLIB eval_vars) && echo $$WCSLIBLIB)
28PYTHONROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONROOT eval_vars) && echo $$PYTHONROOT)
29PYTHONLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIBD eval_vars) && echo $$PYTHONLIBD)
30PYTHONINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONINCD eval_vars) && echo $$PYTHONINCD)
31PYTHONLIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIB eval_vars) && echo $$PYTHONLIB)
32BOOSTROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=BOOSTROOT eval_vars) && echo $$BOOSTROOT)
33RPFITSLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=RPFITSLIBD eval_vars) && echo $$RPFITSLIBD)
34CFITSIOLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CFITSIOLIBD eval_vars) && echo $$CFITSIOLIBD)
35CFITSIOINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CFITSIOINCD eval_vars) && echo $$CFITSIOINCD)
36
37CASAINC := -I$(CASAROOT)/code/include -I$(COREINCD) -I$(CASAROOT)/$(CASAARCH)/include
38CASALIB := $(CASAROOT)/$(CASAARCH)/lib
39
40# the compiler
41ifndef CXX
42 CXX := g++
43endif
44
45# compiler flags
46CXXFLAGS += -fPIC -DHAVE_LIBPYRAP
47
48PYRAPD := $(ASAPROOT)/external/libpyrap
49PYRAPLIBD := $(PYRAPD)
50PYRAPINCD := $(PYRAPD)/pyrap-0.3.2
51PYRAPLIB := -L$(PYRAPLIBD) -lpyrap
52
53
54CFITSIOLIB := -lcfitsio
55
56#rpfits
57RPFITSLIB := -lrpfits
58
59G2CROOT := /usr
60G2CLIB := -lgfortran
61
62# links to external libraries
63CASAPPLIB := -L$(ASAPROOT)/$(ATNFD) -latnf $(CORELIB) $(PYRAPLIB)\
64 -L$(WCSLIBLIBD) $(WCSLIBLIB) \
65 -L$(RPFITSLIBD) $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++
66
67# darwin specific CASA flags
68ifeq ($(shell uname), Darwin)
69 CASAPPLIB += -framework vecLib
70else
71 CASAPPLIB += -llapack -lblas
72endif
73
74LD := $(CXX)
75
76# has to be build with same g++ version as casa
77BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
78BOOSTINC := -I$(BOOSTROOT)/include/boost -I$(BOOSTROOT)/include
79
80LDFLAGS += -shared
81
82
83# DO NOT MODIFY AFTER THIS
84INCDIRS := -I. $(CASAINC) -I$(CFITSIOINCD) $(BOOSTINC) $(addprefix -I, $(PYTHONINCD)) -I$(ASAPROOT)/$(ATNFD) -I$(PYRAPINCD)
85LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
86
87CCOBJECTS := MathUtils.o \
88 RowAccumulator.o \
89 Logger.o \
90 LineCatalog.o \
91 STAttr.o \
92 STHeader.o \
93 STFiller.o \
94 STMath.o \
95 STSubTable.o \
96 STMolecules.o \
97 STTcal.o \
98 STFocus.o \
99 STWeather.o \
100 STFrequencies.o \
101 STHistory.o \
102 STSelector.o \
103 STLineFinder.o \
104 STFitter.o \
105 STFitEntry.o \
106 STFit.o \
107 STPol.o \
108 STPolLinear.o \
109 STPolCircular.o \
110 STPolStokes.o \
111 STWriter.o \
112 STAsciiWriter.o \
113 STFITSImageWriter.o \
114 STAtmosphere.o \
115 Scantable.o \
116 FillerBase.o \
117 NROFiller.o \
118 PKSFiller.o \
119 AsapLogSink.o \
120 Templates.o
121
122PYOBJECTS := python_Scantable.o \
123 python_STFiller.o \
124 python_STSelector.o \
125 python_STMath.o \
126 python_Fitter.o \
127 python_Logger.o \
128 python_STLineFinder.o \
129 python_STFitEntry.o \
130 python_STWriter.o \
131 python_LineCatalog.o \
132 python_SrcType.o \
133 python_STAtmosphere.o \
134 python_STCoordinate.o \
135 python_Filler.o \
136 python_LogSink.o \
137 python_asap.o
138
139OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
140
141HEADERS := MathUtils.h \
142 LineCatalog.h \
143 Lorentzian1D.h \
144 Lorentzian1DParam.h \
145 Logger.h \
146 STAttr.h \
147 STHeader.h \
148 Scantable.h \
149 STFiller.h \
150 STMath.h \
151 RowAccumulator.h \
152 STSubTable.h \
153 STMolecules.h \
154 STTcal.h \
155 STFocus.h \
156 STWeather.h \
157 STHistory.h \
158 STFrequencies.h \
159 STDefs.h \
160 STWriter.h \
161 STSelector.h \
162 STFitter.h \
163 STFit.h \
164 STFitEntry.h \
165 STLineFinder.h \
166 Factory.h \
167 FactoryBase.h \
168 STPol.h \
169 STPolStokes.h \
170 STPolCircular.h \
171 STPolLinear.h \
172 STWriter.h \
173 STAsciiWriter.h \
174 STFITSImageWriter.h \
175 IndexedCompare.h \
176 STAtmosphere.h \
177 STCoordinate.h \
178 FillerBase.h \
179 NROFiller.h \
180 PKSFiller.h \
181 AsapLogSink.h
182
183STATICCCLIB := libasap.a
184MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
185
186.SUFFIXES: .c .o .cpp .cc .cxx .C
187
188.cpp.o:
189 -@ echo
190 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
191
192.cc.o:
193 -@ echo
194 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
195
196.cxx.o:
197 -@ echo
198 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
199
200.C.o:
201 -@ echo
202 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
203
204
205.PHONY : all clean objects realclean relink
206
207all : $(TARGET)
208
209relink : cleanso $(TARGET)
210
211objects : $(OBJECTS)
212
213$(TARGET) : $(OBJECTS)
214 -@ echo
215 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
216
217$(OBJECTS) : $(HEADERS)
218
219staticlib: $(MEMBERS)
220
221clean :
222 -rm -f $(OBJECTS)
223
224cleanso :
225 -rm -f $(TARGET)
226
227realclean : clean cleanso
228
229test: objects tasap2.o
230 -@ echo
231 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.