From 9094f28dbdcd0b3cd10c1893ce9cf22c985bba18 Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Sat, 22 Feb 2025 21:16:00 +0100 Subject: [PATCH] split NVCC_FLAGS but not quoted string In case NVCC_FLAGS contains something like --compiler-options \"-march=native -O2 -pipe\" the quoted parts needs to stay entirely (not splitted) --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a949db9a24e..304ebd0aaac 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ import subprocess import sys import warnings +import shlex from pathlib import Path import torch @@ -123,7 +124,7 @@ def get_macros_and_flags(): if NVCC_FLAGS is None: nvcc_flags = [] else: - nvcc_flags = NVCC_FLAGS.split(" ") + nvcc_flags = shlex.split(NVCC_FLAGS) extra_compile_args["nvcc"] = nvcc_flags if sys.platform == "win32":