Esempio n. 1
0
def localize_hesaff():
    print('____ Localizing hessaff ____')
    hesaff_build = __CODE__ + '/hesaff/build'
    hesaff_pybnd = __CODE__ + '/hesaff/python_bindings'
    check_path(hesaff_build)
    tpl_hesaff = tpl_root + '/hesaff'
    ensure_path(tpl_hesaff) 
    copy_all(hesaff_build, tpl_hesaff, 'hesaff*')
    copy_all(hesaff_pybnd, tpl_hesaff, '*.py')
    os.system('chmod +x ' + tpl_hesaff + '/hesaff*')
Esempio n. 2
0
def localize_hesaff():
    print('____ Localizing hessaff ____')
    hesaff_build = __CODE__ + '/hesaff/build'
    hesaff_pybnd = __CODE__ + '/hesaff/python_bindings'
    check_path(hesaff_build)
    tpl_hesaff = tpl_root + '/hesaff'
    ensure_path(tpl_hesaff)
    copy_all(hesaff_build, tpl_hesaff, 'hesaff*')
    copy_all(hesaff_pybnd, tpl_hesaff, '*.py')
    os.system('chmod +x ' + tpl_hesaff + '/hesaff*')
Esempio n. 3
0
def localize_opencv():
    raise Exception('dont do this no more')
    print('____ Localizing opencv ____')
    # Where to install
    tpl_cv2 = tpl_root + '/cv2'
    ensure_path(tpl_cv2) 
    # Libraries
    opencv_lib = install_prefix+'/lib'
    if sys.platform == 'win32':
        # The opencv libraries are in bin not lib on windows. x.x
        opencv_lib = install_prefix+'/OpenCV/bin'
        # Move the MinGW libs too
        mingw_lib = 'C:/MinGW/bin'
        copy_all(mingw_lib, tpl_cv2, ['libgcc_s_dw2-1.dll',
                                    'libstdc++-6.dll'])
    copy_all(opencv_lib, tpl_cv2, 'libopencv*')
    # Python bindings
    copy_all(pypackages, tpl_cv2, ['cv2.so','cv2.pyd','libcv2*'])
    with open(tpl_cv2+'/__init__.py', 'w') as cv2_init:
        cv2_init.write(textwrap.dedent('''
        # autogenerated in build_tpl.py
        import os, sys
        from os.path import realpath, dirname
        tpl_cv2 = realpath(dirname(__file__))
        sys.path.insert(0, tpl_cv2)
        os.environ['PATH'] = tpl_cv2 + os.pathsep + os.environ['PATH']
        try:
            from cv2 import *
        except Exception as ex:                       
            print(repr(ex))
            print(os.environ['PATH'])
            print(sys.path)
            raise
        '''))
Esempio n. 4
0
def localize_opencv():
    raise Exception('dont do this no more')
    print('____ Localizing opencv ____')
    # Where to install
    tpl_cv2 = tpl_root + '/cv2'
    ensure_path(tpl_cv2)
    # Libraries
    opencv_lib = install_prefix + '/lib'
    if sys.platform == 'win32':
        # The opencv libraries are in bin not lib on windows. x.x
        opencv_lib = install_prefix + '/OpenCV/bin'
        # Move the MinGW libs too
        mingw_lib = 'C:/MinGW/bin'
        copy_all(mingw_lib, tpl_cv2, ['libgcc_s_dw2-1.dll', 'libstdc++-6.dll'])
    copy_all(opencv_lib, tpl_cv2, 'libopencv*')
    # Python bindings
    copy_all(pypackages, tpl_cv2, ['cv2.so', 'cv2.pyd', 'libcv2*'])
    with open(tpl_cv2 + '/__init__.py', 'w') as cv2_init:
        cv2_init.write(
            textwrap.dedent('''
        # autogenerated in build_tpl.py
        import os, sys
        from os.path import realpath, dirname
        tpl_cv2 = realpath(dirname(__file__))
        sys.path.insert(0, tpl_cv2)
        os.environ['PATH'] = tpl_cv2 + os.pathsep + os.environ['PATH']
        try:
            from cv2 import *
        except Exception as ex:                       
            print(repr(ex))
            print(os.environ['PATH'])
            print(sys.path)
            raise
        '''))
Esempio n. 5
0
def localize_flann():
    print('____ Localizing flann ____')
    # Where to install
    # Where to install
    tpl_pyflann   = tpl_root+'/pyflann'
    ensure_path(tpl_pyflann) 
    if sys.platform == 'win32':
        # Libraries
        flann_lib   = 'C:/Program Files (x86)/flann/lib'
        copy_all(flann_lib,  tpl_pyflann, 'libflann*')
        # Better do the bin as well (like opencv)
        # yups
        flann_bin   = 'C:/Program Files (x86)/flann/bin'
        copy_all(flann_bin,  tpl_pyflann, '*.dll')
        # Python bindings
        pyflann_dir = pypackages+'/pyflann'
        copy_all(pyflann_dir,  tpl_pyflann, '*.py')
    else:
        # Libraries
        flann_lib   = install_prefix+'/lib'
        copy_all(flann_lib,  tpl_pyflann, 'libflann*')
        # Python bindings
        pyflann_dir = install_prefix+'/share/flann/python/pyflann'
        copy_all(pyflann_dir,  tpl_pyflann, '*.py')
Esempio n. 6
0
def localize_flann():
    print('____ Localizing flann ____')
    # Where to install
    # Where to install
    tpl_pyflann = tpl_root + '/pyflann'
    ensure_path(tpl_pyflann)
    if sys.platform == 'win32':
        # Libraries
        flann_lib = 'C:/Program Files (x86)/flann/lib'
        copy_all(flann_lib, tpl_pyflann, 'libflann*')
        # Better do the bin as well (like opencv)
        # yups
        flann_bin = 'C:/Program Files (x86)/flann/bin'
        copy_all(flann_bin, tpl_pyflann, '*.dll')
        # Python bindings
        pyflann_dir = pypackages + '/pyflann'
        copy_all(pyflann_dir, tpl_pyflann, '*.py')
    else:
        # Libraries
        flann_lib = install_prefix + '/lib'
        copy_all(flann_lib, tpl_pyflann, 'libflann*')
        # Python bindings
        pyflann_dir = install_prefix + '/share/flann/python/pyflann'
        copy_all(pyflann_dir, tpl_pyflann, '*.py')