Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error #11

Closed
jpaul opened this issue Jan 9, 2019 · 2 comments
Closed

Build error #11

jpaul opened this issue Jan 9, 2019 · 2 comments
Assignees

Comments

@jpaul
Copy link

jpaul commented Jan 9, 2019

I tried to build the latest repro on CentOS 1804 x64 and got a failure.
cmd issued: sudo /usr/local/bin/python3.7 setup.py install

creating build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -c build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/_md.c -o build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/_md.o
build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/_md.c:611:33: fatal error: mbedtls/md_internal.h: No such file or directory
#include "mbedtls/md_internal.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1

update

I also tried the 0.14.0 version from here and got a different build error:
https://pypi.org/project/python-mbedtls/#files

sudo /usr/local/bin/python3.7 setup.py install
running install
running bdist_egg
running egg_info
writing src/python_mbedtls.egg-info/PKG-INFO
writing dependency_links to src/python_mbedtls.egg-info/dependency_links.txt
writing requirements to src/python_mbedtls.egg-info/requires.txt
writing top-level names to src/python_mbedtls.egg-info/top_level.txt
reading manifest file 'src/python_mbedtls.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src/python_mbedtls.egg-info/SOURCES.txt'
installing library code to build-3.7.1/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build-3.7.1
creating build-3.7.1/lib.linux-x86_64-3.7
creating build-3.7.1/lib.linux-x86_64-3.7/mbedtls
copying src/mbedtls/init.py -> build-3.7.1/lib.linux-x86_64-3.7/mbedtls
creating build-3.7.1/lib.linux-x86_64-3.7/mbedtls/cipher
copying src/mbedtls/cipher/init.py -> build-3.7.1/lib.linux-x86_64-3.7/mbedtls/cipher
running build_ext
cythoning src/mbedtls/x509.pyx to build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/x509.c
creating build-3.7.1/temp.linux-x86_64-3.7
creating build-3.7.1/temp.linux-x86_64-3.7/pyrex
creating build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls
building 'mbedtls.x509' extension
creating build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1
creating build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1/temp.linux-x86_64-3.7
creating build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1/temp.linux-x86_64-3.7/pyrex
creating build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -c build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/x509.c -o build-3.7.1/temp.linux-x86_64-3.7/build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/x509.o
build-3.7.1/temp.linux-x86_64-3.7/pyrex/mbedtls/x509.c:611:26: fatal error: mbedtls/asn1.h: No such file or directory
#include "mbedtls/asn1.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1

@Synss
Copy link
Owner

Synss commented Jan 9, 2019

Thank you for your detailed report!

On 64-bits Linux, you should use the wheels released to pypi. I think that sudo /usr/local/bin/python3.7 -m pip install python-mbedtls would work in your case.

@Synss
Copy link
Owner

Synss commented Jan 9, 2019

Otherwise, if you want/need to build python-mbedtls (the python library), you need to install mbedtls (the C library) first. python-mbedtls is not written in pure Python and requires the headers and the shared libraries from mbedtls to compile.

Provided you have a C compiler, curl, and CMake, you can use the shell script available in scripts/install-mbedtls.sh. The script takes the version of mbedtls that you want to install as argument, so run sudo ./scripts/install-mbedtls.sh 2.7.8 from the root of python-mbedtls to download and install mbedtls 2.7.8 to /usr/local.

Once you have mbedtls, install python-mbedtls with python setup.py install.

@Synss Synss self-assigned this Jan 9, 2019
@Synss Synss closed this as completed Jan 10, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants