Building From Source on Ubuntu 16.04 - OpenSSL

I can build Slicer with the option

Slicer_USE_PYTHONQT_WITH_OPENS

off

When I try to build with this on I get

[ 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

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

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

I tried using

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

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

@codey, which Qt version did you try to build? On the dashboard Qt 5.9.1 shows up in green for Linux.

I am using version 4.8.7

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

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.

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

/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.

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

I’ve got a successful build with this. Thanks

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.

/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

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)