source: trunk/src/Makefile @ 73

Last change on this file since 73 was 73, checked in by dkearney, 15 years ago
  1. changes to RpUnits, modified RpUnits::define() function not to look for base units.
  2. changed python RpUnits to return string when units!="off" and a number when units=="off"
  3. modified make files, hopefully making them easier to read, removing vpaths,

cleaning up the make process, combining smaller libraries into one library,
librappture, and putting the core objects into one library - libRpObjects,
for testing.

  1. copied rpResult function into rappture_interface.c to stop compiler from

complaining about undefined references ot the function. trying to use the
function probably won't work. but that can be fixed after the repository is
reorganized.

  1. in example/app-fermi/python/fermi.py, changed exit() to sys.exit() to

stop python from complaining about no function called exit().

  1. examples/app-fermi/fortran still does not run, but new rappture parser

should take care of these problems. (same with examples/fermi_fortran)

File size: 3.8 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# everything below should be ok, but check to make sure
12# especially check the fortran flags, if youre using fortran
13#
14# define the top of our directory structure
15# replace this with the full path of the directory
16# containing the rappture directory
17TOP_DIR         = ../..
18
19# define the top of the rappture directory structure
20RP_BASE   = $(TOP_DIR)/rappture
21
22# define which programs can be made
23PROGS                   =       librappture                             \
24                                        libRpObjects                    \
25
26# define our compiling environment
27#
28CC                              = gcc
29CPP                             = g++
30DEBUG                   = -g -Wall
31DEBUG_PLUS              = -g -DDEBUG
32
33# FORTRAN BINDINGS COMPILER FLAGS
34#
35# available flags
36#
37#       COMPNAME_NOCHANGE               -       No change to the Rappture Library function
38#                                                               name
39#       COMPNAME_UPPERCASE      -       Replace the Rappture Library function name
40#                                                               with an all uppercase version of the name
41#       COMPNAME_ADD1UNDERSCORE -       add 1 underscore to the end of the Rappture
42#                                                               Library function name
43#       COMPNAME_ADD2UNDERSCORE -       add 2 underscores to the end of the Rappture
44#                                                               Library function name
45#
46# when setting CFLAGS, use the following guide for help
47#
48# gnu's g77/f77                 COMPNAME_ADD2UNDERSCORE
49# absoft's f77                  COMPNAME_ADD1UNDERSCORE
50# intel's ifort                 COMPNAME_ADD1UNDERSCORE
51# intel's mpif90                COMPNAME_ADD1UNDERSCORE
52#
53#
54
55CFLAGS                  = -DCOMPNAME_ADD2UNDERSCORE
56
57F77                     = g77
58#F77                            = f77
59#F77                            = ifort
60#F77                            = /opt/mpich-1.2.6/p4-intel/bin/mpif90
61
62LN              = ln
63
64# define our directories
65#
66INCLUDES_DIR    = $(RP_BASE)/include
67BIN_DIR                 = $(RP_BASE)/bin
68LIB_DIR                 = $(RP_BASE)/src
69SRC_DIR                 = $(RP_BASE)/src
70TEST_DIR                = $(RP_BASE)/test
71
72CORE_SRC                = $(SRC_DIR)/core
73FORT_SRC                = $(SRC_DIR)/fortran
74CEE_SRC                 = $(SRC_DIR)/cee
75PY_SRC                  = $(SRC_DIR)/python
76
77LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
78LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
79LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
80
81INCL_CORE               = -I $(INCLUDES_DIR)/core
82INCL_CEE                = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)
83INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
84INCL_PY                 = -I $(INCLUDES_DIR)/python
85
86
87# default:
88
89all: ${PROGS}
90
91# include rappture library definitions
92
93#### librappture shared object ###########################################
94
95librappture: rappture_fortran.o rappture_interface.o RpUnitsCInterface.o RpUnitsStd.o RpUnits.o
96        $(CPP) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
97                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(EMB_PY_FLAGS)
98
99        /sbin/ldconfig -n $(LIB_DIR)
100
101
102#### libRpObjects ########################################################
103libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
104        $(CPP) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
105                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lc
106       
107        /sbin/ldconfig -n $(LIB_DIR)
108
109
110# include core source files
111
112Rp%.o: $(CORE_SRC)/Rp%.cc
113        $(CPP) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
114
115# include cee binding definitions
116
117rappture_interface.o: $(CEE_SRC)/rappture_interface.c
118        $(CPP) -fPIC $(DEBUG) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
119
120RpUnitsCInterface.o: $(CEE_SRC)/RpUnitsCInterface.cc
121        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) -o $@ -c $?
122
123# include fortran binding definitions
124
125RpUnits_fortran.o: $(FORT_SRC)/RpUnits_fortran.c
126        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) -o $@ -c $?
127
128rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c
129        $(CPP) $(CFLAGS) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<
130
131#### CLEAN UP ############################################################
132clean:
133        - rm -f $(BIN_DIR)/* *.o librappture.* libR*.so*
Note: See TracBrowser for help on using the repository browser.