diff --git a/buildscripts/build.py b/buildscripts/build.py index 51ea35e5f..1dbc8e13b 100644 --- a/buildscripts/build.py +++ b/buildscripts/build.py @@ -72,6 +72,6 @@ def build(sdc_utils): sdc_env_packages += ['conda-verify', 'vc', 'vs2015_runtime', 'vs2015_win-64', 'pywin32=223'] # Install conda-build and other packages from anaconda channel due to issue with wheel # output build if use intel channels first - sdc_utils.create_environment(sdc_env_packages + ['-c', 'anaconda']) + sdc_utils.create_environment(sdc_env_packages) build(sdc_utils) diff --git a/buildscripts/utilities.py b/buildscripts/utilities.py index cf770b6dd..6b5cff2d8 100644 --- a/buildscripts/utilities.py +++ b/buildscripts/utilities.py @@ -51,7 +51,7 @@ def __init__(self, python, channels=None, sdc_channel=None): self.line_single = '-'*80 # Set channels - build_channels = ['-c', 'defaults', '-c', 'conda-forge'] + build_channels = ['-c', 'main', '-c', 'conda-forge', '-c', 'defaults'] self.channel_list = build_channels if channels is None else channels.split() if sdc_channel: self.sdc_channel = Path(sdc_channel).resolve().as_uri() diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 20b9894e8..f2740d92a 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -19,7 +19,7 @@ requirements: build: - {{ compiler('c') }} # [not osx] - {{ compiler('cxx') }} # [not osx] - - numba {{ NUMBA_VERSION }} + - sysroot_linux-64 >=2.17 # [linux] host: - python diff --git a/setup.py b/setup.py index c717bf235..f3c8abbfb 100644 --- a/setup.py +++ b/setup.py @@ -48,6 +48,7 @@ np_compile_args = np_misc.get_info('npymath') is_win = platform.system() == 'Windows' +is_osx = platform.system() == 'Darwin' def readme(): @@ -108,11 +109,21 @@ def check_file_at_path(path2file): tbb_root = os.getenv('TBBROOT') if not tbb_root: tbb_root = check_file_at_path(['include', 'tbb', 'tbb.h']) + assert tbb_root, "TBB headers required to build SDC not found" ind = [PREFIX_DIR + '/include', ] lid = [PREFIX_DIR + '/lib', ] -eca = ['-std=c++11', "-O3", "-DTBB_PREVIEW_WAITING_FOR_WORKERS=1"] # '-g', '-O0'] -ela = ['-std=c++11', ] + +if is_win: + eca = ['/std:c++17', "/Ox", "/DTBB_PREVIEW_WAITING_FOR_WORKERS=1", ] # "/Zi", "/Od", "/DEBUG:FULL"] + ela = [] # '/DEBUG:FULL', ] +else: + eca = ['-std=c++17', "-O3", "-DTBB_PREVIEW_WAITING_FOR_WORKERS=1", ] # '-g', '-O0'] + ela = [] + + # On macOS, c++17 flag is ignored unless this flag is also passed to distutils + if is_osx: + eca += ["-fno-aligned-allocation"] io_libs = [] @@ -202,8 +213,8 @@ def check_file_at_path(path2file): sources=["sdc/_datetime_ext.cpp"], libraries=np_compile_args['libraries'], define_macros=np_compile_args['define_macros'], - extra_compile_args=['-std=c++11'], - extra_link_args=['-std=c++11'], + extra_compile_args=eca, + extra_link_args=ela, include_dirs=np_compile_args['include_dirs'], library_dirs=np_compile_args['library_dirs'], language="c++"