source: branches/alma/src/Makefile@ 1759

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

New Development: Yes

JIRA Issue: Yes (CAS-2211)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: ASAP 3.0.0 interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): all the CASA sd tools and tasks are affected.

Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.

Note you also need to update casa/code/atnf.


File size: 6.3 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
11# the casa environment AIPSPATH has to be defined
12CASAROOT := $(word 1, $(CASAPATH))
13CASAARCH := $(word 2, $(CASAPATH))
14
15COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
16CORELIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CORELIB eval_vars) && echo $$CORELIB)
17WCSLIBLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=WCSLIBLIBD eval_vars) && echo $$WCSLIBLIBD)
18WCSLIBLIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=WCSLIBLIB eval_vars) && echo $$WCSLIBLIB)
19PYTHONLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIBD eval_vars) && echo $$PYTHONLIBD)
20PYTHONINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONINCD eval_vars) && echo $$PYTHONINCD)
21PYTHONLIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIB eval_vars) && echo $$PYTHONLIB)
22BOOSTROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=BOOSTROOT eval_vars) && echo $$BOOSTROOT)
23
24CASAINC := -I$(CASAROOT)/code/include -I$(COREINCD) -I$(CASAROOT)/$(CASAARCH)/include
25CASALIB := $(CASAROOT)/$(CASAARCH)/lib
26USELIB := lib64
27
28# the compiler
29ifndef CXX
30 CXX := g++
31endif
32
33# compiler flags
34CXXFLAGS := -fPIC -O3 -g
35CXXFLAGS += -ansi -Wno-long-long -Wall
36CXXOPTS := -DAIPS_64B
37
38# darwin specific flags
39ifeq "$(CASAARCH)" "darwin"
40 CXXFLAGS +=-DAIPS_DARWIN
41 CXXFLAGS += -Wno-long-double
42endif
43
44# cfitsio
45CFITSIOROOT := /usr
46CFITSIOINC := -I$(CFITSIOROOT)/include/cfitsio
47CFITSIOLIB := -lcfitsio
48
49#rpfits
50RPFITSROOT := /usr
51RPFITSLIB := -lrpfits
52
53G2CROOT := /usr
54G2CLIB := -lgfortran
55
56# This assumes all casa libs are static only (*.a)
57# if not than there might by symbol resolution errors.
58CASAPPLIB := -L$(CASALIB) -latnf $(CORELIB) \
59 -L$(WCSLIBLIBD) $(WCSLIBLIB) \
60 $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++
61
62# darwin specific CASA flags
63ifeq "$(CASAARCH)" "darwin"
64 CASAPPLIB += -framework vecLib
65else
66 CASAPPLIB += -llapack -lblas
67endif
68
69# python
70PYTHONINC := $(addprefix -I,$(PYTHONINCD))
71PYTHONLIB := -L$(PYTHONLIBD) $(PYTHONLIB)
72
73# use python universal build
74ifeq "$(CASAARCH)" "darwin"
75 PYVERSION := 2.5
76 PYTHONROOT := /Library/Frameworks/Python.framework/Versions/$(PYVERSION)
77 PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
78 PYTHONLIB := -L$(PYTHONROOT)/lib -framework Python
79endif
80
81# the linker
82LD := $(CXX)
83
84# has to be build with same g++ version as casa
85BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
86BOOSTINC := -I$(BOOSTROOT)/include/boost -I$(BOOSTROOT)/include
87
88LDFLAGS := -shared -Wl$(TARGET) -s -Xlinker -rpath -Xlinker $(BOOSTROOT)/lib:$(PYTHONROOT)/lib:$(CASALIB)
89ifeq "$(CASAARCH)" "darwin"
90 LDFLAGS := -bundle
91endif
92
93
94# DO NOT MODIFY AFTER THIS
95INCDIRS := -I. $(CASAINC) $(CFITSIOINC) $(BOOSTINC) $(PYTHONINC)
96LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
97
98CCOBJECTS := MathUtils.o \
99 RowAccumulator.o \
100 Logger.o \
101 LineCatalog.o \
102 STAttr.o \
103 STHeader.o \
104 STFiller.o \
105 STMath.o \
106 STSubTable.o \
107 STMolecules.o \
108 STTcal.o \
109 STFocus.o \
110 STWeather.o \
111 STFrequencies.o \
112 STHistory.o \
113 STSelector.o \
114 STLineFinder.o \
115 STFitter.o \
116 STFitEntry.o \
117 STFit.o \
118 STPol.o \
119 STPolLinear.o \
120 STPolCircular.o \
121 STPolStokes.o \
122 STWriter.o \
123 STAsciiWriter.o \
124 STFITSImageWriter.o \
125 STAtmosphere.o \
126 Scantable.o \
127 Templates.o
128PYOBJECTS := python_Scantable.o \
129 python_STFiller.o \
130 python_STSelector.o \
131 python_STMath.o \
132 python_Fitter.o \
133 python_Logger.o \
134 python_STLineFinder.o \
135 python_STFitEntry.o \
136 python_STWriter.o \
137 python_LineCatalog.o \
138 python_SrcType.o \
139 python_STAtmosphere.o \
140 python_STCoordinate.o \
141 python_asap.o
142
143OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
144
145HEADERS := MathUtils.h \
146 Lorentzian1D.h \
147 Lorentzian1DParam.h \
148 Logger.h \
149 STAttr.h \
150 STHeader.h \
151 Scantable.h \
152 STFiller.h \
153 STMath.h \
154 RowAccumulator.h \
155 STSubTable.h \
156 STMolecules.h \
157 STTcal.h \
158 STFocus.h \
159 STWeather.h \
160 STHistory.h \
161 STFrequencies.h \
162 STDefs.h \
163 STWriter.h \
164 STSelector.h \
165 STFitter.h \
166 STFit.h \
167 STFitEntry.h \
168 STLineFinder.h \
169 Factory.h \
170 FactoryBase.h \
171 STPol.h \
172 STPolStokes.h \
173 STPolCircular.h \
174 STPolLinear.h \
175 STWriter.h \
176 STAsciiWriter.h \
177 STFITSImageWriter.h \
178 IndexedCompare.h \
179 STAtmosphere.h \
180 STCoordinate.h
181
182STATICCCLIB := libasap.a
183MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
184
185.SUFFIXES: .c .o .cpp .cc .cxx .C
186
187.cpp.o:
188 -@ echo
189 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
190
191.cc.o:
192 -@ echo
193 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
194
195.cxx.o:
196 -@ echo
197 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
198
199.C.o:
200 -@ echo
201 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
202
203
204.PHONY : all clean objects realclean relink
205
206all : $(TARGET)
207
208relink : cleanso $(TARGET)
209
210objects : $(OBJECTS)
211
212$(TARGET) : $(OBJECTS)
213 -@ echo
214 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
215
216$(OBJECTS) : $(HEADERS)
217
218staticlib: $(MEMBERS)
219
220clean :
221 -rm -f $(OBJECTS)
222
223cleanso :
224 -rm -f $(TARGET)
225
226realclean : clean cleanso
227
228test: objects tasap2.o
229 -@ echo
230 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.