source: trunk/external/libpyrap/Makefile@ 1901

Last change on this file since 1901 was 1900, 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: cd $(ASAPROOT) ; make

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Makefile is updated to link multiarray.so.


File size: 3.0 KB
Line 
1#####
2# Makefile for libpyrap
3#
4# ASSUMPTION:
5# CASA+CASACORE build environment
6# numpy is installed (installing CASA is fine since it contains numpy)
7# boost is installed
8#
9#####
10EXTDIR := $(shell pwd)
11PYRAPROOT := $(EXTDIR)/pyrap-0.3.2/
12PYRAPDIR := $(EXTDIR)/pyrap-0.3.2/pyrap/Converters
13TESTDIR := $(PYRAPDIR)/test
14
15# the casa environment AIPSPATH has to be defined
16CASAROOT := $(word 1, $(CASAPATH))
17CASAARCH := $(word 2, $(CASAPATH))
18
19TARGET := libpyrap.so
20TESTMOD := $(TESTDIR)/_tConvert.so
21INSTDIR := $(CASAROOT)/$(CASAARCH)/lib
22
23# CASACORE
24#COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
25COREINCD := $(CASAROOT)/$(CASAARCH)/include/casacore
26CORELIBD := $(CASAROOT)/$(CASAARCH)/lib
27CORELIB := -L$(CORELIBD) -lcasa_casa
28
29# boost
30BOOSTROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=BOOSTROOT eval_vars) && echo $$BOOSTROOT)
31BOOSTINCD := $(BOOSTROOT)/include
32BOOSTLIBD := $(BOOSTROOT)/lib
33BOOSTLIB := -L$(BOOSTLIBD) -lboost_python
34
35# python
36PYTHONROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONROOT eval_vars) && echo $$PYTHONROOT)
37PYTHONINCD := $(PYTHONROOT)/include/python2.5
38
39# numpy (use numpy in CASA)
40PYTHONLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIBD eval_vars) && echo $$PYTHONLIBD)
41NUMPYROOT := $(PYTHONLIBD)/python2.5/site-packages/numpy
42NUMPYINCD := $(NUMPYROOT)/core/include
43NUMPYLIBD := $(NUMPYROOT)/core
44NUMPYLIB := $(NUMPYLIBD)/multiarray.so
45
46# the compiler
47ifndef CXX
48 CXX := g++
49endif
50
51# the linker
52LD := $(CXX)
53
54# compiler flags
55CXXFLAGS := -fPIC -O3 -g
56CXXFLAGS += -ansi -Wno-long-long -Wall
57CXXOPTS := -DAIPS_64B -DAIPS_USENUMPY
58
59# links to external libraries
60LIBS := $(CORELIB) $(BOOSTLIB) $(NUMPYLIB)
61
62# include directories
63INCDIRS := -I$(COREINCD) -I$(BOOSTINCD) -I$(NUMPYINCD) \
64 -I$(PYRAPROOT) -I$(PYTHONINCD)
65
66# link option
67LDFLAGS := -shared
68
69OBJECTS := $(PYRAPDIR)/PycArray.o \
70 $(PYRAPDIR)/PycArrayNP.o \
71 $(PYRAPDIR)/PycBasicData.o \
72 $(PYRAPDIR)/PycExcp.o \
73 $(PYRAPDIR)/PycRecord.o \
74 $(PYRAPDIR)/PycValueHolder.o #\
75# $(PYRAPDIR)/PycArrayNA.o
76
77HEADERS := $(PYRAPDIR)/PycArrayComCC.h \
78 $(PYRAPDIR)/PycArrayComH.h \
79 $(PYRAPDIR)/PycArray.h \
80 $(PYRAPDIR)/PycArrayNP.h \
81 $(PYRAPDIR)/PycBasicData.h \
82 $(PYRAPDIR)/PycExcp.h \
83 $(PYRAPDIR)/PycRecord.h \
84 $(PYRAPDIR)/PycValueHolder.h #\
85# $(PYRAPDIR)/PycArrayNA.h
86
87TESTSRC := $(TESTDIR)/tConvert.cc
88TESTOBJ := $(TESTDIR)/tConvert.o
89
90all: $(TARGET)
91
92.cc.o:
93 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
94
95$(TARGET): $(OBJECTS)
96 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
97
98$(OBJECTS): $(HEADERS)
99
100clean:
101 rm -f $(OBJECTS) $(TARGET)
102 rm -f $(TESTDIR)/$(TESTMOD) $(TESTDIR)/$(TESTOBJ)
103 rm -f $(INSTDIR)/$(TARGET)
104
105install:
106 cp -f $(TARGET) $(INSTDIR)
107
108test:
109 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $(TESTOBJ) $(TESTSRC)
110 $(LD) $(LDFLAGS) -o $(TESTMOD) $(TESTOBJ) $(LIBS) -L$(INSTDIR) -lpyrap
Note: See TracBrowser for help on using the repository browser.