We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When doing development work on Windows, I see a warning about 'COMPILER': macro redefinition when I build astropy from source. Probably harmless?
'COMPILER': macro redefinition
astropy
No redefinition of COMPILER macro in C.
COMPILER
Searching for cython>=0.29.13 Best match: cython 0.29.13 Processing cython-0.29.13-py3.7-win-amd64.egg Using ...\astropy\.eggs\cython-0.29.13-py3.7-win-amd64.egg running test installing to temporary directory: ... _compiler.c astropy\_compiler.c(58): warning C4005: 'COMPILER': macro redefinition c:\...\envs\py37\include\pyconfig.h(126): note: see previous definition of 'COMPILER' Creating library ...\astropy\compiler_version.cp37-win_amd64.lib and object ...\astropy\compiler_version.cp37-win_amd64.exp Generating code Finished generating code
#include <Python.h> /*************************************************************************** * Macros for determining the compiler version. * * These are borrowed from boost, and majorly abridged to include only * the compilers we care about. ***************************************************************************/ #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #if defined __clang__ /* Clang C++ emulates GCC, so it has to appear early. */ # define COMPILER "Clang version " __clang_version__ #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) /* Intel */ # if defined(__INTEL_COMPILER) # define INTEL_VERSION __INTEL_COMPILER # elif defined(__ICL) # define INTEL_VERSION __ICL # elif defined(__ICC) # define INTEL_VERSION __ICC # elif defined(__ECC) # define INTEL_VERSION __ECC # endif # define COMPILER "Intel C compiler version " STRINGIZE(INTEL_VERSION) #elif defined(__GNUC__) /* gcc */ # define COMPILER "GCC version " __VERSION__ #elif defined(__SUNPRO_CC) /* Sun Workshop Compiler */ # define COMPILER "Sun compiler version " STRINGIZE(__SUNPRO_CC) #elif defined(_MSC_VER) /* Microsoft Visual C/C++ Must be last since other compilers define _MSC_VER for compatibility as well */ # if _MSC_VER < 1200 # define COMPILER_VERSION 5.0 # elif _MSC_VER < 1300 # define COMPILER_VERSION 6.0 # elif _MSC_VER == 1300 # define COMPILER_VERSION 7.0 # elif _MSC_VER == 1310 # define COMPILER_VERSION 7.1 # elif _MSC_VER == 1400 # define COMPILER_VERSION 8.0 # elif _MSC_VER == 1500 # define COMPILER_VERSION 9.0 # elif _MSC_VER == 1600 # define COMPILER_VERSION 10.0 # else # define COMPILER_VERSION _MSC_VER # endif # define COMPILER "Microsoft Visual C++ version " STRINGIZE(COMPILER_VERSION) #else /* Fallback */ # define COMPILER "Unknown compiler" #endif /*************************************************************************** * Module-level ***************************************************************************/ struct module_state { /* The Sun compiler can't handle empty structs */ #if defined(__SUNPRO_C) || defined(_MSC_VER) int _dummy; #endif }; static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "compiler_version", NULL, sizeof(struct module_state), NULL, NULL, NULL, NULL, NULL }; #define INITERROR return NULL PyMODINIT_FUNC PyInit_compiler_version(void) { PyObject* m; m = PyModule_Create(&moduledef); if (m == NULL) INITERROR; PyModule_AddStringConstant(m, "compiler", COMPILER); return m; }
Windows-10-10.0.18362-SP0 Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 19:01:41) [MSC v.1900 64 bit (AMD64)] Numpy 1.16.3 Scipy 1.1.0 astropy 4.0.dev26224
The text was updated successfully, but these errors were encountered:
I've also seen this before. Do you happen to know the definition before (python) and after (ours)?
Sorry, something went wrong.
(off topic, but I totally forgot about this label of ours :) )
@MSeifert04 , "ours" is the one defined in _compiler.c above. Here is the one from pyconfig.h:
_compiler.c
pyconfig.h
/* set the COMPILER */ #ifdef MS_WIN64 #if defined(_M_X64) || defined(_M_AMD64) #if defined(__INTEL_COMPILER) #define COMPILER ("[ICC v." _Py_STRINGIZE(__INTEL_COMPILER) " 64 bit (amd64) with MSC v." _Py_STRINGIZE(_MSC_VER) " CRT]") #else #define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)") #endif /* __INTEL_COMPILER */ #define PYD_PLATFORM_TAG "win_amd64" #else #define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)") #endif #endif /* MS_WIN64 */
And it is provided by CPython manually at https://github.com/python/cpython/blob/master/PC/pyconfig.h
No branches or pull requests
Description
When doing development work on Windows, I see a warning about
'COMPILER': macro redefinition
when I buildastropy
from source. Probably harmless?Expected behavior
No redefinition of
COMPILER
macro in C.Actual behavior
_compiler.c
System Details
Windows-10-10.0.18362-SP0
Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 19:01:41) [MSC v.1900 64 bit (AMD64)]
Numpy 1.16.3
Scipy 1.1.0
astropy 4.0.dev26224
The text was updated successfully, but these errors were encountered: