From 5098002621ffcf6a9d3a3009b72f47b39608c597 Mon Sep 17 00:00:00 2001 From: kamo-naoyuki Date: Sun, 26 Apr 2020 23:44:07 +0900 Subject: [PATCH] change extra_compile_flag to -std=c++14: setup.py --- pytorch_binding/setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pytorch_binding/setup.py b/pytorch_binding/setup.py index b01cec9..ad960ea 100644 --- a/pytorch_binding/setup.py +++ b/pytorch_binding/setup.py @@ -1,3 +1,4 @@ +from distutils.version import LooseVersion import os import platform import sys @@ -5,7 +6,12 @@ import torch from torch.utils.cpp_extension import BuildExtension, CppExtension -extra_compile_args = ['-std=c++11', '-fPIC'] + +extra_compile_args = ['-fPIC'] +if LooseVersion(torch.__version__) >= LooseVersion("1.5.0"): + extra_compile_args += ['-std=c++14'] +else: + extra_compile_args += ['-std=c++11'] warp_rnnt_path = "../build" if torch.cuda.is_available() or "CUDA_HOME" in os.environ: