Changeset 1501


Ignore:
Timestamp:
02/11/09 12:54:51 (16 years ago)
Author:
Malte Marquarding
Message:

support linking against pyrap

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1469 r1501  
    5656                ("rpfitslibdir", "The rpfits library location", None),
    5757#               ("rpfitsincdir", "The rpfits include location", None),
     58                ("pyraproot", "The root directory where libpyrap is installed",
     59                 None),
     60                ("pyraplib", "The name of the pyrap library", "pyrap"),
     61                ("pyraplibdir", "The directory where libpyrap is installed",
     62                 None),
     63                ("pyrapincdir", "The pyrap include location",
     64                 None),
     65                BoolVariable("enable_pyrap", "Use pyrap conversion library",
     66                             True),
     67
    5868                EnumVariable("mode", "The type of build.", "release",
    5969                           ["release","debug"], ignorecase=1),
     
    6575                           ["none", "pdf", "html"], ignorecase=1),
    6676                BoolVariable("apps", "Build cpp apps", False),
    67                 BoolVariable("alma", "Enable alma specific functionality", False)
     77                BoolVariable("alma", "Enable alma specific functionality",
     78                             False),
    6879                )
    6980
     
    113124
    114125    conf.env.AddCustomPackage('boost')
    115     if not conf.CheckLibWithHeader(env["boostlib"],
     126    if not conf.CheckLibWithHeader(conf.env["boostlib"],
    116127                                   'boost/python.hpp', language='c++'):
    117128        Exit(1)
     129
     130    conf.env.AddCustomPackage('pyrap')
     131    if  conf.env.get("enable_pyrap") and conf.CheckLib(conf.env["pyraplib"],
     132                                                       language='c++',
     133                                                       autoadd=0):
     134        conf.env.Append(CPPFLAGS=['-DHAVE_PYRAP'])
     135        conf.env.PrependUnique(LIBS=env['pyraplib'])
     136   
    118137    # test for cfitsio
    119138    if not conf.CheckLib("m"): Exit(1)
  • trunk/src/python_asap.cpp

    r1126 r1501  
    3939#include "ScantableWrapper.h"
    4040
     41#ifndef HAVE_LIBPYRAP
     42  #include "pyconversions.h"
     43#else
     44  #include <pyrap/Converters/PycExcp.h>
     45  #include <pyrap/Converters/PycBasicData.h>
     46#endif
    4147
    42 #include "pyconversions.h"
    4348#include "python_asap.h"
    4449
     50#ifndef HAVE_LIBPYRAP
    4551namespace asap {
    4652  namespace python {
     53
    4754void translate_ex(const casa::AipsError& e)
    4855{
     
    5360  }
    5461}
     62#endif
     63
    5564using namespace boost::python;
    5665
     
    6574  asap::python::python_STWriter();
    6675  asap::python::python_LineCatalog();
     76  asap::python::python_Logger();
    6777
    68   asap::python::python_Logger();
     78#ifndef HAVE_LIBPYRAP
     79  // Use built-in pyconversions.h
    6980  register_exception_translator<casa::AipsError>(&asap::python::translate_ex);
    70 
    71   //std_vector_to_tuple <  > ();
    7281  from_python_sequence < std::vector< asap::ScantableWrapper >,
    7382    variable_capacity_policy > ();
    74 
    7583  std_vector_to_tuple < int > ();
    7684  from_python_sequence < std::vector < int >,
     
    9199  from_python_sequence < std::vector < bool >,
    92100    variable_capacity_policy > ();
     101#else
     102  casa::pyrap::register_convert_excp();
     103  casa::pyrap::register_convert_basicdata();
     104  casa::pyrap::register_convert_std_vector<asap::ScantableWrapper>();
     105#endif
    93106}
Note: See TracChangeset for help on using the changeset viewer.