Changeset 84


Ignore:
Timestamp:
Oct 5, 2005 1:21:24 PM (19 years ago)
Author:
dkearney
Message:
  1. added "install" target to make file for copying files over to /opt/rappture
  2. added targets for python to build and install the units module
  3. added fortran stub functions for library and units.

RpLibraryF_test.f compiles, just with warnings, because i'm still working on it.

Location:
trunk
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/app-fermi/fortran/Makefile

    r83 r84  
    55
    66# no need to edit the rest...
    7 PROGS = fermi
    8 
    9 CFLAGS = -DCOMPNAME_ADD2UNDERSCORE
     7PROGS = fermi
    108
    119#F77 = ifort
     
    1412
    1513LIB_DIR = $(RAPPTURE_DIR)/lib
    16 LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test
     14LIB_RAPPTURE = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
    1715
    1816all: $(PROGS)
     
    2220
    2321clean:
    24         rm -f *.o $(PROGS)
     22        rm -f *.o $(PROGS) run*.xml
  • trunk/include/fortran/RpLibraryFInterface.h

    r83 r84  
    1515#include <fstream>
    1616#include "RpFortranCommon.h"
     17#include "RpLibraryFStubs.h"
    1718
    18 /*
    19 // rappture-fortran api
    20 */
    21 
    22 #ifdef __cplusplus
     19#ifdef __cplusplus
    2320    extern "C" {
    2421#endif
    25 
    26 #ifdef COMPNAME_ADD1UNDERSCORE
    27 #   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_init
    82 #   define rp_lib                  rp_lib
    83 #   define rp_lib_element_comp     rp_lib_element_comp
    84 #   define rp_lib_element_id       rp_lib_element_id
    85 #   define rp_lib_element_type     rp_lib_element_type
    86 #   define rp_lib_element_obj      rp_lib_element_obj
    87 #   define rp_lib_child_num        rp_lib_child_num
    88 #   define rp_lib_child_comp       rp_lib_child_comp
    89 #   define rp_lib_child_id         rp_lib_child_id
    90 #   define rp_lib_child_type       rp_lib_child_type
    91 #   define rp_lib_child_obj        rp_lib_child_obj
    92 #   define rp_lib_get              rp_lib_get
    93 #   define rp_lib_get_double       rp_lib_get_double
    94 #   define rp_lib_put_str          rp_lib_put_str
    95 #   define rp_lib_put_id_str       rp_lib_put_id_str
    96 #   define rp_lib_put_obj          rp_lib_put_obj
    97 #   define rp_lib_put_id_obj       rp_lib_put_id_obj
    98 #   define rp_lib_remove           rp_lib_remove
    99 #   define rp_lib_xml_len          rp_lib_xml_len
    100 #   define rp_lib_write_xml        rp_lib_write_xml
    101 #   define rp_lib_xml              rp_lib_xml
    102 #   define rp_lib_node_comp        rp_lib_node_comp
    103 #   define rp_lib_node_type        rp_lib_node_type
    104 #   define rp_lib_node_id          rp_lib_node_id
    105 #   define rp_result               rp_result
    106 #   define rp_quit                 rp_quit
    107 #elif defined(COMPNAME_UPPERCASE)
    108 #   define rp_init                 RP_INIT
    109 #   define rp_lib                  RP_LIB
    110 #   define rp_lib_element_comp     RP_LIB_ELEMENT_COMP
    111 #   define rp_lib_element_id       RP_LIB_ELEMENT_ID
    112 #   define rp_lib_element_type     RP_LIB_ELEMENT_TYPE
    113 #   define rp_lib_element_obj      RP_LIB_ELEMENT_OBJ
    114 #   define rp_lib_child_num        RP_LIB_CHILD_NUM
    115 #   define rp_lib_child_comp       RP_LIB_CHILD_COMP
    116 #   define rp_lib_child_id         RP_LIB_CHILD_ID
    117 #   define rp_lib_child_type       RP_LIB_CHILD_TYPE
    118 #   define rp_lib_child_obj        RP_LIB_CHILD_OBJ
    119 #   define rp_lib_get              RP_LIB_GET
    120 #   define rp_lib_get_double       RP_LIB_GET_DOUBLE
    121 #   define rp_lib_put_str          RP_LIB_PUT_STR
    122 #   define rp_lib_put_id_str       RP_LIB_PUT_ID_STR
    123 #   define rp_lib_put_obj          RP_LIB_PUT_OBJ
    124 #   define rp_lib_put_id_obj       RP_LIB_PUT_ID_OBJ
    125 #   define rp_lib_remove           RP_LIB_REMOVE
    126 #   define rp_lib_xml_len          RP_LIB_XML_LEN
    127 #   define rp_lib_write_xml        RP_LIB_WRITE_XML
    128 #   define rp_lib_xml              RP_LIB_XML
    129 #   define rp_lib_node_comp        RP_LIB_NODE_COMP
    130 #   define rp_lib_node_type        RP_LIB_NODE_TYPE
    131 #   define rp_lib_node_id          RP_LIB_NODE_ID
    132 #   define rp_result               RP_RESULT
    133 #   define rp_quit                 RP_QUIT
    134 #endif
    135 
    136 
    137 void rp_init();
    13822
    13923int rp_lib ( const char* filePath, int filePath_len );
     
    16145                            int path_len );
    16246
     47/*
     48 * rp_lib_child_num still needs to be written
     49 * keep function declaration around
    16350int rp_lib_child_num (      int* handle,
    16451                            char* path,
    16552                            int* childHandle,
    16653                            int path_len);
     54*/
    16755
    16856int rp_lib_children (       int* handle, /* integer handle of library */
     
    17361
    17462
    175 void rp_lib_get (           int* handle, 
     63void rp_lib_get (           int* handle,
    17664                            char* path,
    17765                            char* retText,
     
    17967                            int retText_len );
    18068
    181 double rp_lib_get_double (  int* handle, 
     69double rp_lib_get_double (  int* handle,
    18270                            char* path,
    18371                            int path_len);
    18472
    185 void rp_lib_put_str (       int* handle, 
    186                             char* path, 
    187                             char* value, 
     73void rp_lib_put_str (       int* handle,
     74                            char* path,
     75                            char* value,
    18876                            int* append,
    18977                            int path_len,
    190                             int value_len ); 
     78                            int value_len );
    19179
    192 void rp_lib_put_id_str (    int* handle, 
    193                             char* path, 
    194                             char* value, 
    195                             char* id, 
     80void rp_lib_put_id_str (    int* handle,
     81                            char* path,
     82                            char* value,
     83                            char* id,
    19684                            int* append,
    19785                            int path_len,
    19886                            int value_len,
    199                             int id_len ); 
     87                            int id_len );
    20088
    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
     92void rp_lib_put_obj (       int* handle,
     93                            char* path,
     94                            int* valHandle,
    20495                            int* append,
    205                             int path_len );
     96                            int path_len );
     97*/
    20698
    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
     102void rp_lib_put_id_obj (    int* handle,
     103                            char* path,
     104                            int* valHandle,
     105                            char* id,
    211106                            int* append,
    212107                            int path_len,
    213                             int id_len );
     108                            int id_len );
     109*/
    214110
     111/*
     112 * rp_lib_remove still needs to be written
     113 * keep function declaration around
    215114int rp_lib_remove (         int* handle,
    216115                            char* path,
    217116                            int path_len);
     117*/
    218118
     119/*
     120 * rp_lib_xml_len still needs to be written
     121 * keep function declaration around
    219122int rp_lib_xml_len(         int* handle);
     123*/
    220124
    221125void rp_lib_xml(            int* handle,
     
    255159
    256160// global vars
    257 // dictionary to hold the python objects that 
     161// dictionary to hold the python objects that
    258162// cannot be sent to fortran
    259163
     
    261165RpDict DICT_TEMPLATE fortObjDict_Lib;
    262166
    263 #ifdef __cplusplus 
     167#ifdef __cplusplus
    264168    }
    265169#endif
  • trunk/include/fortran/RpUnitsFInterface.h

    r83 r84  
    1010 */
    1111
    12 #include "RpFortranCommon.h"
    13 
    1412#ifndef _RpUNITS_F_H
    1513#define _RpUNITS_F_H
    1614
    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"
    6217
    63 #ifdef __cplusplus 
     18#ifdef __cplusplus
    6419extern "C" {
    6520#endif
     
    7530int rp_get_units_name(int* unitRefVal, char* retText, int retText_len);
    7631
    77 int rp_get_exponent(int* unitRefVal, double retExponent);
     32int rp_get_exponent(int* unitRefVal, double* retExponent);
    7833
    7934int rp_get_basis(int* unitRefVal);
    8035
    81 int rp_units_convert_dbl (  char* fromVal, 
    82                             char* toUnitsName, 
    83                             double* convResult, 
    84                             int fromVal_len, 
     36int rp_units_convert_dbl (  char* fromVal,
     37                            char* toUnitsName,
     38                            double* convResult,
     39                            int fromVal_len,
    8540                            int toUnitsName_len );
    8641
    87 int rp_units_convert_str (  char* fromVal, 
    88                             char* toUnitsName, 
    89                             char* retText, 
    90                             int fromVal_len, 
     42int rp_units_convert_str (  char* fromVal,
     43                            char* toUnitsName,
     44                            char* retText,
     45                            int fromVal_len,
    9146                            int toUnitsName_len,
    92                             int retText_len     ); 
     47                            int retText_len     );
    9348
    9449int rp_units_add_presets ( char* presetName, int presetName_len);
    9550
    96 #ifdef __cplusplus 
     51#ifdef __cplusplus
    9752}
    9853#endif
    99    
     54
    10055#endif
  • trunk/src/Makefile

    r83 r84  
    11# you need to change this to where your version of python is installed.
    22# 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 
     3RP_INSTALL_BASE = /opt/rappture
    114
    125# tell make where to find the libscew sources
    13 SCEW_HEADERS    = /opt/rappture/include/scew
    14 LIB_SCEW_INCL   = -I $(SCEW_HEADERS)
    15 LIB_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
     6SCEW_HEADERS    = /opt/rappture/include/scew
     7LIB_SCEW_INCL   = -I $(SCEW_HEADERS)
     8LIB_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
    1811
    1912
    2013# everything below should be ok, but check to make sure
    21 # especially check the fortran flags, if youre using fortran
    2214#
    2315# define the top of our directory structure
     
    2719
    2820# define the top of the rappture directory structure
    29 RP_BASE   = $(TOP_DIR)/rappture
     21RP_BASE         = $(TOP_DIR)/rappture
    3022
    3123# define which programs can be made
    32 PROGS                   =       librappture                             \
    33                                         libRpObjects                    \
    34                                         librappture_test
     24PROGS           =   librappture   \
     25                    libRpObjects  \
     26                    Rappture.Units
    3527
    3628# define our compiling environment
    3729#
    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
     30CC              = gcc
     31CXX             = g++
     32DEBUG           = -g -Wall
     33DEBUG_PLUS      = -g -DDEBUG
     34PY              = python
    7135
    7236LN              = ln
     
    7438# define our directories
    7539#
    76 INCLUDES_DIR    = $(RP_BASE)/include
    77 BIN_DIR                 = $(RP_BASE)/bin
    78 LIB_DIR                 = $(RP_BASE)/src
    79 SRC_DIR                 = $(RP_BASE)/src
    80 TEST_DIR                = $(RP_BASE)/test
     40INCLUDES_DIR    = $(RP_BASE)/include
     41BIN_DIR         = $(RP_BASE)/bin
     42LIB_DIR         = $(RP_BASE)/src
     43SRC_DIR         = $(RP_BASE)/src
     44TEST_DIR        = $(RP_BASE)/test
    8145
    82 CORE_SRC                = $(SRC_DIR)/core
    83 FORT_SRC                = $(SRC_DIR)/fortran
    84 CEE_SRC                 = $(SRC_DIR)/cee
    85 PY_SRC                  = $(SRC_DIR)/python
     46CORE_SRC        = $(SRC_DIR)/core
     47FORT_SRC        = $(SRC_DIR)/fortran
     48CEE_SRC         = $(SRC_DIR)/cee
     49PY_SRC          = $(SRC_DIR)/python
    8650
    87 LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
     51LIB_INC_PREFIX  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR)
    8852LIB_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
     53LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
    9154
    92 INCL_CORE               = -I $(INCLUDES_DIR)/core
    93 INCL_CEE                = -I $(INCLUDES_DIR)/cee -I $(PY_SRC_HEADERS)
    94 INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
    95 INCL_PY                 = -I $(INCLUDES_DIR)/python
     55INCL_CORE       = -I $(INCLUDES_DIR)/core
     56INCL_CEE        = -I $(INCLUDES_DIR)/cee
     57INCL_FORTRAN    = -I $(INCLUDES_DIR)/fortran
     58INCL_PY         = -I $(INCLUDES_DIR)/python
    9659
    9760
    98 # default: 
     61# default:
    9962
    10063all: ${PROGS}
     64install: all install_py install_rappture install_rpobjs
    10165
    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
     66RP_IO_DEPS      = RpLibrary.o RpLibraryCInterface.o RpLibraryFInterface.o \
     67                  scew_extras.o
     68RP_UNITS_DEPS   = RpUnitsStd.o RpUnits.o RpUnitsCInterface.o RpUnitsFInterface.o
     69RP_OTHER_DEPS   = RpFortranCommon.o
     70RP_OBJS_DEP     = RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o \
     71                  RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
    10572
    10673# include rappture library definitions
     
    10875#### librappture shared object ###########################################
    10976
    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)
     77librappture: $(RP_IO_DEPS) $(RP_UNITS_DEPS) $(RP_OTHER_DEPS)
    11778        $(CXX) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
    11879                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ $(LIB_SCEW_FLAG)
     
    12081        /sbin/ldconfig -n $(LIB_DIR)
    12182
     83install_rappture: librappture
     84        cp -d $<.so* $(RP_INSTALL_BASE)/lib
     85
    12286#### libRpObjects ########################################################
    123 libRpObjects: RpVariable.o RpAbout.o RpNumber.o RpString.o RpBoolean.o RpChoice.o RpOption.o RpUnitsStd.o RpUnits.o
     87libRpObjects: $(RP_OBJS_DEP)
    12488        $(CC) $(DEGUG) -shared -Wl,-rpath,$(LIB_DIR)/ \
    12589                -Wl,-soname,$@.so -o $(LIB_DIR)/$@.so.0.0 $^ -lstdc++
     
    12892       
    12993        /sbin/ldconfig -n $(LIB_DIR)
     94
     95install_rpobjs: libRpObjects
     96        cp -d $<.so* $(RP_INSTALL_BASE)/lib
     97
     98#### Python ########################################################
     99Rappture.Units: RpUnits.o RpUnitsStd.o
     100        $(PY) $(PY_SRC)/setup.py build
     101
     102install_py: RpUnits.o RpUnitsStd.o
     103        $(PY) $(PY_SRC)/setup.py install
     104
    130105
    131106
     
    185160
    186161rappture_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 $<
    188163
    189164RpUnitsFInterface.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 $?
    191166
    192167RpFortranCommon.o: $(FORT_SRC)/RpFortranCommon.c
    193         $(CXX) $(CFLAGS) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
     168        $(CXX) -fPIC $(DEBUG) $(INCL_FORTRAN) -o $@ -c $<
    194169
    195170RpLibraryFInterface.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 $?
    197172
    198173
     
    201176#### CLEAN UP ############################################################
    202177clean:
    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  
    1111
    1212#include "RpLibraryFInterface.h"
     13#include "RpLibraryFStubs.c"
    1314
    1415int rp_lib(const char* filePath, int filePath_len)
  • trunk/src/fortran/RpUnitsFInterface.cc

    r83 r84  
    1414#include "string.h"
    1515#include "RpUnitsFInterface.h"
     16#include "RpUnitsFStubs.c"
    1617
    1718#define DICT_TEMPLATE <int,std::string>
     
    2122RpUnits* getObject_UnitsInt(int objKey);
    2223
    23 int rp_define_unit( char* unitName,
    24                     int* basisName,
     24int
     25rp_define_unit( char* unitName,
     26                    int* basisName,
    2527                    int unitName_len    ) {
    2628
     
    4446    // newUnit = RpUnits::define(unitName, basis);
    4547    newUnit = RpUnits::define(inText, basis);
    46    
     48
    4749    if (newUnit) {
    4850        result = storeObject_UnitsStr(newUnit->getUnitsName());
     
    5759
    5860
    59 int rp_find(char* searchName, int searchName_len)
     61int
     62rp_find(char* searchName, int searchName_len)
    6063{
    6164
     
    7982}
    8083
    81 int rp_make_metric(int* basis)
     84int
     85rp_make_metric(int* basis)
    8286{
    8387    int result = -1;
     
    9599}
    96100
    97 int rp_get_units(int* unitRefVal, char* retText, int retText_len)
     101int
     102rp_get_units(int* unitRefVal, char* retText, int retText_len)
    98103{
    99104    RpUnits* unitObj = NULL;
     
    112117}
    113118
    114 int rp_get_units_name(int* unitRefVal, char* retText, int retText_len)
     119int
     120rp_get_units_name(int* unitRefVal, char* retText, int retText_len)
    115121{
    116122    RpUnits* unitObj = NULL;
     
    125131        }
    126132    }
    127    
    128     return result;
    129 }
    130 
    131 int rp_get_exponent(int* unitRefVal, double* retExponent)
     133
     134    return result;
     135}
     136
     137int
     138rp_get_exponent(int* unitRefVal, double* retExponent)
    132139{
    133140    RpUnits* unitObj = NULL;
     
    144151}
    145152
    146 int rp_get_basis(int* unitRefVal)
     153int
     154rp_get_basis(int* unitRefVal)
    147155{
    148156    RpUnits* unitObj = NULL;
     
    155163        if (unitObj) {
    156164            basisObj = unitObj->getBasis();
    157            
     165
    158166            if (basisObj) {
    159167                result = storeObject_UnitsStr(basisObj->getUnitsName());
     
    165173}
    166174
    167 int rp_units_convert_dbl (  char* fromVal,
    168                             char* toUnitsName,
    169                             double* convResult,
    170                             int fromVal_len,
     175int
     176rp_units_convert_dbl (  char* fromVal,
     177                            char* toUnitsName,
     178                            double* convResult,
     179                            int fromVal_len,
    171180                            int toUnitsName_len ) {
    172181
     
    204213}
    205214
    206 int rp_units_convert_str (      char* fromVal,
    207                                 char* toUnitsName,
    208                                 char* retText,
    209                                 int fromVal_len,
     215int
     216rp_units_convert_str (      char* fromVal,
     217                                char* toUnitsName,
     218                                char* retText,
     219                                int fromVal_len,
    210220                                int toUnitsName_len,
    211221                                int retText_len     ) {
     
    247257}
    248258
    249 int rp_units_add_presets ( char* presetName, int presetName_len) {
    250    
     259int
     260rp_units_add_presets ( char* presetName, int presetName_len) {
     261
    251262    char* inPresetName = NULL;
    252263    int result = -1;
    253    
     264
    254265    inPresetName = null_terminate(presetName,presetName_len);
    255266
     
    270281
    271282
    272 int storeObject_UnitsStr(std::string objectName) {
     283int
     284storeObject_UnitsStr(std::string objectName) {
    273285
    274286    int retVal = -1;
     
    280292        // no error checking to make sure it was successful in entering
    281293        // the new entry.
    282         fortObjDictUnits.set(dictNextKey,objectName, &newEntry); 
    283     }
    284    
     294        fortObjDictUnits.set(dictNextKey,objectName, &newEntry);
     295    }
     296
    285297    retVal = dictNextKey;
    286298    return retVal;
    287299}
    288300
    289 RpUnits* getObject_UnitsInt(int objKey) {
     301RpUnits*
     302getObject_UnitsInt(int objKey) {
    290303
    291304    std::string basisName = *(fortObjDictUnits.find(objKey).getValue());
  • trunk/src/python/setup.py

    r71 r84  
    11from distutils.core import setup, Extension
    22
    3 # need to write an if statement to check to see if the libRpUnits exists
    4 # 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 
    153module = 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' ])
    219
    2210setup(name="Rappture.Units",
  • trunk/test/Makefile

    r83 r84  
    2525                  RpUnitsF_test     \
    2626                  RpLibrary_test    \
    27                   RpLibraryC_test
     27                  RpLibraryC_test   \
     28                  RpLibraryF_test
    2829
    2930# define our compiling environment
     
    3435DEBUG_PLUS      = -g -DDEBUG
    3536
    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
     37PY              = python
    5938
    6039F77             = g77
     
    7453LIB_RP_OBJECTS  = $(LIB_INC_PREFIX) -lRpObjects
    7554LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
    76 LIB_RAPPTURE_T  = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture_test
    7755
    7856INCL_CORE       = -I $(INCLUDES_DIR)/core
     
    11088
    11189RpUnitsC_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)
    11391
    11492RpLibrary_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)
    11694
    11795RpLibraryC_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)
    11997
    12098RpLibraryF_test: $(SRC_TEST)/RpLibraryF_test.f
    121         $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE_T)
     99        $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE)
    122100
    123101RpUnitsF_test: $(SRC_TEST)/RpUnitsF_test.f
    124         $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE_T)
     102        $(F77) $(DEBUG) -o $@ $^ $(LIB_RAPPTURE)
    125103
    126104
    127105#### CLEAN UP ############################################################
    128106clean:
    129         - rm -f *.o $(TEST_PROGS)
     107        - rm -f *.o $(TEST_PROGS) run*.xml
  • trunk/test/src/RpLibraryF_test.f

    r83 r84  
    4141      END SUBROUTINE  test_get_str
    4242
     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
    4355      program rplib_f_tests
    4456        IMPLICIT NONE
     
    6577        !print *,"strVal = ",strVal
    6678
    67         ! TESTING GET
     79        ! TESTING GET STRING
    6880        path = "input.number(min).current"
    6981        call test_get_str(driver, path)
     82
     83        ! TESTING GET DOUBLE
     84        path = "input.number(min).current"
     85        call test_get_dbl(driver, path)
    7086
    7187
Note: See TracChangeset for help on using the changeset viewer.