# Building From Source on Ubuntu 16.04 - OpenSSL

**URL:** https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129
**Category:** Development
**Tags:** build
**Created:** [September 26, 2017, 11:59pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129 "2017-09-26T23:59:33Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![codey](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codey](https://discourse.slicer.org/u/codey)
#### Post date: [September 26, 2017, 11:59pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/1 "2017-09-26T23:59:33Z")

</div>

I can build Slicer with the option

Slicer\_USE\_PYTHONQT\_WITH\_OPENS

off

When I try to build with this on I get

```auto
[11%] Completed 'bzip2'
[12%] Built target bzip2
[12%] No configure step for 'OpenSSL'
/usr/bin/cmake: libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libcurl.so.4)
/usr/bin/cmake: libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libcurl.so.4)
/usr/bin/cmake: libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libcurl.so.4)
/usr/bin/cmake: libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libcurl.so.4)
/usr/bin/cmake: relocation error: /usr/lib/x86_64-linux-gnu/libcurl.so.4: symbol SSL_CTX_set_alpn_protos, version OPENSSL_1.0.2 not defined in file libssl.so.1.0.0 with link time reference
CMakeFiles/OpenSSL.dir/build.make:109: recipe for target 'OpenSSL-prefix/src/OpenSSL-stamp/OpenSSL-configure' failed
make[2]: *** [OpenSSL-prefix/src/OpenSSL-stamp/OpenSSL-configure] Error 127
CMakeFiles/Makefile2:1267: recipe for target 'CMakeFiles/OpenSSL.dir/all' failed
make[1]: *** [CMakeFiles/OpenSSL.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

```

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 27, 2017, 12:04am UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/2 "2017-09-27T00:04:51Z")

</div>

As described in Slicer build instructors, you need to build Qt with OpenSSL support, or build Slicer with OpenSSL disabled.

---

<div class="post-metadata">

### Author: ![codey](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codey](https://discourse.slicer.org/u/codey)
#### Post date: [September 28, 2017, 8:43am UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/3 "2017-09-28T08:43:25Z")

</div>

I can build with Slicer disabled no problem. I want to use pip so I need SSL.

I tried using

> **[jcfr/qt-easy-build](https://github.com/jcfr/qt-easy-build)**
>
> Scripts allowing to easily build Qt with OpenSSL support on Linux, macOS or Windows - jcfr/qt-easy-build

and pointing CMake to the qmake of the resulting build with openssl but I get the same error

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 28, 2017, 11:53pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/4 "2017-09-28T23:53:05Z")

</div>

@jcfr Is qt-easy-build supposed to work on Ubuntu 16.04?

@codey, which Qt version did you try to build? On the [dashboard](https://github.com/jcfr/qt-easy-build) Qt 5.9.1 shows up in green for Linux.

---

<div class="post-metadata">

### Author: ![codey](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codey](https://discourse.slicer.org/u/codey)
#### Post date: [September 29, 2017, 9:43am UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/5 "2017-09-29T09:43:53Z")

</div>

I am using version 4.8.7

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 29, 2017, 1:03pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/6 "2017-09-29T13:03:11Z")

</div>

Maybe while waiting for @jcfr to get back to us, you can try building with Qt5 and VTK8.

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [September 29, 2017, 4:03pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/7 "2017-09-29T16:03:00Z")

</div>

I haven’t tried to build using Ubuntu 16.04 … that said I will soon update my workstation to use it.

> qt-easy-build dashboard

The testing for Qt 4.8.7 needs some work, I will look into it.

---

<div class="post-metadata">

### Author: ![codey](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codey](https://discourse.slicer.org/u/codey)
#### Post date: [September 30, 2017, 1:13pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/8 "2017-09-30T13:13:36Z")

</div>

I’ve tried installing QT5.9.1 from the Qt’s runfile with VTK8 but I get  
an error when building Slicer

```auto
/Data-work/BuildDirs/Slicer/Modules/Loadable/Tables/Widgets/Testing/Cxx/qSlicerTableColumnPropertiesWidgetTest1.cxx: 
In function ‘int qSlicerTableColumnPropertiesWidgetTest1(int, char**)’:
/Data-work/BuildDirs/Slicer/Modules/Loadable/Tables/Widgets/Testing/Cxx/qSlicerTableColumnPropertiesWidgetTest1.cxx:46:3: 
error: ‘QSurfaceFormat’ was not declared in this scope
    QSurfaceFormat format = QVTKOpenGLWidget::defaultFormat();

```

I didn’t think you could build it with QT5 from reading the build  
instructions. I’ll try using QT4 with the runfile installation.

---

<div class="post-metadata">

### Author: ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)
#### Post date: [September 30, 2017, 1:26pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/9 "2017-09-30T13:26:45Z")

</div>

Note that you can use Qt 4.8.7 from the system package manager:

`sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui libqtwebkit-dev`

[https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build\_Instructions#Qt](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Qt)

---

<div class="post-metadata">

### Author: ![codey](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codey](https://discourse.slicer.org/u/codey)
#### Post date: [September 30, 2017, 6:57pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/10 "2017-09-30T18:57:10Z")

</div>

I’ve got a successful build with this. Thanks

---

<div class="post-metadata">

### Author: ![codey](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@codey](https://discourse.slicer.org/u/codey)
#### Post date: [October 9, 2017, 2:12pm UTC](https://discourse.slicer.org/t/building-from-source-on-ubuntu-16-04-openssl/1129/11 "2017-10-09T14:12:20Z")

</div>

I am not sure how I managed to get Slicer built. I am trying to build on  
another Ubuntu 16.04 and I have run into the same issues.

```auto
/usr/bin/cmake: relocation error: 
/usr/lib/x86_64-linux-gnu/libcurl.so.4: symbol SSL_CTX_set_alpn_protos, 
version OPENSSL_1.0.2 not defined in file libssl.so.1.0.0 with link time 
reference
CMakeFiles/OpenSSL.dir/build.make:109: recipe for target 
'OpenSSL-prefix/src/OpenSSL-stamp/OpenSSL-configure' failed
make[2]: *** [OpenSSL-prefix/src/OpenSSL-stamp/OpenSSL-configure] Error 127
CMakeFiles/Makefile2:1267: recipe for target 
'CMakeFiles/OpenSSL.dir/all' failed
make[1]: *** [CMakeFiles/OpenSSL.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

```

The choices of openssl are set in the cmake file

set\_property(CACHE OPENSSL\_DOWNLOAD\_VERSION PROPERTY STRINGS “1.0.1e”  
“1.0.1l”)

I think they might not be compatible with the openssl I have installed.  
I posted this on AskUbuntu here

> <https://askubuntu.com/questions/963299/building-3d-slicer-from-source-openssl-error>

One comment says,

OpenSSL 1.0.x built from source does not include versioned symbols.  
However the Ubuntu supplied OpenSSL has a patch which does include  
versioned symbols. The error message above mentions a symbol version  
(OPENSSL\_1.0.2) so there is some confusion between the two OpenSSL  
versions (i.e. the system installed version and the one downloaded and  
built from source)
