@@ -371,23 +371,11 @@ def add_compile_configvars():
371
371
372
372
if rc == 0 and config .cxx != "" :
373
373
# Keep the default linker the same as the one for the mode FAST_RUN
374
- config .add (
375
- "linker" ,
376
- "Default linker used if the pytensor flags mode is Mode" ,
377
- EnumStr (
378
- "cvm" , ["c|py" , "py" , "c" , "c|py_nogc" , "vm" , "vm_nogc" , "cvm_nogc" ]
379
- ),
380
- in_c_key = False ,
381
- )
374
+ linker_options = ["c|py" , "py" , "c" , "c|py_nogc" , "vm" , "vm_nogc" , "cvm_nogc" ]
382
375
else :
383
376
# g++ is not present or the user disabled it,
384
377
# linker should default to python only.
385
- config .add (
386
- "linker" ,
387
- "Default linker used if the pytensor flags mode is Mode" ,
388
- EnumStr ("vm" , ["py" , "vm_nogc" ]),
389
- in_c_key = False ,
390
- )
378
+ linker_options = ["py" , "vm_nogc" ]
391
379
if type (config ).cxx .is_default :
392
380
# If the user provided an empty value for cxx, do not warn.
393
381
_logger .warning (
@@ -397,6 +385,13 @@ def add_compile_configvars():
397
385
"To remove this warning, set PyTensor flags cxx to an empty string."
398
386
)
399
387
388
+ config .add (
389
+ "linker" ,
390
+ "Default linker used if the pytensor flags mode is Mode" ,
391
+ EnumStr ("cvm" , linker_options ),
392
+ in_c_key = False ,
393
+ )
394
+
400
395
# Keep the default value the same as the one for the mode FAST_RUN
401
396
config .add (
402
397
"allow_gc" ,
0 commit comments