Slicer superbuild failing due to out-dated third party libraries: VTK and curl

Using Archlinux with gcc 8.1.1, the Slicer superbuild with VTKv9 and Qt5 is failing in the following packages: VTK, python, and curl.



  • Current curl version in slicer is failing, with error:
Software/Slicer/build-relwithdebinfo/curl/lib/ssluse.c:1957:45: error: dereferencing pointer to incomplete type ‘X509_EXTENSION’ {aka ‘struct X509_extension_st’}
       M_ASN1_OCTET_STRING_print(bio_out, ext->value);
                                             ^~
Software/Slicer/build-relwithdebinfo/curl/lib/ssluse.c: In function ‘get_cert_chain’:
Software/Slicer/build-relwithdebinfo/curl/lib/ssluse.c:2114:13: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’}
     cinf = x->cert_info;
             ^~
/Software/Slicer/build-relwithdebinfo/curl/lib/ssluse.c:2116:30: error: dereferencing pointer to incomplete type ‘X509_CINF’ {aka ‘struct x509_cinf_st’}
     j = asn1_object_dump(cinf->signature->algorithm, bufp, CERTBUFFERSIZE);
                              ^~
Software/Slicer/build-relwithdebinfo/curl/lib/ssluse.c:2142:20: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
       switch(pubkey->type) {
                    ^~
[42/76] Building C object lib/CMakeFiles/libcurl.dir/imap.c.o
In file included from /usr/include/sys/types.h:25,
                 from lib/../include/curl/curlbuild.h:130,
                 from /home/phc/Software/Slicer/build-relwithdebinfo/curl/lib/curl_setup.h:125,
                 from /home/phc/Software/Slicer/build-relwithdebinfo/curl/lib/multi.c:23:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
[45/76] Building C object lib/CMakeFiles/libcurl.dir/imap.c.o
ninja: build stopped: subcommand failed.
[140/200] Performing build step for 'curl'
FAILED: curl-prefix/src/curl-stamp/curl-build

curl-master works. There are three commits in the Slicer branch on top of a quite old curl-master, not sure if they are still relevant and have to be cherry-picked after the update: https://github.com/slicer/curl/tree/curl-7_34_0-maint @jcfr


Also current CTK tag: f0386cba0dd62d728bca9a00a2c89bc0528ff768 generates this error, that is solved updating Slicer to use latest CTK with this PR merged: https://github.com/commontk/CTK/pull/817

/Software/Slicer/build-relwithdebinfo/CTK/Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.cpp:378:45: error: invalid use of incomplete type ‘class vtkRenderWindowInteractor’
   self->ScalarsToColorsView->GetInteractor()->Render();
                                             ^~
In file included from /Software/Slicer/build-relwithdebinfo/CTK/Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.cpp:50:
/home/phc/Software/Slicer/build-relwithdebinfo/VTKv9/GUISupport/Qt/QVTKOpenGLWidget.h:31:7: note: forward declaration of ‘class vtkRenderWindowInteractor’
 class vtkRenderWindowInteractor;
Software/Slicer/build-relwithdebinfo/CTK/Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.cpp: In member function ‘void ctkVTKDiscretizableColorTransferWidget::onPaletteIndexChanged(vtkScalarsToColors*)’:
/Software/Slicer/build-relwithdebinfo/CTK/Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.cpp:756:42: error: invalid use of incomplete type ‘class vtkRenderWindowInteractor’
   d->ScalarsToColorsView->GetInteractor()->Render();
                                          ^~
In file included from /Software/Slicer/build-relwithdebinfo/CTK/Libs/Visualization/VTK/Widgets/ctkVTKDiscretizableColorTransferWidget.cpp:50:
/Software/Slicer/build-relwithdebinfo/VTKv9/GUISupport/Qt/QVTKOpenGLWidget.h:31:7: note: forward declaration of ‘class vtkRenderWindowInteractor’
 class vtkRenderWindowInteractor;


A workaround is to use system python with:

mkvirtualenv -p python2.7 slicer
workon slicer
pip install chardet appdirs packaging pyparsing smmap gitdb GitPython PyGithub nose numpy dicom couchdb

The cmake options for the workaround. Note that curl is latest in my system.

cmake -G Ninja ../Slicer-src \
-DSlicer_VTK_VERSION_MAJOR:STRING=9 \
-DSlicer_USE_SYSTEM_curl:BOOL=ON \
-DSlicer_USE_SYSTEM_python:BOOL=ON \
-DVTK_DIR:PATH=/path/VTKv9-master-build