Incompatible libgmp.a error when building Pycrypto 2.6 - python

I have build the gmp 5.1.1 library using gcc 4.7.2 all in the Windows-7 environment.
I configured the build with ./configure and commanded the make and after finished the
make check without any errors.
However, when I put the resulting libgmp.a into the Python33/libs and lunch the
c:\Users\egargio\Downloads\pycrypto-2.6\pycrypto-2.6>c:\Python33\python setup.py
build_ext --compiler=mingw32
the following errors reporting incompatibility for libgmp.a occur:
c:\Users\egargio\Downloads\pycrypto-2.6\pycrypto-2.6>c:\Python33\python setup.py
build_ext --compiler=mingw32
running build_ext
running build_configure
building 'Crypto.PublicKey._fastmath' extension
C:\MinGW64\bin\gcc.exe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/
-Ic:\Python33\include -Ic:\Python33\include -c src/_fastmath.c -o build\temp.win
-amd64-3.3\Release\src\_fastmath.o
writing build\temp.win-amd64-3.3\Release\src\_fastmath.def
C:\MinGW64\bin\gcc.exe -shared -Wl,--enable-auto-image-base -s build\temp.win-am
d64-3.3\Release\src\_fastmath.o build\temp.win-amd64-3.3\Release\src\_fastmath.d
ef -Lc:\Python33\libs -Lc:\Python33\PCbuild\amd64 -lgmp -lpython33 -lmsvcr100 -o
build\lib.win-amd64-3.3\Crypto\PublicKey\_fastmath.pyd
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible c:\Python33\libs/libgmp.a when searching for
-lgmp
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible c:\Python33\libs\libgmp.a when searching for
-lgmp
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw3
2/bin/ld.exe: skipping incompatible c:\Python33\libs/libgmp.a when searching for
-lgmp
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw3
2/bin/ld.exe: cannot find -lgmp
collect2.exe: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Please any suggestions ? Thanks.
-- Giorgio

Related

error when I am trying to install pyaudio on Mac OS Ventura

