- Timestamp:
- Oct 5, 2005, 1:21:24 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/app-fermi/fortran/Makefile
r83 r84 5 5 6 6 # no need to edit the rest... 7 PROGS = fermi 8 9 CFLAGS = -DCOMPNAME_ADD2UNDERSCORE 7 PROGS = fermi 10 8 11 9 #F77 = ifort … … 14 12 15 13 LIB_DIR = $(RAPPTURE_DIR)/lib 16 LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test14 LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture 17 15 18 16 all: $(PROGS) … … 22 20 23 21 clean: 24 rm -f *.o $(PROGS) 22 rm -f *.o $(PROGS) run*.xml -
trunk/include/fortran/RpLibraryFInterface.h
r83 r84 15 15 #include <fstream> 16 16 #include "RpFortranCommon.h" 17 #include "RpLibraryFStubs.h" 17 18 18 /* 19 // rappture-fortran api 20 */ 21 22 #ifdef __cplusplus 19 #ifdef __cplusplus 23 20 extern "C" { 24 21 #endif 25 26 #ifdef COMPNAME_ADD1UNDERSCORE27 # define rp_init rp_init_28 # define rp_lib rp_lib_29 # define rp_lib_element_comp rp_lib_element_comp_30 # define rp_lib_element_id rp_lib_element_id_31 # define rp_lib_element_type rp_lib_element_type_32 # define rp_lib_element_obj rp_lib_element_obj_33 # define rp_lib_child_num rp_lib_child_num_34 # define rp_lib_child_comp rp_lib_child_comp_35 # define rp_lib_child_id rp_lib_child_id_36 # define rp_lib_child_type rp_lib_child_type_37 # define rp_lib_child_obj rp_lib_child_obj_38 # define rp_lib_get rp_lib_get_39 # define rp_lib_get_double rp_lib_get_double_40 # define rp_lib_put_str rp_lib_put_str_41 # define rp_lib_put_id_str rp_lib_put_id_str_42 # define rp_lib_put_obj rp_lib_put_obj_43 # define rp_lib_put_id_obj rp_lib_put_id_obj_44 # define rp_lib_remove rp_lib_remove_45 # define rp_lib_xml_len rp_lib_xml_len_46 # define rp_lib_write_xml rp_lib_write_xml_47 # define rp_lib_xml rp_lib_xml_48 # define rp_lib_node_comp rp_lib_node_comp_49 # define rp_lib_node_type rp_lib_node_type_50 # define rp_lib_node_id rp_lib_node_id_51 # define rp_result rp_result_52 # define rp_quit rp_quit_53 #elif defined(COMPNAME_ADD2UNDERSCORE)54 # define rp_init rp_init__55 # define rp_lib rp_lib__56 # define rp_lib_element_comp rp_lib_element_comp__57 # define rp_lib_element_id rp_lib_element_id__58 # define rp_lib_element_type rp_lib_element_type__59 # define rp_lib_element_obj rp_lib_element_obj__60 # define rp_lib_child_num rp_lib_child_num__61 # define rp_lib_child_comp rp_lib_child_comp__62 # define rp_lib_child_id rp_lib_child_id__63 # define rp_lib_child_type rp_lib_child_type__64 # define rp_lib_child_obj rp_lib_child_obj__65 # define rp_lib_get rp_lib_get__66 # define rp_lib_get_double rp_lib_get_double__67 # define rp_lib_put_str rp_lib_put_str__68 # define rp_lib_put_id_str rp_lib_put_id_str__69 # define rp_lib_put_obj rp_lib_put_obj__70 # define rp_lib_put_id_obj rp_lib_put_id_obj__71 # define rp_lib_remove rp_lib_remove__72 # define rp_lib_xml_len rp_lib_xml_len__73 # define rp_lib_write_xml rp_lib_write_xml__74 # define rp_lib_xml rp_lib_xml__75 # define rp_lib_node_comp rp_lib_node_comp__76 # define rp_lib_node_type rp_lib_node_type__77 # define rp_lib_node_id rp_lib_node_id__78 # define rp_result rp_result__79 # define rp_quit rp_quit__80 #elif defined(COMPNAME_NOCHANGE)81 # define rp_init rp_init82 # define rp_lib rp_lib83 # define rp_lib_element_comp rp_lib_element_comp84 # define rp_lib_element_id rp_lib_element_id85 # define rp_lib_element_type rp_lib_element_type86 # define rp_lib_element_obj rp_lib_element_obj87 # define rp_lib_child_num rp_lib_child_num88 # define rp_lib_child_comp rp_lib_child_comp89 # define rp_lib_child_id rp_lib_child_id90 # define rp_lib_child_type rp_lib_child_type91 # define rp_lib_child_obj rp_lib_child_obj92 # define rp_lib_get rp_lib_get93 # define rp_lib_get_double rp_lib_get_double94 # define rp_lib_put_str rp_lib_put_str95 # define rp_lib_put_id_str rp_lib_put_id_str96 # define rp_lib_put_obj rp_lib_put_obj97 # define rp_lib_put_id_obj rp_lib_put_id_obj98 # define rp_lib_remove rp_lib_remove99 # define rp_lib_xml_len rp_lib_xml_len100 # define rp_lib_write_xml rp_lib_write_xml101 # define rp_lib_xml rp_lib_xml102 # define rp_lib_node_comp rp_lib_node_comp103 # define rp_lib_node_type rp_lib_node_type104 # define rp_lib_node_id rp_lib_node_id105 # define rp_result rp_result106 # define rp_quit rp_quit107 #elif defined(COMPNAME_UPPERCASE)108 # define rp_init RP_INIT109 # define rp_lib RP_LIB110 # define rp_lib_element_comp RP_LIB_ELEMENT_COMP111 # define rp_lib_element_id RP_LIB_ELEMENT_ID112 # define rp_lib_element_type RP_LIB_ELEMENT_TYPE113 # define rp_lib_element_obj RP_LIB_ELEMENT_OBJ114 # define rp_lib_child_num RP_LIB_CHILD_NUM115 # define rp_lib_child_comp RP_LIB_CHILD_COMP116 # define rp_lib_child_id RP_LIB_CHILD_ID117 # define rp_lib_child_type RP_LIB_CHILD_TYPE118 # define rp_lib_child_obj RP_LIB_CHILD_OBJ119 # define rp_lib_get RP_LIB_GET120 # define rp_lib_get_double RP_LIB_GET_DOUBLE121 # define rp_lib_put_str RP_LIB_PUT_STR122 # define rp_lib_put_id_str RP_LIB_PUT_ID_STR123 # define rp_lib_put_obj RP_LIB_PUT_OBJ124 # define rp_lib_put_id_obj RP_LIB_PUT_ID_OBJ125 # define rp_lib_remove RP_LIB_REMOVE126 # define rp_lib_xml_len RP_LIB_XML_LEN127 # define rp_lib_write_xml RP_LIB_WRITE_XML128 # define rp_lib_xml RP_LIB_XML129 # define rp_lib_node_comp RP_LIB_NODE_COMP130 # define rp_lib_node_type RP_LIB_NODE_TYPE131 # define rp_lib_node_id RP_LIB_NODE_ID132 # define rp_result RP_RESULT133 # define rp_quit RP_QUIT134 #endif135 136 137 void rp_init();138 22 139 23 int rp_lib ( const char* filePath, int filePath_len ); … … 161 45 int path_len ); 162 46 47 /* 48 * rp_lib_child_num still needs to be written 49 * keep function declaration around 163 50 int rp_lib_child_num ( int* handle, 164 51 char* path, 165 52 int* childHandle, 166 53 int path_len); 54 */ 167 55 168 56 int rp_lib_children ( int* handle, /* integer handle of library */ … … 173 61 174 62 175 void rp_lib_get ( int* handle, 63 void rp_lib_get ( int* handle, 176 64 char* path, 177 65 char* retText, … … 179 67 int retText_len ); 180 68 181 double rp_lib_get_double ( int* handle, 69 double rp_lib_get_double ( int* handle, 182 70 char* path, 183 71 int path_len); 184 72 185 void rp_lib_put_str ( int* handle, 186 char* path, 187 char* value, 73 void rp_lib_put_str ( int* handle, 74 char* path, 75 char* value, 188 76 int* append, 189 77 int path_len, 190 int value_len ); 78 int value_len ); 191 79 192 void rp_lib_put_id_str ( int* handle, 193 char* path, 194 char* value, 195 char* id, 80 void rp_lib_put_id_str ( int* handle, 81 char* path, 82 char* value, 83 char* id, 196 84 int* append, 197 85 int path_len, 198 86 int value_len, 199 int id_len ); 87 int id_len ); 200 88 201 void rp_lib_put_obj ( int* handle, 202 char* path, 203 int* valHandle, 89 /* 90 * rp_lib_put_obj still needs to be written 91 * keep function declaration around 92 void rp_lib_put_obj ( int* handle, 93 char* path, 94 int* valHandle, 204 95 int* append, 205 int path_len ); 96 int path_len ); 97 */ 206 98 207 void rp_lib_put_id_obj ( int* handle, 208 char* path, 209 int* valHandle, 210 char* id, 99 /* 100 * rp_lib_put_id_obj still needs to be written 101 * keep function declaration around 102 void rp_lib_put_id_obj ( int* handle, 103 char* path, 104 int* valHandle, 105 char* id, 211 106 int* append, 212 107 int path_len, 213 int id_len ); 108 int id_len ); 109 */ 214 110 111 /* 112 * rp_lib_remove still needs to be written 113 * keep function declaration around 215 114 int rp_lib_remove ( int* handle, 216 115 char* path, 217 116 int path_len); 117 */ 218 118 119 /* 120 * rp_lib_xml_len still needs to be written 121 * keep function declaration around 219 122 int rp_lib_xml_len( int* handle); 123 */ 220 124 221 125 void rp_lib_xml( int* handle, … … 255 159 256 160 // global vars 257 // dictionary to hold the python objects that 161 // dictionary to hold the python objects that 258 162 // cannot be sent to fortran 259 163 … … 261 165 RpDict DICT_TEMPLATE fortObjDict_Lib; 262 166 263 #ifdef __cplusplus 167 #ifdef __cplusplus 264 168 } 265 169 #endif -
trunk/include/fortran/RpUnitsFInterface.h
r83 r84 10 10 */ 11 11 12 #include "RpFortranCommon.h"13 14 12 #ifndef _RpUNITS_F_H 15 13 #define _RpUNITS_F_H 16 14 17 #ifdef COMPNAME_ADD1UNDERSCORE 18 # define rp_define_unit rp_define_unit_ 19 # define rp_find rp_find_ 20 # define rp_make_metric rp_make_metric_ 21 # define rp_get_units rp_get_units_ 22 # define rp_get_units_name rp_get_units_name_ 23 # define rp_get_exponent rp_get_exponent_ 24 # define rp_get_basis rp_get_basis_ 25 # define rp_units_convert_dbl rp_units_convert_dbl_ 26 # define rp_units_convert_str rp_units_convert_str_ 27 # define rp_units_add_presets rp_units_add_presets_ 28 #elif defined(COMPNAME_ADD2UNDERSCORE) 29 # define rp_define_unit rp_define_unit__ 30 # define rp_find rp_find__ 31 # define rp_make_metric rp_make_metric__ 32 # define rp_get_units rp_get_units__ 33 # define rp_get_units_name rp_get_units_name__ 34 # define rp_get_exponent rp_get_exponent__ 35 # define rp_get_basis rp_get_basis__ 36 # define rp_units_convert_dbl rp_units_convert_dbl__ 37 # define rp_units_convert_str rp_units_convert_str__ 38 # define rp_units_add_presets rp_units_add_presets__ 39 #elif defined(COMPNAME_NOCHANGE) 40 # define rp_define_unit rp_define_unit 41 # define rp_find rp_find 42 # define rp_make_metric rp_make_metric 43 # define rp_get_units rp_get_units 44 # define rp_get_units_name rp_get_units_name 45 # define rp_get_exponent rp_get_exponent 46 # define rp_get_basis rp_get_basis 47 # define rp_units_convert_dbl rp_units_convert_dbl 48 # define rp_units_convert_str rp_units_convert_str 49 # define rp_units_add_presets rp_units_add_presets 50 #elif defined(COMPNAME_UPPERCASE) 51 # define rp_define_unit RP_DEFINE_UNIT 52 # define rp_find RP_FIND 53 # define rp_make_metric RP_MAKE_METRIC 54 # define rp_get_units RP_GET_UNITS 55 # define rp_get_units_name RP_GET_UNITS_NAME 56 # define rp_get_exponent RP_GET_EXPONENT 57 # define rp_get_basis RP_GET_BASIS 58 # define rp_units_convert_dbl RP_UNITS_CONVERT_DBL 59 # define rp_units_convert_str RP_UNITS_CONVERT_STR 60 # define rp_units_add_presets RP_UNITS_ADD_PRESETS 61 #endif 15 #include "RpFortranCommon.h" 16 #include "RpUnitsFStubs.h" 62 17 63 #ifdef __cplusplus 18 #ifdef __cplusplus 64 19 extern "C" { 65 20 #endif … … 75 30 int rp_get_units_name(int* unitRefVal, char* retText, int retText_len); 76 31 77 int rp_get_exponent(int* unitRefVal, double retExponent);32 int rp_get_exponent(int* unitRefVal, double* retExponent); 78 33 79 34 int rp_get_basis(int* unitRefVal); 80 35 81 int rp_units_convert_dbl ( char* fromVal, 82 char* toUnitsName, 83 double* convResult, 84 int fromVal_len, 36 int rp_units_convert_dbl ( char* fromVal, 37 char* toUnitsName, 38 double* convResult, 39 int fromVal_len, 85 40 int toUnitsName_len ); 86 41 87 int rp_units_convert_str ( char* fromVal, 88 char* toUnitsName, 89 char* retText, 90 int fromVal_len, 42 int rp_units_convert_str ( char* fromVal, 43 char* toUnitsName, 44 char* retText, 45 int fromVal_len, 91 46 int toUnitsName_len, 92 int retText_len ); 47 int retText_len ); 93 48 94 49 int rp_units_add_presets ( char* presetName, int presetName_len); 95 50 96 #ifdef __cplusplus 51 #ifdef __cplusplus 97 52 } 98 53 #endif 99 54 100 55 #endif -
trunk/src/Makefile
r83 r84 1 1 # you need to change this to where your version of python is installed. 2 2 # tell make where to find python header files 3 PY_SRC_HEADERS = /opt/rappture/include/python2.4 4 5 # tell make where to find the python shared library 6 EMB_PY_LIB_FLAG = -lpython2.4 7 EMB_PY_LIB_DIR = /opt/rappture/lib 8 9 EMB_PY_FLAGS = -Wl,-rpath,$(EMB_PY_LIB_DIR) -L$(EMB_PY_LIB_DIR) $(EMB_PY_LIB_FLAG) 10 3 RP_INSTALL_BASE = /opt/rappture 11 4 12 5 # tell make where to find the libscew sources 13 SCEW_HEADERS 14 LIB_SCEW_INCL 15 LIB_SCEW_FLAG 16 #LIB_SCEW_FLAG 17 #LIB_SCEW_FLAG 6 SCEW_HEADERS = /opt/rappture/include/scew 7 LIB_SCEW_INCL = -I $(SCEW_HEADERS) 8 LIB_SCEW_FLAG = -L/opt/rappture/lib -lscew 9 #LIB_SCEW_FLAG = /opt/rappture/lib/libscew.a 10 #LIB_SCEW_FLAG = -static -L/opt/rappture/lib -lscew 18 11 19 12 20 13 # everything below should be ok, but check to make sure 21 # especially check the fortran flags, if youre using fortran22 14 # 23 15 # define the top of our directory structure … … 27 19 28 20 # define the top of the rappture directory structure 29 RP_BASE = $(TOP_DIR)/rappture21 RP_BASE = $(TOP_DIR)/rappture 30 22 31 23 # define which programs can be made 32 PROGS = librappture\33 libRpObjects\34 librappture_test 24 PROGS = librappture \ 25 libRpObjects \ 26 Rappture.Units 35 27 36 28 # define our compiling environment 37 29 # 38 CC = gcc 39 CXX = g++ 40 DEBUG = -g -Wall 41 DEBUG_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 65 CFLAGS = -DCOMPNAME_ADD2UNDERSCORE 66 67 F77 = g77 68 #F77 = f77 69 #F77 = ifort 70 #F77 = /opt/mpich-1.2.6/p4-intel/bin/mpif90 30 CC = gcc 31 CXX = g++ 32 DEBUG = -g -Wall 33 DEBUG_PLUS = -g -DDEBUG 34 PY = python 71 35 72 36 LN = ln … … 74 38 # define our directories 75 39 # 76 INCLUDES_DIR 77 BIN_DIR 78 LIB_DIR 79 SRC_DIR 80 TEST_DIR 40 INCLUDES_DIR = $(RP_BASE)/include 41 BIN_DIR = $(RP_BASE)/bin 42 LIB_DIR = $(RP_BASE)/src 43 SRC_DIR = $(RP_BASE)/src 44 TEST_DIR = $(RP_BASE)/test 81 45 82 CORE_SRC 83 FORT_SRC 84 CEE_SRC 85 PY_SRC 46 CORE_SRC = $(SRC_DIR)/core 47 FORT_SRC = $(SRC_DIR)/fortran 48 CEE_SRC = $(SRC_DIR)/cee 49 PY_SRC = $(SRC_DIR)/python 86 50 87 LIB_INC_PREFIX 51 LIB_INC_PREFIX = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) 88 52 LIB_RP_OBJECTS = $(LIB_INC_PREFIX) -lRpObjects 89 LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture 90 LIB_RAPPTURE_T = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test 53 LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture 91 54 92 INCL_CORE 93 INCL_CEE = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)94 INCL_FORTRAN 95 INCL_PY 55 INCL_CORE = -I $(INCLUDES_DIR)/core 56 INCL_CEE = -I $(INCLUDES_DIR)/cee 57 INCL_FORTRAN = -I $(INCLUDES_DIR)/fortran 58 INCL_PY = -I $(INCLUDES_DIR)/python 96 59 97 60 98 # default: 61 # default: 99 62 100 63 all: ${PROGS} 64 install: all install_py install_rappture install_rpobjs 101 65 102 RP_IO_DEPS = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o scew_extras.o 103 RP_UNITS_DEPS = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o 104 RP_OTHER_DEPS = RpFortranCommon.o 66 RP_IO_DEPS = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \ 67 scew_extras.o 68 RP_UNITS_DEPS = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o 69 RP_OTHER_DEPS = RpFortranCommon.o 70 RP_OBJS_DEP = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \ 71 RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o 105 72 106 73 # include rappture library definitions … … 108 75 #### librappture shared object ########################################### 109 76 110 librappture: 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 116 librappture_test: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS) 77 librappture: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS) 117 78 $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ 118 79 -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG) … … 120 81 /sbin/ldconfig -n $(LIB_DIR) 121 82 83 install_rappture: librappture 84 cp -d $<.so* $(RP_INSTALL_BASE)/lib 85 122 86 #### libRpObjects ######################################################## 123 libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o87 libRpObjects: $(RP_OBJS_DEP) 124 88 $(CC) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \ 125 89 -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++ … … 128 92 129 93 /sbin/ldconfig -n $(LIB_DIR) 94 95 install_rpobjs: libRpObjects 96 cp -d $<.so* $(RP_INSTALL_BASE)/lib 97 98 #### Python ######################################################## 99 Rappture.Units: RpUnits.o RpUnitsStd.o 100 $(PY) $(PY_SRC)/setup.py build 101 102 install_py: RpUnits.o RpUnitsStd.o 103 $(PY) $(PY_SRC)/setup.py install 104 130 105 131 106 … … 185 160 186 161 rappture_fortran.o: $(FORT_SRC)/rappture_fortran.c 187 $(CXX) $(CFLAGS)-fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $<162 $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) $(INCL_CORE) $(INCL_CEE) $(INCL_PY) -o $@ -c $< 188 163 189 164 RpUnitsFInterface.o: $(FORT_SRC)/RpUnitsFInterface.cc 190 $(CXX) $(CFLAGS)-fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $?165 $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) -o $@ -c $? 191 166 192 167 RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c 193 $(CXX) $(CFLAGS)-fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<168 $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $< 194 169 195 170 RpLibraryFInterface.o: $(FORT_SRC)/RpLibraryFInterface.cc 196 $(CXX) $(CFLAGS)-fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(LIB_SCEW_INCL) -o $@ -c $?171 $(CXX) -fPIC $(DEBUG) $(INCL_CORE) $(INCL_FORTRAN) $(LIB_SCEW_INCL) -o $@ -c $? 197 172 198 173 … … 201 176 #### CLEAN UP ############################################################ 202 177 clean: 203 - rm -f *.o librappture*.so* libRp*.so* 178 - rm -f *.o librappture.so* libRp*.so* 179 - rm -rf build -
trunk/src/fortran/RpLibraryFInterface.cc
r83 r84 11 11 12 12 #include "RpLibraryFInterface.h" 13 #include "RpLibraryFStubs.c" 13 14 14 15 int rp_lib(const char* filePath, int filePath_len) -
trunk/src/fortran/RpUnitsFInterface.cc
r83 r84 14 14 #include "string.h" 15 15 #include "RpUnitsFInterface.h" 16 #include "RpUnitsFStubs.c" 16 17 17 18 #define DICT_TEMPLATE <int,std::string> … … 21 22 RpUnits* getObject_UnitsInt(int objKey); 22 23 23 int rp_define_unit( char* unitName, 24 int* basisName, 24 int 25 rp_define_unit( char* unitName, 26 int* basisName, 25 27 int unitName_len ) { 26 28 … … 44 46 // newUnit = RpUnits::define(unitName, basis); 45 47 newUnit = RpUnits::define(inText, basis); 46 48 47 49 if (newUnit) { 48 50 result = storeObject_UnitsStr(newUnit->getUnitsName()); … … 57 59 58 60 59 int rp_find(char* searchName, int searchName_len) 61 int 62 rp_find(char* searchName, int searchName_len) 60 63 { 61 64 … … 79 82 } 80 83 81 int rp_make_metric(int* basis) 84 int 85 rp_make_metric(int* basis) 82 86 { 83 87 int result = -1; … … 95 99 } 96 100 97 int rp_get_units(int* unitRefVal, char* retText, int retText_len) 101 int 102 rp_get_units(int* unitRefVal, char* retText, int retText_len) 98 103 { 99 104 RpUnits* unitObj = NULL; … … 112 117 } 113 118 114 int rp_get_units_name(int* unitRefVal, char* retText, int retText_len) 119 int 120 rp_get_units_name(int* unitRefVal, char* retText, int retText_len) 115 121 { 116 122 RpUnits* unitObj = NULL; … … 125 131 } 126 132 } 127 128 return result; 129 } 130 131 int rp_get_exponent(int* unitRefVal, double* retExponent) 133 134 return result; 135 } 136 137 int 138 rp_get_exponent(int* unitRefVal, double* retExponent) 132 139 { 133 140 RpUnits* unitObj = NULL; … … 144 151 } 145 152 146 int rp_get_basis(int* unitRefVal) 153 int 154 rp_get_basis(int* unitRefVal) 147 155 { 148 156 RpUnits* unitObj = NULL; … … 155 163 if (unitObj) { 156 164 basisObj = unitObj->getBasis(); 157 165 158 166 if (basisObj) { 159 167 result = storeObject_UnitsStr(basisObj->getUnitsName()); … … 165 173 } 166 174 167 int rp_units_convert_dbl ( char* fromVal, 168 char* toUnitsName, 169 double* convResult, 170 int fromVal_len, 175 int 176 rp_units_convert_dbl ( char* fromVal, 177 char* toUnitsName, 178 double* convResult, 179 int fromVal_len, 171 180 int toUnitsName_len ) { 172 181 … … 204 213 } 205 214 206 int rp_units_convert_str ( char* fromVal, 207 char* toUnitsName, 208 char* retText, 209 int fromVal_len, 215 int 216 rp_units_convert_str ( char* fromVal, 217 char* toUnitsName, 218 char* retText, 219 int fromVal_len, 210 220 int toUnitsName_len, 211 221 int retText_len ) { … … 247 257 } 248 258 249 int rp_units_add_presets ( char* presetName, int presetName_len) { 250 259 int 260 rp_units_add_presets ( char* presetName, int presetName_len) { 261 251 262 char* inPresetName = NULL; 252 263 int result = -1; 253 264 254 265 inPresetName = null_terminate(presetName,presetName_len); 255 266 … … 270 281 271 282 272 int storeObject_UnitsStr(std::string objectName) { 283 int 284 storeObject_UnitsStr(std::string objectName) { 273 285 274 286 int retVal = -1; … … 280 292 // no error checking to make sure it was successful in entering 281 293 // the new entry. 282 fortObjDictUnits.set(dictNextKey,objectName, &newEntry); 283 } 284 294 fortObjDictUnits.set(dictNextKey,objectName, &newEntry); 295 } 296 285 297 retVal = dictNextKey; 286 298 return retVal; 287 299 } 288 300 289 RpUnits* getObject_UnitsInt(int objKey) { 301 RpUnits* 302 getObject_UnitsInt(int objKey) { 290 303 291 304 std::string basisName = *(fortObjDictUnits.find(objKey).getValue()); -
trunk/src/python/setup.py
r71 r84 1 1 from distutils.core import setup, Extension 2 2 3 # need to write an if statement to check to see if the libRpUnits exists4 # if lib exists, then use the lib to compile against.5 # else compile everything from source.6 #7 #module = Extension('RpUnits',8 # include_dirs = [ '/usr/local/include',9 # '../../include/cee',10 # '../../include/core'],11 # libraries = ['RpUnits'],12 # library_dirs = ['../lib'],13 # sources = [ 'PyRpUnits.cc' ])14 15 3 module = Extension('Rappture.Units', 16 include_dirs = [ '../ ../include/cee',17 '../ ../include/core'],18 sources = [ ' ../core/RpUnitsStd.cc',19 ' ../core/RpUnits.cc',20 ' PyRpUnits.cc' ])4 include_dirs = [ '../include/cee', 5 '../include/core'], 6 sources = [ 'core/RpUnitsStd.cc', 7 'core/RpUnits.cc', 8 'python/PyRpUnits.cc' ]) 21 9 22 10 setup(name="Rappture.Units", -
trunk/test/Makefile
r83 r84 25 25 RpUnitsF_test \ 26 26 RpLibrary_test \ 27 RpLibraryC_test 27 RpLibraryC_test \ 28 RpLibraryF_test 28 29 29 30 # define our compiling environment … … 34 35 DEBUG_PLUS = -g -DDEBUG 35 36 36 # FORTRAN BINDINGS COMPILER FLAGS 37 # 38 # available flags 39 # 40 # COMPNAME_NOCHANGE No change to the Rappture Library function 41 # name 42 # COMPNAME_UPPERCASE Replace the Rappture Library function name 43 # with an all uppercase version of the name 44 # COMPNAME_ADD1UNDERSCORE Add 1 underscore to the end of the Rappture 45 # Library function name 46 # COMPNAME_ADD2UNDERSCORE Add 2 underscores to the end of the Rappture 47 # Library function name 48 # 49 # when setting CFLAGS, use the following guide for help 50 # 51 # gnu's g77/f77 COMPNAME_ADD2UNDERSCORE 52 # absoft's f77 COMPNAME_ADD1UNDERSCORE 53 # intel's ifort COMPNAME_ADD1UNDERSCORE 54 # intel's mpif90 COMPNAME_ADD1UNDERSCORE 55 # 56 # 57 58 CFLAGS = -DCOMPNAME_ADD2UNDERSCORE 37 PY = python 59 38 60 39 F77 = g77 … … 74 53 LIB_RP_OBJECTS = $(LIB_INC_PREFIX) -lRpObjects 75 54 LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture 76 LIB_RAPPTURE_T = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test77 55 78 56 INCL_CORE = -I $(INCLUDES_DIR)/core … … 110 88 111 89 RpUnitsC_test: $(SRC_TEST)/RpUnitsC_test.c 112 $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) -o $@ $^ $(LIB_RAPPTURE _T)90 $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) -o $@ $^ $(LIB_RAPPTURE) 113 91 114 92 RpLibrary_test: $(SRC_TEST)/RpLibrary_test.cc 115 $(CXX) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE _T)93 $(CXX) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE) 116 94 117 95 RpLibraryC_test: $(SRC_TEST)/RpLibraryC_test.c 118 $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE _T)96 $(CC) $(DEBUG) $(INCL_CEE) $(INCL_CORE) $(LIB_SCEW_INCL) -o $@ $^ $(LIB_RAPPTURE) 119 97 120 98 RpLibraryF_test: $(SRC_TEST)/RpLibraryF_test.f 121 $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE _T)99 $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE) 122 100 123 101 RpUnitsF_test: $(SRC_TEST)/RpUnitsF_test.f 124 $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE _T)102 $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE) 125 103 126 104 127 105 #### CLEAN UP ############################################################ 128 106 clean: 129 - rm -f *.o $(TEST_PROGS) 107 - rm -f *.o $(TEST_PROGS) run*.xml -
trunk/test/src/RpLibraryF_test.f
r83 r84 41 41 END SUBROUTINE test_get_str 42 42 43 SUBROUTINE test_get_dbl(lib,path) 44 integer lib 45 double precision rslt, rp_lib_get_double 46 character*100 path, retText 47 48 print *,"TESTING GET: path = ",path 49 50 rslt = rp_lib_get_double(lib, path) 51 52 print *,"rslt = ",rslt 53 END SUBROUTINE test_get_dbl 54 43 55 program rplib_f_tests 44 56 IMPLICIT NONE … … 65 77 !print *,"strVal = ",strVal 66 78 67 ! TESTING GET 79 ! TESTING GET STRING 68 80 path = "input.number(min).current" 69 81 call test_get_str(driver, path) 82 83 ! TESTING GET DOUBLE 84 path = "input.number(min).current" 85 call test_get_dbl(driver, path) 70 86 71 87
Note: See TracChangeset
for help on using the changeset viewer.