<commit_before>""" Modified version of build_ext that handles fortran source files.
"""

import os, string
from types import *

from distutils.dep_util import newer_group, newer
from distutils.command.build_ext import build_ext as old_build_ext

from scipy_distutils.command.build_clib import get_headers,get_directories

class build_ext (old_build_ext):

    def build_extension(self, ext):
        #XXX: anything else we need to save?
        save_linker_so = self.compiler.linker_so
        save_compiler_libs = self.compiler.libraries
        save_compiler_libs_dirs = self.compiler.library_dirs
        
        # support for building static fortran libraries
        need_f_libs = 0
        need_f_opts = getattr(ext,'need_fcompiler_opts',0)
        ext_name = string.split(ext.name,'.')[-1]

        if self.distribution.has_f_libraries():
            build_flib = self.get_finalized_command('build_flib')
            if build_flib.has_f_library(ext_name):
                need_f_libs = 1
            else:
                for lib_name in ext.libraries:
                    if build_flib.has_f_library(lib_name):
                        need_f_libs = 1
                        break
        elif need_f_opts:
            build_flib = self.get_finalized_command('build_flib')
<commit_msg>MSVC did not have a linker_so variable defined.  This defines a dummy value for it (set to None) so that scipy_base can be built and used with MSVC.  Other pure C modules will also work with MSVC.  C/Fortran will have to wait so that we can work out any linker issues.<commit_after>""" Modified version of build_ext that handles fortran source files.
"""

import os, string
from types import *

from distutils.dep_util import newer_group, newer
from distutils.command.build_ext import build_ext as old_build_ext

from scipy_distutils.command.build_clib import get_headers,get_directories

class build_ext (old_build_ext):

    def build_extension(self, ext):
        
        # The MSVC compiler doesn't have a linker_so attribute.
        # Giving it a dummy one of None seems to do the trick.
        if not hasattr(self.compiler,'linker_so'):
            self.compiler.linker_so = None
            
        #XXX: anything else we need to save?
        save_linker_so = self.compiler.linker_so
        save_compiler_libs = self.compiler.libraries
        save_compiler_libs_dirs = self.compiler.library_dirs
        
        # support for building static fortran libraries
        need_f_libs = 0
        need_f_opts = getattr(ext,'need_fcompiler_opts',0)
        ext_name = string.split(ext.name,'.')[-1]

        if self.distribution.has_f_libraries():
            build_flib = self.get_finalized_command('build_flib')
            if build_flib.has_f_library(ext_name):
                need_f_libs = 1
            else:
                for lib_name in ext.libraries:
                    if build_flib.has_f_library(lib_name):
                        need_f_libs = 1
                        break
        elif need_f_opts:
            build_flib = self.get_finalized_command('build_flib')

{'fraction_non_alphanumeric': 0.06545690213869086, 'fraction_numerical': 0.0032404406999351912, 'mean_word_length': 2.492081447963801, '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': '7232074', 'n_tokens_mistral': 945, 'n_tokens_neox': 903, 'n_words': 243}