I know this questions was asked couple of times, but all the answers do not work for me.
I get this error when I try to install PyAudio:
Building wheels for collected packages: pyaudio
WARNING: Ignoring --global-option when building pyaudio using PEP 517
Building wheel for pyaudio (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyaudio (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-cpython-39
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-cpython-39
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-cpython-39
creating build/temp.macosx-10.9-x86_64-cpython-39/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/usr/local/include -I/usr/include -I/Users/myname/PycharmProjects/a/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-cpython-39/src/_portaudiomodule.o
src/_portaudiomodule.c:31:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: Could not build wheels for pyaudio, which is required to install pyproject.toml-based projects
From what I can tell, it's ignoring the global portaudio and looking for another one ?
I removed and installed already portaudio with brew, I update everything, I installed command line for Xcode, I tried with anaconda in notebook, same error there as well. I already tried to installed wheel and said its fulfilled.
Where to put this portaudio file so it see it ?
Any suggestions to fix this error ?
Thanks

Can't find `lz4` header when installing `roslz4` with pip on a Mac

I'm trying to install roslz4 on my Mac, and I get the following error.
In file included from ros_comm/utilities/roslz4/src/_roslz4module.c:37:
include/roslz4/lz4s.h:38:10: fatal error: 'lz4.h' file not found
#include <lz4.h>
^~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
[end of output]
To counter this, I installed lz4 with brew which ran successfully
> brew install lz4
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/manifests/1.9.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/lz4/blobs/sha256:d222923849a6fefd391ab6705f1468c10d287c08ab9c4b5053a18a552139e262
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:d222923849a6fefd391ab6705f1468c10d287c08ab9c4b5053a18a552139e262?se=2022-06-14T22%3A20%3A00Z&s
######################################################################## 100.0%
==> Pouring lz4--1.9.3.arm64_monterey.bottle.tar.gz
🍺 /opt/homebrew/Cellar/lz4/1.9.3: 22 files, 620.6KB
==> Running `brew cleanup lz4`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
However, it does not appear to have resolved the problem.
Full pip output:
> pip install --extra-index-url https://rospypi.github.io/simple/ roslz4
Looking in indexes: https://pypi.org/simple, https://rospypi.github.io/simple/
Collecting roslz4
Using cached https://github.com/rospypi/simple/raw/any/roslz4/roslz4-1.14.3.post2.tar.gz (18 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: roslz4
Building wheel for roslz4 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-arm64-3.8
creating build/lib.macosx-10.14-arm64-3.8/roslz4
copying ros_comm/utilities/roslz4/src/roslz4/__init__.py -> build/lib.macosx-10.14-arm64-3.8/roslz4
running build_ext
building '_roslz4' extension
creating build/temp.macosx-10.14-arm64-3.8
creating build/temp.macosx-10.14-arm64-3.8/ros_comm
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DXXH_NAMESPACE=ROSLZ4_ -Iinclude -Iroscpp_core/cpp_common/include -I/Users/cmauceri/Workspace/run-mgmt/jupyter_venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c ros_comm/utilities/roslz4/src/_roslz4module.c -o build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src/_roslz4module.o -Wno-strict-prototypes -Wno-missing-field-initializers -Wno-unused-variable -Wno-strict-aliasing
In file included from ros_comm/utilities/roslz4/src/_roslz4module.c:37:
include/roslz4/lz4s.h:38:10: fatal error: 'lz4.h' file not found
#include <lz4.h>
^~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for roslz4
Running setup.py clean for roslz4
Failed to build roslz4
Installing collected packages: roslz4
Running setup.py install for roslz4 ... error
error: subprocess-exited-with-error
× Running setup.py install for roslz4 did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-arm64-3.8
creating build/lib.macosx-10.14-arm64-3.8/roslz4
copying ros_comm/utilities/roslz4/src/roslz4/__init__.py -> build/lib.macosx-10.14-arm64-3.8/roslz4
running build_ext
building '_roslz4' extension
creating build/temp.macosx-10.14-arm64-3.8
creating build/temp.macosx-10.14-arm64-3.8/ros_comm
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4
creating build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DXXH_NAMESPACE=ROSLZ4_ -Iinclude -Iroscpp_core/cpp_common/include -I/Users/cmauceri/Workspace/run-mgmt/jupyter_venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c ros_comm/utilities/roslz4/src/_roslz4module.c -o build/temp.macosx-10.14-arm64-3.8/ros_comm/utilities/roslz4/src/_roslz4module.o -Wno-strict-prototypes -Wno-missing-field-initializers -Wno-unused-variable -Wno-strict-aliasing
In file included from ros_comm/utilities/roslz4/src/_roslz4module.c:37:
include/roslz4/lz4s.h:38:10: fatal error: 'lz4.h' file not found
#include <lz4.h>
^~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> roslz4
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Do I need to add the location of lz4 headers to an environment variable? How can I get pip to find the header?
After doing brew install lz4 the following (from this SO post by rgov) worked for me without the need of any source code changes:
CFLAGS="-I$(brew --prefix lz4)/include" \
LDFLAGS="-L$(brew --prefix lz4)/lib" \
pip install roslz4 --extra-index-url https://rospypi.github.io/simple/
Answer from a coworker:
My solution was to download the roslz4 tarball and manually add the include folders and library symbols into the setup config, then run python setup.py install
Here are the first few lines of my setup.py file (which includes my addition to include and lib)
import platform
from setuptools import setup, Extension
extra_compile_args = []
include_dirs = [
"include",
"roscpp_core/cpp_common/include",
"/usr/local/Cellar/lz4/1.9.3/include",
]
libraries = ["lz4"]
library_dirs = ["/usr/local/Cellar/lz4/1.9.3/lib"]
define_macros = [
("XXH_NAMESPACE", "ROSLZ4_"),
]
My changes are the lines with "Cellar" and "library_dirs"

/usr/bin/ld: cannot find -lffi while installing cffi 1.11.5 package

enter code hereI'm trying to install paramiko module in my linux server. The pip is blocked on the server, So i am manually copying the package zips and installing them from setup.py
when i try installing paramiko i get
error: Could not find suitable distribution for Requirement.parse('pynacl>=1.0.1')
so i download the PyNaCl package, but i get
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('cffi>=1.1.0')
pynacl needs cffi 1.1.0 above:
so while installing cffi1.11.5 i get the below error:
[root#homecffi-1.11.5]# python3.5 setup.py install
running install
---
---
installing library code to build/bdist.linux-x86_64/egg
--
--
building '_cffi_backend' extension
gcc -pthread -fno-strict-aliasing -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/local/lib/libffi-3.1/include -I/usr/local/include/python3.5m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.5/c/_cffi_backend.o
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:5911: warning: ‘ffi_prep_closure’ is deprecated (declared at /usr/local/include/ffi.h:341)
gcc -pthread -shared build/temp.linux-x86_64-3.5/c/_cffi_backend.o -L$(libdir)/../lib64 -lffi -o build/lib.linux-x86_64-3.5/_cffi_backend.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lffi
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Can anyone help me with this?
If this is a Debian or Ubuntu machine,
sudo apt install libffi-dev
and then try again.
For other distributions, the installation method and package name may be different.

pydasm install error on python 2.7

I'm trying to install pydasm, but met an error, don't know how to continue.
The version of python is 2.7, and the OS is WinXP.
python setup.py build_ext --compiler=mingw32
running build_ext
building 'pydasm' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Pytho
n27\include -IC:\Python27\PC -c ../libdasm.c -o build\temp.win32-2.7\Release\..\
libdasm.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
It seems that -mno-cygwin is no longer supported in latest MinGW, but python 2.7 disutils module is still using it. How to solve it?

Error building 'lxml.etree' extension

I'm trying to install lxml, on an Ubuntu server running Python 2.6 (in a virtualenv - the system Python is 2.5).
I've checked out via svn and as a result I've also install Cython, as per the instructions.
However, I get the following error when running python setup.py build:
Building lxml version 2.3.alpha1-76211.
Building with Cython 0.11.
Using build configuration of libxslt 1.1.22
Building against libxml2/libxslt in the following directory: /usr/lib
running build
running build_py
running build_ext
cythoning src/lxml/lxml.etree.pyx to src/lxml/lxml.etree.c
Error converting Pyrex file to C:
------------------------------------------------------------
...
c_child = _findChildForwards(c_node, 0)
while c_child is not NULL:
if c_child.type == tree.XML_ELEMENT_NODE:
for i in range(c_tag_count):
if _tagMatchesExactly(c_child, c_ns_tags[2*i], c_ns_tags[2*i+1]):
c_next = _findChildForwards(c_child, 0) or _nextElement(c_child)
^
------------------------------------------------------------
/home/admin/web/blink/lxml/src/lxml/cleanup.pxi:246:64: Cannot assign type 'int' to 'xmlNode *'
Error converting Pyrex file to C:
building 'lxml.etree' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/home/admin/python/2.6.5/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.6/src/lxml/lxml.etree.o -w
src/lxml/lxml.etree.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
And very similar errors if i try python setup.py bdist_egg, python setup.py build_ext -i or make
Trying to install via easy_install or pip produces the same error - although the former just hangs indefinitely.
As far as I am aware, all of the various dependencies, such as python-dev are installed.
What am I missing / doing wrong?
"I've checked out via svn" ...
"Building lxml version 2.3.alpha1-76211" ...
You appear to be on the bleeding edge. Suggestions: Use a released version of the lxml source. Consult with the lxml author/maintainer.

Categories

Resources