source: trunk/src/Makefile@ 1895

Last change on this file since 1895 was 1894, 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: try make

Put in Release Notes: No

Module(s): asap

Description: merged Wes's developments in NRAO repository.

Library and include pathes and build options are copied from casa build.


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