'Import Error Occurs when Building GEM5 : undefined symbol
I am trying to follow default "Getting Started with GEM5" at the gem5.org
But build fails because of import error.
Especially, it seems /usr/local/lib/python3.6/lib-dynload/_struct.cpython-36m-x86_64-linux-gnu.so has issues.
It causes some undefined symbol errors(PyExc_MemoryError, PyByteArray_Type, etc.).
My env. are here. Python 3.6.13 SCons 4.2.0 gcc 7.5.0 OS Ubuntu 16.0.4
Thanks for ur help ahead.
Followings are my console command and logs.
$ scons build/ARM/gem5.opt -j 4
scons: Reading SConscript files ...
Checking for linker -Wl,--as-needed support... (cached) yes
Checking for compiler -Wno-free-nonheap-object support... (cached) yes
Checking for compiler -gz support... (cached) yes
Checking for linker -gz support... (cached) yes
Info: Using Python config: python3-config
Checking for C header file Python.h... (cached) yes
Checking Python version... (cached) 3.6.13
Checking for accept(0,0,0) in C++ library None... (cached) yes
Checking for zlibVersion() in C++ library z... (cached) yes
Checking for C library tcmalloc... (cached) yes
Checking for C header file linux/if_tun.h... (cached) yes
Checking for char temp; backtrace_symbols_fd((void *)&temp, 0, 0) in C library None... (cached) yes
Checking for C header file fenv.h... (cached) yes
Checking for C header file png.h... (cached) yes
Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) yes
Checking for C header file valgrind/valgrind.h... (cached) no
Warning: Deprecated namespaces are not supported by this compiler.
Please make sure to check the mailing list for deprecation announcements.
Checking for pkg-config package hdf5-serial... (cached) no
Checking for pkg-config package hdf5... (cached) no
Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) no
Warning: Couldn't find HDF5 C++ libraries. Disabling HDF5 support.
Checking for pkg-config package protobuf... (cached) yes
Checking for GOOGLE_PROTOBUF_VERIFY_VERSION in C++ library protobuf... (cached) yes
Checking for shm_open("/test", 0, 0) in C library None... (cached) no
Checking for shm_open("/test", 0, 0) in C library rt... (cached) yes
Checking for C header file linux/kvm.h... (cached) yes
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... (cached) yes
Checking size of struct kvm_xsave ... (cached) yes
Checking for member exclude_host in struct perf_event_attr...(cached) yes
Checking whether __i386__ is declared... (cached) no
Checking whether __x86_64__ is declared... (cached) yes
Building in /home/md1-03/thlim/gem5/build/ARM
Using saved variables file /home/md1-03/thlim/gem5/build/variables/ARM
Checking for compiler -Wno-self-assign-overloaded support... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[EMBED PY] ARM/dev/Device.py -> .cc
terminate called after throwing an instance of 'pybind11::error_already_set'
what(): ImportError: /usr/local/lib/python3.6/lib-dynload/zlib.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_MemoryError
At:
build_tools/marshal.py(53): <module>
[ TRACING] -> ARM/debug/AddrRanges.hh
[EMBED PY] ARM/dev/IntPin.py -> .cc
[EMBED PY] ARM/dev/Platform.py -> .cc
terminate called after throwing an instance of 'pybind11::error_already_set'
what(): ImportError: /usr/local/lib/python3.6/lib-dynload/_struct.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyByteArray_Type
At:
/usr/local/lib/python3.6/struct.py(13): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(678): exec_module
<frozen importlib._bootstrap>(665): _load_unlocked
<frozen importlib._bootstrap>(955): _find_and_load_unlocked
<frozen importlib._bootstrap>(971): _find_and_load
/usr/local/lib/python3.6/gettext.py(49): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(678): exec_module
<frozen importlib._bootstrap>(665): _load_unlocked
<frozen importlib._bootstrap>(955): _find_and_load_unlocked
<frozen importlib._bootstrap>(971): _find_and_load
/usr/local/lib/python3.6/argparse.py(93): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(678): exec_module
<frozen importlib._bootstrap>(665): _load_unlocked
<frozen importlib._bootstrap>(955): _find_and_load_unlocked
<frozen importlib._bootstrap>(971): _find_and_load
build_tools/debugflaghh.py(38): <module>
terminate called after throwing an instance of 'pybind11::error_already_set'
what(): ImportError: /usr/local/lib/python3.6/lib-dynload/zlib.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_MemoryError
At:
build_tools/marshal.py(53): <module>
terminate called after throwing an instance of 'pybind11::error_already_set'
what(): ImportError: /usr/local/lib/python3.6/lib-dynload/zlib.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_MemoryError
At:
build_tools/marshal.py(53): <module>
Aborted (core dumped)
scons: *** [build/ARM/dev/Device.py.cc] Error 134
Aborted (core dumped)
scons: *** [build/ARM/debug/AddrRanges.hh] Error 134
Aborted (core dumped)
scons: *** [build/ARM/dev/IntPin.py.cc] Error 134
Aborted (core dumped)
scons: *** [build/ARM/dev/Platform.py.cc] Error 134
scons: building terminated because of errors.
*** Summary of Warnings ***
Warning: Deprecated namespaces are not supported by this compiler.
Please make sure to check the mailing list for deprecation announcements.
Warning: Couldn't find HDF5 C++ libraries. Disabling HDF5 support.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
