Changeset 771


Ignore:
Timestamp:
Jan 20, 2020 1:55:20 PM (2 months ago)
Author:
kulshres
Message:

Install swig module from 'make install'

installation happens in ${prefix}/${_lib}/python${py_ver}/site-packages
where ${prefix} is set by ./configure
${_lib} is either lib or lib64 depending on platform
${py_ver} is the detected version of python during ./configure

Installation only happens if sparse drivers are enabled and python is detected
without sparse drivers, there is a linking error in the swig module.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/swig/Makefile.am

    r764 r771  
    1717clean-local:
    1818        -rm -rf python R *.cpp *.cxx *.o *.h include
     19
     20if PYTHONFOUND
     21if SPARSE
     22install:
     23        ${PYTHON} setup.py install --prefix=${prefix} --only-swig
     24endif
     25endif
  • trunk/ADOL-C/swig/setup.py

    r764 r771  
    5050        ('lib-prefix=', None, 'prefix to install adolc library'),
    5151        ('colpack-dir=', None, 'directory in which colpack is installed'),
    52         ('boost-dir=', None, 'directory in which boost is installed') ]
     52        ('boost-dir=', None, 'directory in which boost is installed'),
     53        ('only-swig', None, 'only install this swig module, not adolc library') ]
    5354    command_name = 'build_lib'
    5455
     
    5758        self.colpack_dir = None
    5859        self.boost_dir = None
     60        self.only_swig = None
    5961
    6062    def finalize_options(self):
     
    6264                                   ('lib_prefix','lib_prefix'),
    6365                                   ('colpack_dir', 'colpack_dir'),
    64                                   ('boost_dir', 'boost_dir') )
     66                                   ('boost_dir', 'boost_dir'),
     67                                   ('only_swig', 'only_swig') )
    6568
    6669    def run(self):
    67         compile_dynlib(self.lib_prefix,self.colpack_dir,self.boost_dir)
     70        if not self.only_swig:
     71            compile_dynlib(self.lib_prefix,self.colpack_dir,self.boost_dir)
     72        else:
     73            print('skipping build of ADOL-C')
    6874
    6975
     
    9399        ('lib-prefix=', None, 'prefix to install adolc library'),
    94100        ('colpack-dir=', None, 'directory in which colpack is installed'),
    95         ('boost-dir=', None, 'directory in which boost is installed') ]
     101        ('boost-dir=', None, 'directory in which boost is installed'),
     102        ('only-swig', None, 'only install this swig module, not adolc library') ]
    96103
    97104    def lib_doesnot_exist(self):
     
    108115        self.colpack_dir = None
    109116        self.boost_dir = None
     117        self.only_swig = None
    110118
    111119    #sub_commands = [ ('build_lib', lib_doesnot_exist),
     
    119127        ('lib-prefix=', None, 'prefix to install adolc library'),
    120128        ('colpack-dir=', None, 'directory in which colpack is installed'),
    121         ('boost-dir=', None, 'directory in which boost is installed') ]
     129        ('boost-dir=', None, 'directory in which boost is installed'),
     130        ('only-swig', None, 'only install this swig module, not adolc library')]
    122131
    123132    def initialize_options(self):
     
    125134        self.colpack_dir = None
    126135        self.boost_dir = None
     136        self.only_swig = None
    127137        super(installthis,self).initialize_options()
    128138
     
    135145        if self.boost_dir is None:
    136146            self.boost_dir = '/usr'
     147        if self.only_swig is None:
     148            self.only_swig = False
    137149        self.finalized = 1
    138150        buildobj = self.distribution.get_command_obj('build')
    139151        buildobj.set_undefined_options('install',
    140                                    ('lib_prefix','lib_prefix'),
    141                                    ('colpack_dir', 'colpack_dir'),
    142                                    ('boost_dir', 'boost_dir') )
     152                                       ('lib_prefix','lib_prefix'),
     153                                       ('colpack_dir', 'colpack_dir'),
     154                                       ('boost_dir', 'boost_dir'),
     155                                       ('only_swig', 'only_swig'))
    143156       
    144157incdirs = np_dist.get_numpy_include_dirs()
  • trunk/configure.ac

    r766 r771  
    213213fi
    214214AC_SUBST(ADVBRANCH)
     215
     216AC_MSG_CHECKING(whether to enable reference counting for tapeless numbers)
     217AC_ARG_ENABLE(traceless-refcounting, [AS_HELP_STRING([--enable-traceless-refcounting],
     218  [enable reference counting for tapeless numbers [default=no].
     219With this enabled some additional checks will be conducted when setting the
     220number of directional derivatives for tapeless numbers using the SetNumDir()
     221function. ])],
     222  [use_adtl_refcnt=$enableval],[use_adtl_refcnt=no])
     223AC_MSG_RESULT($use_adtl_refcnt)
     224
     225if test x$use_adtl_refcnt = xyes ; then
     226  ADTL_REFCNT="#define USE_ADTL_REFCOUNTING 1"
     227else
     228  ADTL_REFCNT="#undef USE_ADTL_REFCOUNTING"
     229fi
     230AC_SUBST(ADTL_REFCNT)
    215231
    216232AC_MSG_CHECKING(whether to enable activity tracking)
     
    483499fi
    484500
     501AM_PATH_PYTHON([2.7],[python_found=yes],[python_found=no])
     502AM_CONDITIONAL(PYTHONFOUND, [test x$python_found = xyes])
    485503###########################################################################
    486504#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
     
    538556                ADOL-C/include/Makefile
    539557                ADOL-C/include/adolc/Makefile
    540                 ADOL-C/include/adolc/internal/adolc_settings.h
     558                ADOL-C/include/adolc/internal/adolc_settings.h
    541559                ADOL-C/include/adolc/drivers/Makefile
    542560                ADOL-C/include/adolc/internal/Makefile
     
    545563                ADOL-C/include/adolc/tapedoc/Makefile
    546564                ADOL-C/src/Makefile
    547                 ADOL-C/src/drivers/Makefile 
     565                ADOL-C/src/drivers/Makefile
    548566                ADOL-C/src/lie/Makefile
    549567                ADOL-C/src/sparse/Makefile
     
    627645    warn=true
    628646fi
     647if test x$sparse = xyes && test x$python_found = xyes; then
     648   echo \
     649"  Build with python swig module:      yes"
     650else
     651   echo \
     652"  Build with python swig module:      no"
     653fi
    629654echo
    630655
Note: See TracChangeset for help on using the changeset viewer.