source: trunk/src/Makefile @ 83

Last change on this file since 83 was 83, checked in by dkearney, 17 years ago
  1. More cleaning of RpUnits and RpLibrary? code
  2. added rp_result code to c++/fortran/c code
  3. added rp_children, rp_lib_node[comp,type,id] for fortran code (need to test)
  4. adjusted convert function to recognize statements as follows:

convert("5J","neV")
convert("3.12075e+28neV","J")

  1. made joules a metric unit in RpUnits.cc
  2. tested examples/app-fermi/fortran/fermi.f with new rappture library.

added units conversion.

File size: 6.0 KB
Line 
1# you need to change this to where your version of python is installed.
2# tell make where to find python header files
3PY_SRC_HEADERS  = /opt/rappture/include/python2.4
4
5# tell make where to find the python shared library
6EMB_PY_LIB_FLAG = -lpython2.4
7EMB_PY_LIB_DIR  = /opt/rappture/lib
8
9EMB_PY_FLAGS    = -Wl,-rpath,$(EMB_PY_LIB_DIR) -L$(EMB_PY_LIB_DIR) $(EMB_PY_LIB_FLAG)
10
11
12# tell make where to find the libscew sources
13SCEW_HEADERS    = /opt/rappture/include/scew
14LIB_SCEW_INCL   = -I $(SCEW_HEADERS)
15LIB_SCEW_FLAG   = -L/opt/rappture/lib -lscew
16#LIB_SCEW_FLAG  = /opt/rappture/lib/libscew.a
17#LIB_SCEW_FLAG  = -static -L/opt/rappture/lib -lscew
18
19
20# everything below should be ok, but check to make sure
21# especially check the fortran flags, if youre using fortran
22#
23# define the top of our directory structure
24# replace this with the full path of the directory
25# containing the rappture directory
26TOP_DIR         = ../..
27
28# define the top of the rappture directory structure
29RP_BASE   = $(TOP_DIR)/rappture
30
31# define which programs can be made
32PROGS                   =       librappture                             \
33                                        libRpObjects                    \
34                                        librappture_test
35
36# define our compiling environment
37#
38CC                              = gcc
39CXX                             = g++
40DEBUG                   = -g -Wall
41DEBUG_PLUS              = -g -DDEBUG
42
43# FORTRAN BINDINGS COMPILER FLAGS
44#
45# available flags
46#
47#       COMPNAME_NOCHANGE               -       No change to the Rappture Library function
48#                                                               name
49#       COMPNAME_UPPERCASE      -       Replace the Rappture Library function name
50#                                                               with an all uppercase version of the name
51#       COMPNAME_ADD1UNDERSCORE -       add 1 underscore to the end of the Rappture
52#                                                               Library function name
53#       COMPNAME_ADD2UNDERSCORE -       add 2 underscores to the end of the Rappture
54#                                                               Library function name
55#
56# when setting CFLAGS, use the following guide for help
57#
58# gnu's g77/f77                 COMPNAME_ADD2UNDERSCORE
59# absoft's f77                  COMPNAME_ADD1UNDERSCORE
60# intel's ifort                 COMPNAME_ADD1UNDERSCORE
61# intel's mpif90                COMPNAME_ADD1UNDERSCORE
62#
63#
64
65CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
66
67F77                     = g77
68#F77                            = f77
69#F77                            = ifort
70#F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
71
72LN              = ln
73
74# define our directories
75#
76INCLUDES_DIR    = $(RP_BASE)/include
77BIN_DIR                 = $(RP_BASE)/bin
78LIB_DIR                 = $(RP_BASE)/src
79SRC_DIR                 = $(RP_BASE)/src
80TEST_DIR                = $(RP_BASE)/test
81
82CORE_SRC                = $(SRC_DIR)/core
83FORT_SRC                = $(SRC_DIR)/fortran
84CEE_SRC                 = $(SRC_DIR)/cee
85PY_SRC                  = $(SRC_DIR)/python
86
87LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
88LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
89LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
90LIB_RAPPTURE_T  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test
91
92INCL_CORE               = -I $(INCLUDES_DIR)/core
93INCL_CEE                = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)
94INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
95INCL_PY                 = -I $(INCLUDES_DIR)/python
96
97
98# default:
99
100all: ${PROGS}
101
102RP_IO_DEPS              = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o scew_extras.o
103RP_UNITS_DEPS   = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
104RP_OTHER_DEPS   = RpFortranCommon.o
105
106# include rappture library definitions
107
108#### librappture shared object ###########################################
109
110librappture: rappture_fortran.o rappture_interface.o RpUnitsCInterface.o RpUnitsFInterface.o RpFortranCommon.o RpUnitsStd.o RpUnits.o
111        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
112                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS)
113
114        /sbin/ldconfig -n $(LIB_DIR)
115
116librappture_test: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
117        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
118                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG)
119
120        /sbin/ldconfig -n $(LIB_DIR)
121
122#### libRpObjects ########################################################
123libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
124        $(CC) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
125                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++
126#       $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
127#               -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^
128       
129        /sbin/ldconfig -n $(LIB_DIR)
130
131
132# include core source files
133
134RpLibrary.o: $(CORE_SRC)/RpLibrary.cc
135        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $?
136
137scew_extras.o: $(CORE_SRC)/scew_extras.c
138        $(CC) -fPIC $(DEBUG) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ -c $?
139
140RpVariable.o: $(CORE_SRC)/RpVariable.cc
141        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
142
143RpAbout.o: $(CORE_SRC)/RpAbout.cc
144        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
145
146RpNumber.o: $(CORE_SRC)/RpNumber.cc
147        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
148
149RpString.o: $(CORE_SRC)/RpString.cc
150        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
151
152RpBoolean.o: $(CORE_SRC)/RpBoolean.cc
153        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
154
155RpChoice.o: $(CORE_SRC)/RpChoice.cc
156        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
157
158RpOption.o: $(CORE_SRC)/RpOption.cc
159        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
160
161RpUnitsStd.o: $(CORE_SRC)/RpUnitsStd.cc
162        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
163
164RpUnits.o: $(CORE_SRC)/RpUnits.cc
165        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
166
167
168
169
170# include cee binding definitions
171
172rappture_interface.o: $(CEE_SRC)/rappture_interface.c
173        $(CXX) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
174
175RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
176        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $?
177
178RpLibraryCInterface.o: $(CEE_SRC)/RpLibraryCInterface.cc
179        $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(LIB_SCEW_INCL) -o $@ -c $?
180
181
182
183
184# include fortran binding definitions
185
186rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
187        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
188
189RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc
190        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $?
191
192RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c
193        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
194
195RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc
196        $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(LIB_SCEW_INCL) -o $@ -c $?
197
198
199
200
201#### CLEAN UP ############################################################
202clean:
203        - rm -f *.o librappture*.so* libRp*.so*
Note: See TracBrowser for help on using the repository browser.