source: branches/alma/src/Makefile@ 1603

Last change on this file since 1603 was 1603, checked in by TakTsutsumi, 15 years ago

New Development: No, merge with asap2.3.1

JIRA Issue: Yes CAS-1450

Ready to Release: Yes/No

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes

Module(s): single dish

Description: Upgrade of alma branch based on ASAP2.2.0

(rev.1562) to ASAP2.3.1 (rev.1561)


File size: 5.9 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'.
[1520]9TARGET := /tmp/_asap.so
[1446]10
11# the casa environment AIPSPATH has to be defined
[1455]12CASAROOT := $(word 1, $(CASAPATH))
13CASAARCH := $(word 2, $(CASAPATH))
14CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/$(CASAARCH)/include/casacore -I$(CASAROOT)/$(CASAARCH)/include
[1446]15CASALIB := $(CASAROOT)/$(CASAARCH)/lib
16
17
18# the compiler
19ifndef CXX
20 CXX := g++
21endif
22
23# compiler flags
24CXXFLAGS := -fPIC -O3 -g
25CXXFLAGS += -ansi -Wno-long-long -Wall
[1455]26#CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
[1446]27
28# darwin specific flags
29ifeq "$(CASAARCH)" "darwin"
30 CXXFLAGS +=-DAIPS_DARWIN
31 CXXFLAGS += -Wno-long-double
32endif
33
34# cfitsio
35CFITSIOROOT := /usr
36CFITSIOINC := -I$(CFITSIOROOT)/include/cfitsio
37#CFITSIOLIB := -L$(CFITSIOROOT)/lib -lcfitsio
38CFITSIOLIB := -lcfitsio
39
40#rpfits
41RPFITSROOT := /usr
42#RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
43RPFITSLIB := -lrpfits
44
[1603]45#wcs
46WCSLIB := -lwcs
47
[1446]48G2CROOT := /usr
[1603]49#G2CARCH := $(G2CROOT)/lib/gcc/i386-apple-darwin8.7.1/4.2.0/libgcc.a
50#G2CARCH := $(G2CROOT)/lib/gcc/powerpc-apple-darwin8.7.0/4.2.0/libgcc.a
51G2CARCH := $(G2CROOT)/lib/gcc/i386-redhat-linux/4.1.2/libgcc.a
[1446]52#G2CLIB := $(G2CROOT)/lib/libgfortran.a
[1603]53G2CLIB := $(G2CARCH)
54#G2CLIB := -lg2c
[1446]55
56# This assumes all casa libs are static only (*.a)
57# if not than there might by symbol resolution errors.
58CASAPPLIB := -L$(CASALIB) \
[1455]59 -latnf -lcasa_images -lcasa_ms -lcasa_components -lcasa_coordinates \
60 -lcasa_lattices -lcasa_fits -lcasa_measures -lcasa_measures_f \
61 -lcasa_tables -lcasa_scimath -lcasa_scimath_f -lcasa_casa \
[1603]62 $(WCSLIB) \
[1446]63 $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++
64
65# darwin specific CASA flags
66ifeq "$(CASAARCH)" "darwin"
67 CASAPPLIB += -framework vecLib
68else
69 CASAPPLIB += -llapack -lblas
70endif
71
72# python
73PYVERSION := 2.5
74PYTHONROOT := /usr/lib/casapy
75PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
76PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
77
78# use python universal build
79ifeq "$(CASAARCH)" "darwin"
80 PYVERSION := 2.5
81 PYTHONROOT := /Library/Frameworks/Python.framework/Versions/$(PYVERSION)
82 PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
83 PYTHONLIB := -L$(PYTHONROOT)/lib -framework Python
84endif
85
86# the linker
87LD := $(CXX)
88
89# has to be build with same g++ version as casa
90#BOOSTROOT := /home/casa/boost
91BOOSTROOT := /usr/lib/casapy
92#BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python-gcc34
93BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
94#BOOSTINC := -I$(BOOSTROOT)/include/boost-1_35
95BOOSTINC := -I$(BOOSTROOT)/include/boost
96
97LDFLAGS := -shared -Wl$(TARGET) -s -Xlinker -rpath -Xlinker $(BOOSTROOT)/lib:$(PYTHONROOT)/lib:$(CASALIB)
98ifeq "$(CASAARCH)" "darwin"
99 LDFLAGS := -bundle
100endif
101
102
103# DO NOT MODIFY AFTER THIS
104INCDIRS := -I. $(CASAINC) $(CFITSIOINC) $(BOOSTINC) $(PYTHONINC)
105LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
106
107CCOBJECTS := MathUtils.o \
108 RowAccumulator.o \
109 Logger.o \
110 LineCatalog.o \
111 STAttr.o \
112 STHeader.o \
113 STFiller.o \
114 STMath.o \
115 STSubTable.o \
116 STMolecules.o \
117 STTcal.o \
118 STFocus.o \
119 STWeather.o \
120 STFrequencies.o \
121 STHistory.o \
122 STSelector.o \
123 STLineFinder.o \
124 STFitter.o \
125 STFitEntry.o \
126 STFit.o \
127 STPol.o \
128 STPolLinear.o \
129 STPolCircular.o \
130 STPolStokes.o \
131 STWriter.o \
132 STAsciiWriter.o \
[1603]133 STFITSImageWriter.o \
[1446]134 Scantable.o \
135 Templates.o
136PYOBJECTS := python_Scantable.o \
137 python_STFiller.o \
138 python_STSelector.o \
139 python_STMath.o \
140 python_Fitter.o \
141 python_Logger.o \
142 python_STLineFinder.o \
143 python_STFitEntry.o \
144 python_STWriter.o \
145 python_LineCatalog.o \
146 python_asap.o
147
148OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
149
150HEADERS := MathUtils.h \
151 Logger.h \
152 STAttr.h \
153 STHeader.h \
154 Scantable.h \
155 STFiller.h \
156 STMath.h \
157 RowAccumulator.h \
158 STSubTable.h \
159 STMolecules.h \
160 STTcal.h \
161 STFocus.h \
162 STWeather.h \
163 STHistory.h \
164 STFrequencies.h \
165 STDefs.h \
166 STWriter.h \
167 STSelector.h \
168 STFitter.h \
169 STFit.h \
170 STFitEntry.h \
171 STLineFinder.h \
172 Factory.h \
173 FactoryBase.h \
174 STPol.h \
175 STPolStokes.h \
176 STPolCircular.h \
177 STPolLinear.h \
178 STWriter.h \
[1603]179 STAsciiWriter.h \
180 STFITSImageWriter.h
[1446]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.