def update(self, env): """ Update the environment with specific flags """ if env['WITH_BISON']: bison = env.WhereIs('bison', env['bison_bin']) if bison: version = get_bison_version(bison) if version is None: em.error( "Unable to retrieve bison version number. Problem with bison. Bison disabled ..." ) env['WITH_BISON'] = False return t = Tool('yacc', toolpath=[getLocalPath()]) t(env) env.Append(YACCFLAGS=['-d', '-v']) env.Replace(YACC=bison) BISON_HPP = (version >= 1.30) env.Append(BISON_HPP=BISON_HPP) if BISON_HPP: env.Append(CPPDEFINES=["BISON_HPP"]) env['WITH_BISON'] = True env.Append(CPPDEFINES=["WITH_BISON"]) else: em.error("'bison' not found. Bison disabled ...") env['WITH_BISON'] = False
def update(self, env): """ Update the environment with specific flags """ if env['WITH_EIGEN']: eigen_includes = env['eigen_includes'] if isinstance(eigen_includes, str): eigen_includes = eigen_includes.split() eigen_includes = eigen_includes[0] if not os.path.exists(os.path.join(eigen_includes, 'Eigen')): em.error("EIGEN lib not found. EIGEN disabled ...") env['WITH_EIGEN'] = False if env['WITH_EIGEN']: env.AppendUnique(CPPPATH=[env['eigen_includes']]) env.Append(CPPDEFINES='WITH_EIGEN')
def update(self, env): """ Update the environment with specific flags """ if env['WITH_ANN'] : ann_inc = env['ann_includes'] ann_header = os.path.join(ann_inc,'ANN','ANN.h') if not os.path.exists(ann_header): import openalea.sconsx.errormsg as em em.error("ANN headers not found. ANN disabled ...") env['WITH_ANN'] = False if env['WITH_ANN']: env.AppendUnique(CPPPATH=[env['ann_includes']]) env.AppendUnique(LIBPATH=[env['ann_libpath']]) env.Append(CPPDEFINES='$ann_defines') env.Append(CPPDEFINES='WITH_ANN') env.Append(CPPFLAGS='$ann_flags') env.AppendUnique(LIBS=env['ann_libs'])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_ANN']: ann_inc = env['ann_includes'] ann_header = os.path.join(ann_inc, 'ANN', 'ANN.h') if not os.path.exists(ann_header): import openalea.sconsx.errormsg as em em.error("ANN headers not found. ANN disabled ...") env['WITH_ANN'] = False if env['WITH_ANN']: env.AppendUnique(CPPPATH=[env['ann_includes']]) env.AppendUnique(LIBPATH=[env['ann_libpath']]) env.Append(CPPDEFINES='$ann_defines') env.Append(CPPDEFINES='WITH_ANN') env.Append(CPPFLAGS='$ann_flags') env.AppendUnique(LIBS=env['ann_libs'])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_MPFR']: mpfr_inc = env['mpfr_includes'] # if type(mpfr_inc) == str: # mpfr_inc = mpfr_inc.split() # mpfr_inc = mpfr_inc[0] if not os.path.exists(os.path.join(mpfr_inc, 'mpfr.h')): import openalea.sconsx.errormsg as em em.error("MPFR headers not found. MPFR disabled ...") env['WITH_MPFR'] = False if env['WITH_MPFR']: env.AppendUnique(CPPPATH=[env['mpfr_includes']]) env.AppendUnique(LIBPATH=[env['mpfr_libpath']]) env.Append(CPPDEFINES='$mpfr_defines') #env.Append(CPPDEFINES='WITH_MPFR') env.Append(CPPFLAGS='$mpfr_flags') env.AppendUnique(LIBS=env['mpfr_libs'])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_GMP'] : gmp_inc = env['gmp_includes'] # if type(gmp_inc) == str: # gmp_inc = gmp_inc.split() #gmp_inc = gmp_inc[0] if not os.path.exists(os.path.join(gmp_inc,'gmpxx.h')): import openalea.sconsx.errormsg as em em.error("GMP headers not found. GMP disabled ...") env['WITH_GMP'] = False if env['WITH_GMP']: env.AppendUnique(CPPPATH=[env['gmp_includes']]) env.AppendUnique(LIBPATH=[env['gmp_libpath']]) env.Append(CPPDEFINES='$gmp_defines') env.Append(CPPDEFINES='WITH_GMP') env.Append(CPPFLAGS='$gmp_flags') env.AppendUnique(LIBS=env['gmp_libs'])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_CGAL']: cgal_inc = env['cgal_includes'] if type(cgal_inc) == str: cgal_inc = cgal_inc.split() cgal_inc = cgal_inc[0] if not os.path.exists(os.path.join(cgal_inc, 'CGAL')): import openalea.sconsx.errormsg as em em.error("CGAL headers not found. CGAL disabled ...") env['WITH_CGAL'] = False if env['WITH_CGAL']: env.AppendUnique(CPPPATH=[env['cgal_includes']]) env.AppendUnique(LIBPATH=[env['cgal_libpath']]) env.Append(CPPDEFINES='$cgal_defines') env.Append(CPPDEFINES='WITH_CGAL') env.Append(CPPFLAGS='$cgal_flags') env.AppendUnique(LIBS=env['cgal_libs'])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_MPFR'] : mpfr_inc = env['mpfr_includes'] # if type(mpfr_inc) == str: # mpfr_inc = mpfr_inc.split() # mpfr_inc = mpfr_inc[0] if not os.path.exists(os.path.join(mpfr_inc,'mpfr.h')): import openalea.sconsx.errormsg as em em.error("MPFR headers not found. MPFR disabled ...") env['WITH_MPFR'] = False if env['WITH_MPFR']: env.AppendUnique(CPPPATH=[env['mpfr_includes']]) env.AppendUnique(LIBPATH=[env['mpfr_libpath']]) env.Append(CPPDEFINES='$mpfr_defines') #env.Append(CPPDEFINES='WITH_MPFR') env.Append(CPPFLAGS='$mpfr_flags') env.AppendUnique(LIBS=env['mpfr_libs'])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_QHULL'] : def_qhull_inc = env['qhull_includes'] qhull_inc = pj(def_qhull_inc, 'libqhull') if not os.path.exists(os.path.join(qhull_inc, "qhull_a.h")) : import openalea.sconsx.errormsg as em em.error("Error: QHull headers not found. QHull disabled ...") env['WITH_QHULL'] = False if env['WITH_QHULL'] : env.AppendUnique(CPPPATH=[env['qhull_includes']]) env.AppendUnique(LIBPATH=[env['qhull_libpath']]) env.AppendUnique( CPPDEFINES = ['WITH_QHULL_2011'] ) env.AppendUnique( CPPDEFINES = ['WITH_QHULL'] ) qhull_name = 'qhull'+env['qhull_libs_suffix'] env.AppendUnique(LIBS=[qhull_name])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_FLEX']: flex = env.WhereIs('flex', env['flex_bin']) if flex: t = Tool('lex', toolpath=[getLocalPath()]) t(env) if not isinstance(platform, Win32): env.AppendUnique(LIBS=env['flex_libs']) env.AppendUnique(LIBPATH=[env['flex_libpath']]) env.AppendUnique(CPPPATH=[env['flex_include']]) env.Replace(LEX=flex) env['WITH_FLEX'] = True env.Append(CPPDEFINES =["WITH_FLEX"]) else: import openalea.sconsx.errormsg as em em.error("'flex' not found. Flex disabled ...") env['WITH_FLEX'] = False
def update(self, env): """ Update the environment with specific flags """ if env['WITH_QHULL']: def_qhull_inc = env['qhull_includes'] qhull_inc = pj(def_qhull_inc, 'libqhull') if not os.path.exists(os.path.join(qhull_inc, "qhull_a.h")): import openalea.sconsx.errormsg as em em.error("Error: QHull headers not found. QHull disabled ...") env['WITH_QHULL'] = False if env['WITH_QHULL']: env.AppendUnique(CPPPATH=[env['qhull_includes']]) env.AppendUnique(LIBPATH=[env['qhull_libpath']]) env.AppendUnique(CPPDEFINES=['WITH_QHULL_2011']) env.AppendUnique(CPPDEFINES=['WITH_QHULL']) qhull_name = 'qhull' + env['qhull_libs_suffix'] env.AppendUnique(LIBS=[qhull_name])
def update(self, env): """ Update the environment with specific flags """ if env['WITH_FLEX']: flex = env.WhereIs('flex', env['flex_bin']) if flex: t = Tool('lex', toolpath=[getLocalPath()]) t(env) if not isinstance(platform, Win32): env.AppendUnique(LIBS=env['flex_libs']) env.AppendUnique(LIBPATH=[env['flex_libpath']]) env.AppendUnique(CPPPATH=[env['flex_include']]) env.Replace(LEX=flex) env['WITH_FLEX'] = True env.Append(CPPDEFINES=["WITH_FLEX"]) else: import openalea.sconsx.errormsg as em em.error("'flex' not found. Flex disabled ...") env['WITH_FLEX'] = False
def update(self, env): """ Update the environment with specific flags """ if env['WITH_LAPACK'] : lapack_lib = env['lapack_libpath'] if type(lapack_lib) == str: lapack_lib = lapack_lib.split() lapack_lib = lapack_lib[0] libnames = ['liblapack.so','liblapack.a', 'lapack.lib', 'liblapack.lib', 'liblapack.dylib'] if sum( [os.path.exists(os.path.join(lapack_lib,x)) for x in libnames] ) == 0 : import openalea.sconsx.errormsg as em em.error("LAPACK lib not found. LAPACK disabled ...") env['WITH_LAPACK'] = False if env['WITH_LAPACK']: env.AppendUnique(CPPPATH=[env['lapack_includes']]) env.AppendUnique(LIBPATH=[env['lapack_libpath']]) for define in env['lapack_defines']: env.AppendUnique(CPPDEFINES=define) env.Append(CPPDEFINES='WITH_LAPACK') env.Append(CPPFLAGS='$lapack_flags') env.AppendUnique(LIBS=env['lapack_libs'])
def update(self, env): """ Update the environment with specific flags """ import openalea.sconsx.errormsg as em if env.subst("$build_libdir") == env.subst("$libdir"): em.error("build_libdir and libdir have similar values : %s. Ignore lib in install_lib step." % repr(env.subst("$build_libdir"))) if env.subst("$build_includedir") == env.subst("$includedir"): em.error("build_includedir and includedir have similar values : %s. Ignore includes in install_lib step." % repr(env.subst("$build_includedir"))) if env.subst("$build_bindir") == env.subst("$bindir"): em.error("build_bindir and bindir have similar values : %s. Ignore bin in install_lib step." % repr(env.subst("$build_bindir"))) pass
def update(self, env): """ Update the environment with specific flags """ import openalea.sconsx.errormsg as em if env.subst("$build_libdir") == env.subst("$libdir"): em.error( "build_libdir and libdir have similar values : %s. Ignore lib in install_lib step." % repr(env.subst("$build_libdir"))) if env.subst("$build_includedir") == env.subst("$includedir"): em.error( "build_includedir and includedir have similar values : %s. Ignore includes in install_lib step." % repr(env.subst("$build_includedir"))) if env.subst("$build_bindir") == env.subst("$bindir"): em.error( "build_bindir and bindir have similar values : %s. Ignore bin in install_lib step." % repr(env.subst("$build_bindir"))) pass