compilation error: expected expression when handling typeconv.cpp on mac
See original GitHub issueReporting a bug
- I have tried using the latest released version of Numba (most recent is visible in the change log (https://github.com/numba/numba/blob/main/CHANGE_LOG).
- I have included a self contained code sample to reproduce the problem. i.e. it’s possible to run as ‘python bug.py’.
Code
I build numba main branch code on my x86_64 mac machine, but get a compilation error.
Compilation errors
(numba-dev) ➜ numba (main✔)python setup.py build_ext --inplace
TBB not found
OpenMP not found
/Users/ld/opt/anaconda3/envs/numba-dev/lib/python3.8/site-packages/setuptools/dist.py:530: UserWarning: The version specified ('cuda-dispatcher-base+1148.g15e487886') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
warnings.warn(
running build_ext
building 'numba._dynfunc' extension
Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.
C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ld/opt/anaconda3/envs/numba-dev/include -arch x86_64 -I/Users/ld/opt/anaconda3/envs/numba-dev/include -arch x86_64
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/numba
compile options: '-I/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8 -c'
gcc: numba/_dynfuncmod.c
In file included from numba/_dynfuncmod.c:1:
numba/_dynfunc.c:143:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
In file included from numba/_dynfuncmod.c:1:
numba/_dynfunc.c:253:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
In file included from numba/_dynfuncmod.c:1:
numba/_dynfunc.c:470:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
3 warnings generated.
gcc -bundle -undefined dynamic_lookup -L/Users/ld/opt/anaconda3/envs/numba-dev/lib -arch x86_64 -L/Users/ld/opt/anaconda3/envs/numba-dev/lib -arch x86_64 build/temp.macosx-10.9-x86_64-3.8/numba/_dynfuncmod.o -o /Users/ld/Code/numba/numba/_dynfunc.cpython-38-darwin.so
building 'numba._dispatcher' extension
C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ld/opt/anaconda3/envs/numba-dev/include -arch x86_64 -I/Users/ld/opt/anaconda3/envs/numba-dev/include -arch x86_64
creating build/temp.macosx-10.9-x86_64-3.8/numba/core
creating build/temp.macosx-10.9-x86_64-3.8/numba/core/typeconv
compile options: '-I/Users/ld/opt/anaconda3/envs/numba-dev/lib/python3.8/site-packages/numpy/core/include -I/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8 -c'
gcc: numba/_dispatcher.cpp
gcc: numba/_typeof.c
gcc: numba/core/typeconv/typeconv.cpp
gcc: numba/_hashtable.c
numba/core/typeconv/typeconv.cpp:30:19: error: expected expression
bin.push_back({key, val});
^
numba/_dispatcher.cpp:1104:37: warning: offset of on non-POD type 'Dispatcher' [-Winvalid-offsetof]
{(char*)"_can_compile", T_BOOL, offsetof(Dispatcher, can_compile), 0, NULL },
^ ~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
^ ~
numba/_dispatcher.cpp:1163:5: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
1 error generated.
2 warnings generated.
error: Command "gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ld/opt/anaconda3/envs/numba-dev/include -arch x86_64 -I/Users/ld/opt/anaconda3/envs/numba-dev/include -arch x86_64 -I/Users/ld/opt/anaconda3/envs/numba-dev/lib/python3.8/site-packages/numpy/core/include -I/Users/ld/opt/anaconda3/envs/numba-dev/include/python3.8 -c numba/core/typeconv/typeconv.cpp -o build/temp.macosx-10.9-x86_64-3.8/numba/core/typeconv/typeconv.o" failed with exit status 1
Extra conda env
(numba-dev) ➜ numba (main✔)python
Python 3.8.13 (default, Mar 28 2022, 06:16:26)
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
(numba-dev) ➜ numba (main✔)gcc -v
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Updates: If I switch to release0.55 branch, compilation is passed without any error.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Basic C++ question(error: expected expression '{' )
I am new to C++, and I was working on this practice problem where I was asked to create a dynamic array. However,...
Read more >Why am I getting the 'expected expression' error?
Hi,. I'm writing a program in Xcode about Fibonacci Series. When I use the for statement, I keep getting the error "expected expression"...
Read more >Compiler Error CS1733 - Microsoft Learn
Expected expression. This error is produced whenever the compiler is expecting an expression on the line where the error occurred. In the ...
Read more >Xcode displaying false code error messages ('Expected ...
I'm using Xcode 9.3 on macOS 10.13.4 on a Mac Mini with 16 GB of RAM. I frequently get false code error messages...
Read more >What does it mean I get a compiler error like 'expected ... - Quora
The compiler wants to see an expression after the equals sign, not a type name, since it doesn't know how to assign your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gmarkall , many thanks, I tried ur thought (switch to ur branch and set
CXX=g++
), but still got this error.Given I guess this issue has been fixed by https://github.com/numba/numba/pull/8389, close it now.