Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

398
Visualizações
How do I compile and run 32-bit Python on 64-bit CentOS 6?

I need to run 32-bit Python in 64-bit CentOS.

Background

I have a PCI-GPIB interface card. Its drivers are from National Instruments. It says in the drivers page:

NI-488.2 version 2.9 supports 64-bit kernels. The driver may currently be used only from 32-bit applications.

Using the driver from Python

I use PyVISA wrapper to use the driver, like so:

import visa

However, I get the following error:

OSError: /usr/local/vxipnp/linux/bin/libvisa.so.7: wrong ELF class: ELFCLASS32

Question

National Instruments says that their driver supports 64-bit kernels. Good.
But it can only be used from within 32-bit applications. Bad. My Python installation (which I compiled myself) is 64-bit.

How do I compile 32-bit Python in 64-bit CentOS 6?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Here is how I built 32-bit Python 2.7.15 on CentOS 6.10:

Install required packages:

sudo yum install libgcc.i686 glibc-devel.i686 glibc.i686 zlib-devel.i686\
readline-devel.i686 gdbm-devel.i686 openssl-devel.i686 ncurses-devel.i686\ 
tcl-devel.i686 db4-devel.i686 bzip2-devel.i686

Build 32-bit Python:

mkdir ${HOME}/{Archive,Build}
wget http://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz -O ${HOME}/Archive/Python-2.7.15.tgz
tar xzvf ~/Archive/Python-2.7.15.tgz -C ${HOME}/Build
cd ${HOME}/Build/Python-2.7.15
[sudo] mkdir -p /opt/Python-2.7.15
CFLAGS=-m32 LDFLAGS=-m32 ./configure --prefix=/E/.sbx/Python-2.7.15 --enable-shared 
LD_RUN_PATH=/opt/Python-2.7.15/lib make
make install
over 4 years ago · Santiago Trujillo Relatório

0

If it's ok to run python from, for example, ~/tmp/Python-3.7.1, the following worked for me:

mkdir ~/tmp
cd ~/tmp
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
tar xzf Python-3.7.1.tgz
cd Python-3.7.1
CFLAGS=-m32 LDFLAGS=-m32 ./configure
make

And, of course, you'll need install the libraries & compiler for i686 first:

sudo yum install libgcc.i686 glibc-devel.i686 glibc.i686 zlib-devel.i686 readline-devel.i686 gdbm-devel.i686 openssl-devel.i686 ncurses-devel.i686 tcl-devel.i686 db4-devel.i686 bzip2-devel.i686 libffi-devel.i686

(added libffi-devel in comparison to other answer)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda