<commit_before>from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
from setuptools import find_packages

import numpy

import os
MKLROOT = os.environ['MKLROOT']

setup(
    name='magpy',
    version='0.1dev',
    packages=find_packages(),
    ext_modules= cythonize(Extension(
        name='magpy.core',
        sources=["magpy/core.pyx"],
        language='c++',
        extra_compile_args=[
            "-std=c++11", '-pthread', '-O3','-fopenmp', '-simd', '-qopenmp', '-xHost',
            '-DUSEMKL', '-DMKL_ILP64', '-I{}/include'.format(MKLROOT)],
        extra_link_args=[
            '-std=c++11', '-pthread', '-fopenmp', '-qopenmp',
            '-Wl,--start-group', '{}/lib/intel64/libmkl_intel_ilp64.a'.format(MKLROOT),
            '{}/lib/intel64/libmkl_sequential.a'.format(MKLROOT),
            '{}/lib/intel64/libmkl_core.a'.format(MKLROOT), '-Wl,--end-group',
            '-lpthread', '-lm', '-ldl'],
        libraries=['moma', 'm', 'dl', 'pthread'],
        library_dirs=['.', '{}/lib/intel64'.format(MKLROOT)],
        include_dirs=[numpy.get_include(), './include']
    ))
)<commit_msg>add gcc build for magpy package<commit_after>from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
from setuptools import find_packages
import shutil

import numpy

import os

# Check compiler
CXX = os.environ['CXX']

# INTEL ARGUMENTS
USE_INTEL = CXX=='icpc'
MKLROOT = os.environ['MKLROOT'] if 'MKLROOT' in os.environ else False
intel_compile_args = [
    "-std=c++11", '-pthread', '-O3','-fopenmp', '-simd', '-qopenmp', '-xHost',
    '-DUSEMKL', '-DMKL_ILP64', '-I{}/include'.format(MKLROOT)
]
intel_link_args = [
    '-std=c++11', '-pthread', '-fopenmp', '-qopenmp',
    '-Wl,--start-group', '{}/lib/intel64/libmkl_intel_ilp64.a'.format(MKLROOT),
    '{}/lib/intel64/libmkl_sequential.a'.format(MKLROOT),
    '{}/lib/intel64/libmkl_core.a'.format(MKLROOT), '-Wl,--end-group',
    '-lpthread', '-lm', '-ldl'
]
intel_libs = ['moma', 'm', 'dl', 'pthread']


# GNU ARGUMENTS
gnu_compile_args = ["-std=c++11", '-pthread', '-O3', '-fopenmp']
gnu_link_args = [
    '-std=c++11', '-pthread', '-fopenmp', '-llapacke', '-lblas'
]
gnu_libs = ['moma', 'pthread', 'lapacke', 'blas']

setup(
    name='magpy',
    version='0.1dev',
    packages=find_packages(),
    ext_modules= cythonize(Extension(
        name='magpy.core',
        sources=["magpy/core.pyx"],
        language='c++',
        extra_compile_args= intel_compile_args if USE_INTEL else gnu_compile_args,
        extra_link_args= intel_link_args if USE_INTEL else gnu_link_args,
        libraries=intel_libs if USE_INTEL else gnu_libs,
        library_dirs=['.', '{}/lib/intel64'.format(MKLROOT)],
        include_dirs=[numpy.get_include(), './include']
    ))
)
{'fraction_non_alphanumeric': 0.18762886597938144, 'fraction_numerical': 0.014776632302405498, 'mean_word_length': 3.606012658227848, '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': '1928384', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1073, 'n_words': 189}