Thanks Naoki,
I've solved the problem adding --enable-shared, but I also had to add the
option for unicode UCS4, otherwise even if Python compiles, for some reason
the SSL library is not working (the command python -c "import ssl;" fails
and couldn't install PIP).

It's also important that the prefix directory (in my case /opt/python2.7)
is empty or doesn't contain previous build done without enable-shared,
otherwise the build fails.

The command to compile in Ubuntu 14.04 is:

./configure --prefix=/opt/python2.7--enable-shared --enable-unicode=ucs4

Then you build or uWSGI the plugins as in my first email.
Kind regards
Francesco


On Wed, Jul 29, 2015 at 3:08 PM, jean-pierre bouquillon <
[email protected]> wrote:

>  My Jessie Debian:
>
> $ sudo apt-get install rsync ufw fail2ban locate apt-listbugs
> $ sudo apt-get install build-essential
> $ sudo apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev
> $ sudo apt-get install  libgdbm-dev libsqlite3-dev libssl-dev
> $ sudo apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
> $ sudo apt-get installlibpq-dev
> $ sudo apt-get install libpcre3 libpcre3-dev
> $ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev
> libfreetype6-dev liblcms2-dev libwebp-dev
> $ sudo apt-get install libpq-dev # install pgsql !!
>
> $ sudo apt-get install tk tcl tk-dev tcl-dev
>
> $ sudo apt-get install tree cmake git curl png23d pngmeta pngnq pngquant
> tkpng
>
> ## with Apache-2.4.10
> $ sudo apt-get install libapache2-mod-uwsgi
>
> $ sudo apt-get install doxygen
>
> ## install openjpg
> $ cd Downloads/Openjpg210
>
> $ cmake .
> $ make
> $ sudo make install
> $ make clean
>
> ## compil Python-3.4.3
> $ tar -zxf /path/to/your/Python-3.4.3.tgz
> $ cd Python-3.4.3
>
>  ./configure --prefix=/opt/python-3.4.3  --without-ensurepip
> --with-universal-archs='64-bit'
>
> ## sorry for bad english
>
>
> Le 29/07/2015 10:44, INADA Naoki a écrit :
>
>
>
> On Tue, Jul 28, 2015 at 6:03 PM, Francesco Amelio <[email protected]>
> wrote:
>
>>  ​Dear All,
>>  I'm trying to compile ​uwsgi as core and then add on top the plugins
>> for Python 2.7 and Python 3.4 in order to make them work together under the
>> same emperor.
>>
>>  I'm using Ubuntu 14.04 LTS (Linux XXXX 3.14.32-xxxx-grs-ipv6-64 #1 SMP
>> Sat Feb 7 11:35:27 CET 2015 x86_64 x86_64 x86_64 GNU/Linux) with the two
>> Python versions compiled manually with the following configure command:
>>
>> For Python 2.7.10
>> ./configure --prefix=/opt/python2.7
>>
>>
>  ​Add --enable-shared option to configure.​
>
>
>
>>  For Python 3.4.0
>> ./configure --prefix=/opt/python3.4
>>
>> ​Using uWSGI version 2.0.11.1
>>
>>  I first build the uWSGI core with the following command:
>> /opt/python2.7/bin/python uwsgiconfig.py --build core
>>
>>  then I build the Python plugins:
>> PYTHON=/opt/python2.7/bin/python ./uwsgi --build-plugin "plugins/python
>> python27"
>>
>> and I get the following error:
>>
>> *** uWSGI building and linking plugin from plugins/python ***
>> [gcc -pthread] python27_plugin.so
>> /usr/bin/ld:
>> /opt/python2.7/lib/python2.7/config/libpython2.7.a(abstract.o): *relocation
>> R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making
>> a shared object; recompile with -fPIC*
>> /opt/python2.7/lib/python2.7/config/libpython2.7.a: error adding symbols:
>> Bad value
>> collect2: error: ld returned 1 exit status
>> *** unable to build python27 plugin ***
>>
>>  The same happpens with the other command:
>> /opt/python2.7/bin/python uwsgiconfig.py --plugin plugins/python
>> using profile: buildconf/default.ini
>> detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/4.8/include',
>> '/usr/local/include', '/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed',
>> '/usr/include/x86_64-linux-gnu', '/usr/include']
>> *** uWSGI building and linking plugin plugins/python ***
>> [gcc -pthread] ./python_plugin.so
>> /usr/bin/ld:
>> /opt/python2.7/lib/python2.7/config/libpython2.7.a(abstract.o): *relocation
>> R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making
>> a shared object; recompile with -fPIC*
>> /opt/python2.7/lib/python2.7/config/libpython2.7.a: error adding symbols:
>> Bad value
>> collect2: error: ld returned 1 exit status
>> *** unable to build python plugin ***
>>
>>  While it's working with Python 3.4
>> PYTHON=/opt/python3.4/bin/python3 ./uwsgi --build-plugin "plugins/python
>> python34"
>> *** uWSGI building and linking plugin from plugins/python ***
>> [gcc -pthread] python34_plugin.so
>> build time: 3 seconds
>> *** python34 plugin built and available in python34_plugin.so ***
>>  ​
>> ​Do you have any idea why I get this error? Am I missing some
>> configuration parameter before the  Python compilation?​
>>
>> ​Kind regards
>>  Francesco​
>>
>>
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>
>>
>
>
>  --
> INADA Naoki  <[email protected]>
>
>
> _______________________________________________
> uWSGI mailing 
> [email protected]http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
>
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to