<commit_before>import SCons.Script

import os

def init_variables(vars):
    '''Initialize the build variables.
    '''
    vars.Add('BOOST_INCLUDE_DIR', 'Location of boost headers', '/usr/include')
    vars.Add('BOOST_LIB_DIR', 'Location of boost libraries', '/usr/lib')
    vars.Add('BOOST_LIBS', 
             'Boost libraries to link', 
             ['boost_filesystem', 'boost_python', 'boost_system'])
    
    vars.Add('PYTHON_INCLUDE_DIR', 'Location of Python headers', '/usr/include/python2.6')
    vars.Add('PYTHON_LIB_DIR', 'Location of Python libraries', '/usr/lib')
    vars.Add('PYTHON_LIBS', 'Python libraries to link', ['python2.6'])

    vars.Add('VARIANT', 'Compile with debugging', 'release')

    vars.Add('CXX', 'C++ compiler to use', None)
    vars.Add('CXXFLAGS', 'C++ compiler flags', [])

    vars.Add('BUILD_DIR', 'Build-product directory', None)

    vars.Add('VERBOSE', 'Print extra info about the build', 0)

    vars.Add('INSTALL_DIR', 'Installation directory',
             os.path.join('#', 'install', '$VARIANT'))
    
    return vars

def check_config(env):
    '''Check the system configuration, build variables, etc.
    '''
    conf = SCons.Script.Configure(env)

    for header, package in { 'boost/python.hpp' : 'boost.python',
                             'Python.h' : 'python' }.items():
        if not conf.CheckCXXHeader(header):
            print 'Missing header %s. %s must be installed!' % (header, package)
            env.Exit(1)

    for libs, package in [ (env['BOOST_LIBS'], 'boost.python'),
                           (env['PYTHON_LIBS'], 'python')]:
        if not conf.CheckLib(libs, language='C++'):
            print 'Missing library/ies %s. %s must be installed!' % (libs, package)
            env.Exit(1)

    return conf.Finish()<commit_msg>implemented separate checks for each library we require<commit_after>import SCons.Script

import os

def init_variables(vars):
    '''Initialize the build variables.
    '''
    vars.Add('BOOST_INCLUDE_DIR', 'Location of boost headers', '/usr/include')
    vars.Add('BOOST_LIB_DIR', 'Location of boost libraries', '/usr/lib')
    vars.Add('BOOST_LIBS', 
             'Boost libraries to link', 
             ['boost_filesystem', 'boost_python', 'boost_system'])
    
    vars.Add('PYTHON_INCLUDE_DIR', 'Location of Python headers', '/usr/include/python2.6')
    vars.Add('PYTHON_LIB_DIR', 'Location of Python libraries', '/usr/lib')
    vars.Add('PYTHON_LIBS', 'Python libraries to link', ['python2.6'])

    vars.Add('VARIANT', 'Compile with debugging', 'release')

    vars.Add('CXX', 'C++ compiler to use', None)
    vars.Add('CXXFLAGS', 'C++ compiler flags', [])

    vars.Add('BUILD_DIR', 'Build-product directory', None)

    vars.Add('VERBOSE', 'Print extra info about the build', 0)

    vars.Add('INSTALL_DIR', 'Installation directory',
             os.path.join('#', 'install', '$VARIANT'))
    
    return vars

def check_config(env):
    '''Check the system configuration, build variables, etc.
    '''
    conf = SCons.Script.Configure(env)

    for header, package in { 'boost/python.hpp' : 'boost.python',
                             'Python.h' : 'python' }.items():
        if not conf.CheckCXXHeader(header):
            print 'Missing header %s. %s must be installed!' % (header, package)
            env.Exit(1)

    for libs, package in [ (env['BOOST_LIBS'], 'boost'),
                           (env['PYTHON_LIBS'], 'python')]:
        for lib in libs:
            if not conf.CheckLib(lib, language='C++'):
                print 'Missing library %s. %s must be installed!' % (lib, package)
                env.Exit(1)

    return conf.Finish()
{'fraction_non_alphanumeric': 0.15521003818876158, 'fraction_numerical': 0.0038188761593016913, 'mean_word_length': 2.8438155136268346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '944603', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1096, 'n_words': 294}