Hi All,
I’m trying to install zeek broker python module using python3.11 on a red hat system. I’m following the official zeek documentation here 6. Python Bindings — Broker User Manual
which includes the steps:
virtualenv -p python3 /Users/user/sandbox/broker/venv
. /Users/user/sandbox/broker/venv/bin/activate
./configure --prefix=/Users/user/sandbox/broker --python-prefix=(python3 -c ‘import sys; print(sys.exec_prefix)’)
make install
python3 -c ‘import broker; print(broker.file)’
/Users/user/sandbox/broker/venv/lib/python3.7/site-packages/broker/init.py
It works perfectly of python3.6 and I was successfully able to use broker module in python but as soon as I switched to python3.11 the compilation failed at this step:
[ 21%] Building CXX object auxil/broker/bindings/python/CMakeFiles/_broker.dir/_broker.cpp.o
[ 21%] Building CXX object auxil/broker/bindings/python/CMakeFiles/_broker.dir/data.cpp.o
[ 21%] Building CXX object auxil/broker/bindings/python/CMakeFiles/_broker.dir/enums.cpp.o
[ 21%] Building CXX object auxil/broker/bindings/python/CMakeFiles/_broker.dir/store.cpp.o
[ 21%] Building CXX object auxil/broker/bindings/python/CMakeFiles/_broker.dir/zeek.cpp.o
[ 21%] Linking CXX shared module …/…/python/broker/_broker.so
/usr/bin/ld: /usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/libpython3.11.a(abstract.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/libpython3.11.a(boolobject.o): relocation R_X86_64_32S against symbol
_Py_TrueStruct’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/libpython3.11.a(bytearrayobject.o): relocation R_X86_64_32S against symbol `PyByteArray_Type’ can not be used when making a shared object; recompile with -fPIC
I tried by putting CXXFLAGS=‘-fPIC’ while running the configure command but that also gave the same error. What can be the reason for that?
Thanks,