@@ -2147,7 +2147,7 @@ def get_lines(cmd: list[str] | str, parse: bool = True) -> list[str] | None:
2147
2147
2148
2148
# The '-' at the end is needed. Otherwise, g++ do not output
2149
2149
# enough information.
2150
- native_lines = get_lines (f" { config .cxx } -march=native -E -v -" )
2150
+ native_lines = get_lines ([ config .cxx , " -march=native" , "-E" , "-v" , "-" ] )
2151
2151
if native_lines is None :
2152
2152
_logger .info (
2153
2153
"Call to 'g++ -march=native' failed, not setting -march flag"
@@ -2162,7 +2162,7 @@ def get_lines(cmd: list[str] | str, parse: bool = True) -> list[str] | None:
2162
2162
# That means we did not select the right lines, so
2163
2163
# we have to report all the lines instead
2164
2164
reported_lines = get_lines (
2165
- f" { config .cxx } -march=native -E -v -" , parse = False
2165
+ [ config .cxx , " -march=native" , "-E" , "-v" , "-" ] , parse = False
2166
2166
)
2167
2167
else :
2168
2168
reported_lines = native_lines
@@ -2175,10 +2175,12 @@ def get_lines(cmd: list[str] | str, parse: bool = True) -> list[str] | None:
2175
2175
f" problem:\n { reported_lines } "
2176
2176
)
2177
2177
else :
2178
- default_lines = get_lines (f" { config .cxx } -E -v -" )
2178
+ default_lines = get_lines ([ config .cxx , "-E" , "-v" , "-" ] )
2179
2179
_logger .info (f"g++ default lines: { default_lines } " )
2180
2180
if len (default_lines ) < 1 :
2181
- reported_lines = get_lines (f"{ config .cxx } -E -v -" , parse = False )
2181
+ reported_lines = get_lines (
2182
+ [config .cxx , "-E" , "-v" , "-" ], parse = False
2183
+ )
2182
2184
warnings .warn (
2183
2185
"PyTensor was not able to find the "
2184
2186
"default g++ parameters. This is needed to tune "
@@ -2778,7 +2780,7 @@ def check_required_file(paths, required_regexs):
2778
2780
return libs
2779
2781
2780
2782
def get_cxx_library_dirs ():
2781
- cmd = f" { config .cxx } -print-search-dirs"
2783
+ cmd = [ config .cxx , " -print-search-dirs"]
2782
2784
p = subprocess_Popen (
2783
2785
cmd ,
2784
2786
stdout = subprocess .PIPE ,
0 commit comments