source: trunk/src/Makefile@ 1910

Last change on this file since 1910 was 1906, checked in by Takeshi Nakazato, 14 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: build asap

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Enable pyrap conversion (-DHAVE_LIBPYRAP).

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
47CXXOPTS += -DHAVE_LIBPYRAP
48
49CFITSIOLIB := -lcfitsio
50
51#rpfits
52RPFITSLIB := -lrpfits
53
54G2CROOT := /usr
55G2CLIB := -lgfortran
56
57# pyrap
58PYRAPD := $(ASAPROOT)/external/libpyrap
59PYRAPLIBD := $(PYRAPD)
60PYRAPINCD := $(PYRAPD)/pyrap-0.3.2
61PYRAPLIB := -L$(PYRAPLIBD) -lpyrap
62
63# links to external libraries
64CASAPPLIB := -L$(ASAPROOT)/$(ATNFD) -latnf $(CORELIB) $(PYRAPLIB) \
65 -L$(WCSLIBLIBD) $(WCSLIBLIB) \
66 -L$(RPFITSLIBD) $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++
67
68# darwin specific CASA flags
69ifeq ($(shell uname), Darwin)
70 CASAPPLIB += -framework vecLib
71else
72 CASAPPLIB += -llapack -lblas
73endif
74
75LD := $(CXX)
76
77# has to be build with same g++ version as casa
78BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
79BOOSTINC := -I$(BOOSTROOT)/include/boost -I$(BOOSTROOT)/include
80
81LDFLAGS += -shared
82
83
84# DO NOT MODIFY AFTER THIS
85INCDIRS := -I. $(CASAINC) -I$(CFITSIOINCD) $(BOOSTINC) -I$(PYTHONINCD) -I$(ASAPROOT)/$(ATNFD) -I$(PYRAPINCD)
86LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
87
88CCOBJECTS := MathUtils.o \
89 RowAccumulator.o \
90 Logger.o \
91 LineCatalog.o \
92 STAttr.o \
93 STHeader.o \
94 STFiller.o \
95 STMath.o \
96 STSubTable.o \
97 STMolecules.o \
98 STTcal.o \
99 STFocus.o \
100 STWeather.o \
101 STFrequencies.o \
102 STHistory.o \
103 STSelector.o \
104 STLineFinder.o \
105 STFitter.o \
106 STFitEntry.o \
107 STFit.o \
108 STPol.o \
109 STPolLinear.o \
110 STPolCircular.o \
111 STPolStokes.o \
112 STWriter.o \
113 STAsciiWriter.o \
114 STFITSImageWriter.o \
115 STAtmosphere.o \
116 Scantable.o \
117 FillerBase.o \
118 NROFiller.o \
119 PKSFiller.o \
120 AsapLogSink.o \
121 Templates.o
122
123PYOBJECTS := python_Scantable.o \
124 python_STFiller.o \
125 python_STSelector.o \
126 python_STMath.o \
127 python_Fitter.o \
128 python_Logger.o \
129 python_STLineFinder.o \
130 python_STFitEntry.o \
131 python_STWriter.o \
132 python_LineCatalog.o \
133 python_SrcType.o \
134 python_STAtmosphere.o \
135 python_STCoordinate.o \
136 python_Filler.o \
137 python_LogSink.o \
138 python_asap.o
139
140OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
141
142HEADERS := MathUtils.h \
143 LineCatalog.h \
144 Lorentzian1D.h \
145 Lorentzian1DParam.h \
146 Logger.h \
147 STAttr.h \
148 STHeader.h \
149 Scantable.h \
150 STFiller.h \
151 STMath.h \
152 RowAccumulator.h \
153 STSubTable.h \
154 STMolecules.h \
155 STTcal.h \
156 STFocus.h \
157 STWeather.h \
158 STHistory.h \
159 STFrequencies.h \
160 STDefs.h \
161 STWriter.h \
162 STSelector.h \
163 STFitter.h \
164 STFit.h \
165 STFitEntry.h \
166 STLineFinder.h \
167 Factory.h \
168 FactoryBase.h \
169 STPol.h \
170 STPolStokes.h \
171 STPolCircular.h \
172 STPolLinear.h \
173 STWriter.h \
174 STAsciiWriter.h \
175 STFITSImageWriter.h \
176 IndexedCompare.h \
177 STAtmosphere.h \
178 STCoordinate.h \
179 FillerBase.h \
180 NROFiller.h \
181 PKSFiller.h \
182 AsapLogSink.h
183
184STATICCCLIB := libasap.a
185MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
186
187.SUFFIXES: .c .o .cpp .cc .cxx .C
188
189.cpp.o:
190 -@ echo
191 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
192
193.cc.o:
194 -@ echo
195 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
196
197.cxx.o:
198 -@ echo
199 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
200
201.C.o:
202 -@ echo
203 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
204
205
206.PHONY : all clean objects realclean relink
207
208all : $(TARGET)
209
210relink : cleanso $(TARGET)
211
212objects : $(OBJECTS)
213
214$(TARGET) : $(OBJECTS)
215 -@ echo
216 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
217
218$(OBJECTS) : $(HEADERS)
219
220staticlib: $(MEMBERS)
221
222clean :
223 -rm -f $(OBJECTS)
224
225cleanso :
226 -rm -f $(TARGET)
227
228realclean : clean cleanso
229
230test: objects tasap2.o
231 -@ echo
232 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.