Changing compiler

280 views
Skip to first unread message

Hikmat El Haj

unread,
Jul 22, 2022, 4:44:55 PM7/22/22
to cython-users
Hi

I was wondering on how you can change the compiler on windows with different visual studio versions

I know I can use the --compiler option, but I have tried a lot of keywords to select a different compiler but none works.

Does anyone know how to select the 2017 compiler? I have 2022 installed so it automatically uses 2022 version.

python setup.py build_ext --compiler "Visual Studio 15 2017" --inplace

With the above command I get this error: 
"error: don't know how to compile C/C++ code on platform 'nt' with 'Visual Studio 17 2022' compiler"

Stefan Behnel

unread,
Aug 1, 2022, 1:12:31 AM8/1/22
to cython...@googlegroups.com
Hi,

Hikmat El Haj schrieb am 22.07.22 um 21:14:
> I was wondering on how you can change the compiler on windows with
> different visual studio versions
>
> I know I can use the --compiler option, but I have tried a lot of keywords
> to select a different compiler but none works.
>
> Does anyone know how to select the 2017 compiler? I have 2022 installed so
> it automatically uses 2022 version.
>
> *python setup.py build_ext --compiler "Visual Studio 15 2017" --inplace*
>
> With the above command I get this error:
> "error: don't know how to compile C/C++ code on platform 'nt' with 'Visual
> Studio 17 2022' compiler"

This is a distutils/setuptools question and not a Cython question, but
you'd probably have to pass the path to the compiler's executable and not
its name into the "--compiler" argument.

Stefan
Reply all
Reply to author
Forward
0 new messages