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: