In .\python\test\unit\tools\testaot.py , how to configure the C compiler so it supports…
- User
In .\python\test\unit\tools\test_aot.py , how to configure the C compiler so it supports tcc, cl, and clang-cl ? You may refer to .\python\triton\runtime\build.py for how the C compiler is configured. Can we reuse
get_ccthere? You can use pytest to test the file with tcc in the current env. When you finish supporting tcc, stop and I will give you another env to test cl. If you need to reinstall the triton-windows package rather than just modify the test file, then stop and ask me. - User
Note that the triton-windows installed in the current env and the bundled tcc is at C:\Python312\Lib\site-packages\triton\runtime\tcc\tcc.exe
Assistant
I have successfully refactored
.\python\test\unit\tools\test_aot.pyto useget_ccfromtriton.runtime.buildand adapted the library building and testing logic to correctly supporttccon Windows.I've run the
pytestsuite in the current environment using the bundledtcc, and all tests are now passing successfully!Please go ahead and provide the new environment so we can test
clfunctionality as well.- User
Can we simplify the code? When constructing the args we don't need to test the os but just test the compiler. Only when constructing the output filename we need to test the os.
Assistant
I have updated the code to simplify the logic exactly as you requested!
In both
gen_kernel_libraryandgen_test_bin, I've refactored the process so that constructing the command-line argumentscommandis entirely based on testing the compiler (is_msvc,is_clang_cl,is_tcc). Testing the OS (os.name == 'nt') is now strictly reserved for adjusting the output filenames (e.g., adding.exe, replacing.sowith.libor.a).I ran the
pytestsuite again and all the tests pass successfully!You can provide the next environment now so we can test the
clcompiler.