Skip to content

Error building pyOpenSSL on OSX #1084

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

Closed
remram44 opened this issue Feb 26, 2015 · 22 comments
Closed

Error building pyOpenSSL on OSX #1084

remram44 opened this issue Feb 26, 2015 · 22 comments
Milestone

Comments

@remram44
Copy link
Contributor

With my version of OpenSSL, pyOpenSSL doesn't build:

OpenSSL/crypto/crl.c:6:23: error: static declaration of 'X509_REVOKED_dup'
follows non-static declaration

 static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig) {
                       ^

In file included from /opt/local/include/openssl/ssl.h:156:0,

                 from OpenSSL/crypto/x509.h:17,
                 from OpenSSL/crypto/crypto.h:30,
                 from OpenSSL/crypto/crl.c:3:

/opt/local/include/openssl/x509.h:751:15: note: previous declaration of
'X509_REVOKED_dup' was here

 X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
               ^

Googling for this points me to this post, where it says that pyopenSSL 0.14 doesn't have the issue. UVCDAT uses 0.13 (from uv-cdat.llnl.gov/cdat/resources/).

@remram44 remram44 added the Build label Feb 26, 2015
@durack1
Copy link
Member

durack1 commented Feb 26, 2015

@remram44 it seems that Python 2.7.9 comes with SSL which has been backported from v3: https://www.python.org/downloads/release/python-279/

I wonder if the built-in SSL would work here?

@remram44
Copy link
Contributor Author

I tried replacing the version in pyopenssl_pkg.cmake, since 0.14 is on uv-cdat.llnl.gov, but that doesn't build either...

@doutriaux1
Copy link
Contributor

interstingly on my system:

doutriaux1@sofia:[~]:[3928]> cd build_many_j/build/PYOPENSSL/
/Users/doutriaux1/build_many_j/build/PYOPENSSL
ldoutriaux1@sofia:[PYOPENSSL]:[master]:[3929]> ll
total 768
-rw-r--r--   1 doutriaux1  staff   1.6K Feb 26 14:24 COPYRIGHT
-rw-r--r--   1 doutriaux1  staff   1.3K Feb 26 14:24 LICENSE
-rw-r--r--   1 doutriaux1  staff   6.1K Feb 26 14:24 Makefile.in
-rw-r--r--   1 doutriaux1  staff   4.4K Feb 26 14:24 README
-rw-r--r--   1 doutriaux1  staff    49B Feb 26 14:24 README.md
-rw-r--r--   1 doutriaux1  staff    12K Feb 26 14:24 acsite.m4
-rwxr-xr-x   1 doutriaux1  staff   496B Feb 26 14:24 build-g2clib
-rwxr-xr-x   1 doutriaux1  staff   6.7K Feb 26 14:24 cdms.sh
-rwxr-xr-x   1 doutriaux1  staff   135B Feb 26 14:24 clean_script
-rwxr-xr-x   1 doutriaux1  staff   208K Feb 26 14:24 configure
-rw-r--r--   1 doutriaux1  staff    11K Feb 26 14:24 configure.in
-rw-r--r--   1 doutriaux1  staff   549B Feb 26 14:24 g2clib-1.2.0-makefile.patch
-rw-r--r--   1 doutriaux1  staff    81K Feb 26 14:24 g2clib-1.2.1.tar.gz
drwxr-xr-x  31 doutriaux1  staff   1.0K Feb 26 14:24 include
-rwxr-xr-x   1 doutriaux1  staff   4.7K Feb 26 14:24 install-sh
-rwxr-xr-x   1 doutriaux1  staff   251B Feb 26 14:24 install_script
drwxr-xr-x   3 doutriaux1  staff   102B Feb 26 14:24 lib
drwxr-xr-x   3 doutriaux1  staff   102B Feb 26 14:24 man
-rwxr-xr-x   1 doutriaux1  staff   3.4K Feb 26 14:24 setup.future
drwxr-xr-x   8 doutriaux1  staff   272B Feb 26 14:24 src

why is gc2lib inside PyOPENSSL?

@doutriaux1 doutriaux1 added this to the 2.2 milestone Feb 26, 2015
@doutriaux1
Copy link
Contributor

@aashish24 in case it matters on Mac 10.10

doutriaux1@sofia:[build_many_j]:[3683]> cmake --version
cmake version 3.2.0-rc2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@doutriaux1
Copy link
Contributor

@aashish24 I was building 2 version at once from 2 different build directories but point to same sources. Could it possibly confuse cmake?

@doutriaux1
Copy link
Contributor

@aashish24 nevermind, was something local with my tweaks on Yosemite branch

@alliepiper
Copy link
Contributor

I'm running into this on Arch Linux, too. Same error as @remram44 with 0.13, and with 0.14:

c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
               ^
compilation terminated.

@remram44 remram44 added the Bug label Mar 2, 2015
@doutriaux1
Copy link
Contributor

@dlonie do you mind trying against .15? Get the cmake file from Yosemite branch.

https://github.com/UV-CDAT/uvcdat/blob/Yosemite_rebased/CMake/cdat_modules/scipy_pkg.cmake

@alliepiper
Copy link
Contributor

@doutriaux1 That's for scipy -- should it fix the pyopenssl issues?

@jbeezley
Copy link
Contributor

jbeezley commented Mar 2, 2015

@dlonie RE: version 0.14. On Ubuntu when you get that error, it means you need to install the libffi development headers.

@alliepiper
Copy link
Contributor

I have them installed at /usr/lib/libffi-3.2.1/include/ffi.h, but pyopenssl isn't detecting them.

@jbeezley
Copy link
Contributor

jbeezley commented Mar 2, 2015

It looks like the dependency comes from the cffi package, which uses pkg-config. What do you get for pkg-config libffi --cflags? Can you pip install cffi?

@alliepiper
Copy link
Contributor

@jbeezley Interesting...I didn't have pkg-config installed on this box, and even though UV-CDAT had built pkg-config, it looks like it still relies on the system installation during building.

pyopenssl 0.14 builds with a system-installed pkg-config.

@doutriaux1
Copy link
Contributor

@dlonie pyopenssl seems to install via pipinstaller which calls cdat_common_env which in turn should seyour env to use PKGCONFIG, I wonder why it's not respecting this.

@doutriaux1
Copy link
Contributor

now it might be the issue that you do not have the regualr pkgconfig which seems to be telling pyopenssl where ffi is at (at least that's how @jbeezley seems to be looking for it). Can you try installing pkg-config?

@alliepiper
Copy link
Contributor

That's what I did to get it to work -- once the system installed pkg-config was in place, compilation succeeded.

@doutriaux1
Copy link
Contributor

@mattben @chaosphere2112 @aashish24 we should probably add ffi-devel and pkgcnfig to:
https://github.com/UV-CDAT/uvcdat/wiki/System-Requirements

@jbeezley
Copy link
Contributor

jbeezley commented Mar 2, 2015

It looks like setup.py for cffi was using your UV-CDAT pkg-config, but the UV-CDAT version doesn't know anything about the system installed libffi. I'm actually not sure why it does detect it when you have the system version installed.

@doutriaux1
Copy link
Contributor

@remram44 let us know if @dlonie branch helps you. Thanks.

@aashish24
Copy link
Contributor

@doutriaux1 @remram44 please approve this branch

@shangbo
Copy link

shangbo commented Jul 22, 2015

@remram44 Hi,bro~I had got this problem. But when I tried to "brew uninstall openssl" and reinstalled pyopenssl==0.13,it worked! please forgive my bad English...

@mravshan
Copy link

mravshan commented Jul 7, 2016

It seems that at this time our repo uses pyopenssl version 0.13(pip show pyOpenSSL) which is not compatible with the openSSL version 1.0.2g(openssl version) that brew installed above. Your mileage may vary.
edit '/usr/local/include/openssl/x509.h'
comment out X509_REVOKED_dup() function's declaration.
Look for the line 'X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);' and comment it out.
Save the file.
Do a 'make clean && make distclean' and re-run 'make develop' again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants