KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
190 stars 49 forks source link

32-Bit Installation #22

Closed vincentleung58 closed 6 years ago

vincentleung58 commented 6 years ago

Python version 2.7.13 on 64 bit Centos 6.

CFLAGS=-m32 pip install pyq keeps yielding “src/pyq.o: could not read symbols: File in wrong format” error

sashkab commented 6 years ago

Please follow instructions on installing 32-bit PyQ on 64-bit Centos. Despite these instructions where written for CentOS 7, they can be followed to install working PyQ installation on CentOS 6.

vincentleung58 commented 6 years ago

So in that instruction, it basically described compiling 32bit Python and then pip install pyq. In my case, I installed via conda and already has running virtualenv for 32bit Python. This issue seems to arise from the command

gcc -pthread src/pyq.o ...

Where I couldn’t pass the -m32 flag in. In fact, pip install seemed to work for version 3.8.2 before my system caught on and force me to install 4.1.0 or above.

abalkin commented 6 years ago

We typically compile the pyq executable as 64bit even for the 32bit PyQ. Note that the pyq program is a glorified exec q python.q.

You can try adding the '-m32' flag to the CFLAGS variable in setup.py. I will look into making your scenario more straightforward.

sashkab commented 6 years ago

Where I couldn’t pass the -m32 flag

You don't need to, as long as you using 32-bit virtual environment with 32-bit kdb+.

vincentleung58 commented 6 years ago

I am using 64-but miniconda and installed 32bit Python. If I don’t pass in any flag, gcc throws me some error about LONG_BIT.

Anyways, solved it by adding the extra_postargs tag to the compiler.link_executable command in BuildExe class.

sashkab commented 6 years ago

@vincentleung58 do I understand correctly, you created 32-bit python virtual environment by running something like this?

export CONDA_FORCE_32BIT=1
conda create -n 32 python=2.7
vincentleung58 commented 6 years ago

Yep