<commit_before>require 'mkmf-rice'

OCE_INCLUDE_DIR = '/usr/include/oce'
OCE_LIB_DIR = '/usr/lib'

dir_config('TKG3d', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKBRep', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKPrim', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKOffset', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKBO', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKSTL', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('qhull', '/usr/include/qhull', '/usr/lib')

have_library('TKG3d') or raise
have_library('TKBRep') or raise
have_library('TKPrim') or raise
have_library('TKOffset') or raise
have_library('TKBO') or raise
have_library('TKSTL') or raise
have_library('qhull') or raise

create_makefile('rcad/_rcad')
<commit_msg>Hack extconf.rb to work around compilation errors during lib detection.<commit_after>require 'rbconfig'
require 'mkmf-rice'

OCE_INCLUDE_DIR = '/usr/include/oce'
OCE_LIB_DIR = '/usr/lib'


dir_config('TKG3d',    OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKBRep',   OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKPrim',   OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKOffset', OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKBO',     OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('TKSTL',    OCE_INCLUDE_DIR, OCE_LIB_DIR)
dir_config('qhull')


# HACK: modify compiled src so that test function can try to call main()
# despite it not having a prototype. we simply add the prototype.
def fixed_have_lib(*args)
  have_library(*args) { |src|
    # prepend prototype for main
    "int main(int argc, char **argv);\n" + src
  }
end

def have_oce_lib(name)
  fixed_have_lib('TK' + name)
end


have_oce_lib('G3d')    or raise
have_oce_lib('BRep')   or raise
have_oce_lib('Prim')   or raise
have_oce_lib('Offset') or raise
have_oce_lib('BO')     or raise
have_oce_lib('STL')    or raise
fixed_have_lib('qhull') or raise

create_makefile('rcad/_rcad')

{'fraction_non_alphanumeric': 0.12432432432432433, 'fraction_numerical': 0.002162162162162162, 'mean_word_length': 6.648760330578512, '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': '6846176', 'n_tokens_mistral': 786, 'n_tokens_neox': 734, 'n_words': 151}