I compile the uwsgi version x.y.zz.ww from the oficial site, i compiled the uwsgi with the command suggested from the official documentation
And then I compiled the plugins suggested for Python with the commands in the official documentation, the error output I get is this:
>ubuntu@ip-xx-yy-zz-ww:~/tmp/uwsgi-xx.yy.zz.ww$ PYTHON=python3.4 ./uwsgi --build-plugin "plugins/python python34"
*** uWSGI building and linking plugin from plugins/python ***
[gcc -pthread] python34_plugin.so
/usr/bin/ld: /usr/local/lib/python3.4/config-3.4m/libpython3.4m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python3.4/config-3.4m/libpython3.4m.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
*** unable to build python34 plugin ***
The alternative to use uwsgi without compiling it from the source is using pip3 install uwsgi, in this case the plugins are compiled in the folder plugins/python/python_plugin.o but can't find it. I'm using virtualenv for the project, the plugins compile must be on the root or inside the virtualenv enviroment in the lib folder ?
uWSGI presents a complete stack for networked/clustered web applications, implementing message/object passing, caching, RPC and process management. It is designed to be fully modular.
It's possible to compile an uWSGI plugin using the official Python 3.7 package, and we will see how to do it step by step.
Configuration. Web applications served by uWSGI are configured in /etc/uwsgi/ , where each of them requires its own configuration file (ini-style). Details can be found in the uWSGI documentation. Alternatively, you can run uWSGI in Emperor mode (configured in /etc/uwsgi/emperor.
Old question but for future reference here is what I had done:
/usr/bin/ld: /usr/local/lib/python3.4/config-3.4m/libpython3.4m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
This line implies that you need a python build with the flag: -fPIC
, so I uninstalled the python version and rebuild with this flag on.
Export the flag before build like this:
export CFLAGS="$CFLAGS -fPIC"
alternatively if you are using pyenv
env PYTHON_CFLAGS=-fPIC pyenv install 3.5.x
Now using this python, you can compile a python plugin:
python uwsgiconfig.py --plugin plugins/python core python35
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With