Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python 3.7 on Freebsd 11 with ssl

I am trying to install Python 3.7 on Freebsd 11.1 with ssl support.

Attempt #1: The pre-built binary won't run due to libdl.so.1 not found

pkg install python37
...
root@s0001:~ # python3.7
Shared object "libdl.so.1" not found, required by "python3.7"

Attempt #2: I downloaded the python 3.7 source and attempted to build with defaults but ssl module not found

./configure
make
...
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm                 _sqlite3              _ssl
_tkinter              spwd
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Attempt #3: I noticed there is source for openssl 1.1.1 inside the python tarball so I tried --with-openssl, but got compiler errors:

./configure --with-openssl=openssl-1.1.1
make

openssl-1.1.1/include/openssl/bn.h:332:1: error: expected function body after function declarator

DEPRECATEDIN_0_9_8(int
^
openssl-1.1.1/include/openssl/bn.h:403:1: error: expected function body after function declarator
DEPRECATEDIN_0_9_8(int BN_get_params(int which)) /* 0, mul, 1 high, 2 low, 3
^
In file included from /root/Python-3.7.0/Modules/_hashopenssl.c:23:
In file included from openssl-1.1.1/include/openssl/evp.h:28:
In file included from openssl-1.1.1/include/openssl/objects.h:15:

It seems like installing Python with ssl support (I would think using the openssl that comes in the tarball) should be straightforward. What is the correct way to do this?

like image 284
Debby Mendez Avatar asked Oct 10 '18 13:10

Debby Mendez


2 Answers

I've got it working.

I needed to run

pkg install openssl

and then I was able to build and install using the defaults (ie following Attempt #2)

like image 84
Debby Mendez Avatar answered Sep 27 '22 23:09

Debby Mendez


I had the same problem, but I chose to upgrade FreeBSD rather than rebuilding python.

FreeBSD 11.2 added libdl in this commit, which we see in the 11.2 source but not the 11.1 source (404). Since 2018-09-30, 11.1 has been unsupported.

So, this package and potentially other packages could have the same symptom (libdl missing) on 11.1 because ongoing package builds no longer need to support 11.1.

like image 44
Bethany Long Avatar answered Sep 27 '22 21:09

Bethany Long