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
RevLine 
[1891]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)
[1892]11PYRAPROOT := $(EXTDIR)/pyrap-0.3.2/
[1891]12PYRAPDIR := $(EXTDIR)/pyrap-0.3.2/pyrap/Converters
[1895]13TESTDIR := $(PYRAPDIR)/test
[1891]14
15# the casa environment AIPSPATH has to be defined
16CASAROOT := $(word 1, $(CASAPATH))
17CASAARCH := $(word 2, $(CASAPATH))
18
[1892]19TARGET := libpyrap.so
[1895]20TESTMOD := $(TESTDIR)/_tConvert.so
[1892]21INSTDIR := $(CASAROOT)/$(CASAARCH)/lib
[1891]22
23# CASACORE
[1892]24#COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
[1891]25COREINCD := $(CASAROOT)/$(CASAARCH)/include/casacore
26CORELIBD := $(CASAROOT)/$(CASAARCH)/lib
[1892]27CORELIB := -L$(CORELIBD) -lcasa_casa
[1891]28
[1892]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
[1891]34
[1892]35# python
36PYTHONROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONROOT eval_vars) && echo $$PYTHONROOT)
37PYTHONINCD := $(PYTHONROOT)/include/python2.5
[1891]38
[1899]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
[1900]43NUMPYLIBD := $(NUMPYROOT)/core
44NUMPYLIB := $(NUMPYLIBD)/multiarray.so
[1899]45
[1892]46# the compiler
47ifndef CXX
48 CXX := g++
49endif
[1891]50
[1892]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
[1900]60LIBS := $(CORELIB) $(BOOSTLIB) $(NUMPYLIB)
[1892]61
62# include directories
63INCDIRS := -I$(COREINCD) -I$(BOOSTINCD) -I$(NUMPYINCD) \
64 -I$(PYRAPROOT) -I$(PYTHONINCD)
65
66# link option
67LDFLAGS := -shared
68
[1891]69OBJECTS := $(PYRAPDIR)/PycArray.o \
70 $(PYRAPDIR)/PycArrayNP.o \
71 $(PYRAPDIR)/PycBasicData.o \
[1892]72 $(PYRAPDIR)/PycExcp.o \
[1891]73 $(PYRAPDIR)/PycRecord.o \
74 $(PYRAPDIR)/PycValueHolder.o #\
75# $(PYRAPDIR)/PycArrayNA.o
76
[1892]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
[1895]87TESTSRC := $(TESTDIR)/tConvert.cc
88TESTOBJ := $(TESTDIR)/tConvert.o
89
[1892]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:
[1899]101 rm -f $(OBJECTS) $(TARGET)
102 rm -f $(TESTDIR)/$(TESTMOD) $(TESTDIR)/$(TESTOBJ)
103 rm -f $(INSTDIR)/$(TARGET)
[1892]104
105install:
[1895]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.