source: branches/alma/src/Makefile@ 1735

Last change on this file since 1735 was 1704, checked in by Kana Sugimoto, 15 years ago

New Development: No

JIRA Issue: No

Ready to Release: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s):

Description: a small bug fix in a library definition


File size: 6.1 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 Scantable.o \
126 Templates.o
127PYOBJECTS := python_Scantable.o \
128 python_STFiller.o \
129 python_STSelector.o \
130 python_STMath.o \
131 python_Fitter.o \
132 python_Logger.o \
133 python_STLineFinder.o \
134 python_STFitEntry.o \
135 python_STWriter.o \
136 python_LineCatalog.o \
137 python_SrcType.o \
138 python_asap.o
139
140OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
141
142HEADERS := MathUtils.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
176STATICCCLIB := libasap.a
177MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
178
179.SUFFIXES: .c .o .cpp .cc .cxx .C
180
181.cpp.o:
182 -@ echo
183 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
184
185.cc.o:
186 -@ echo
187 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
188
189.cxx.o:
190 -@ echo
191 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
192
193.C.o:
194 -@ echo
195 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
196
197
198.PHONY : all clean objects realclean relink
199
200all : $(TARGET)
201
202relink : cleanso $(TARGET)
203
204objects : $(OBJECTS)
205
206$(TARGET) : $(OBJECTS)
207 -@ echo
208 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
209
210$(OBJECTS) : $(HEADERS)
211
212staticlib: $(MEMBERS)
213
214clean :
215 -rm -f $(OBJECTS)
216
217cleanso :
218 -rm -f $(TARGET)
219
220realclean : clean cleanso
221
222test: objects tasap2.o
223 -@ echo
224 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.