Build Error PythonQt Visual Studio 2015 Qt 5.9.2

Trying to build slicer 4.8.0 with Qt 5.9.2. I get really close to a full complete build, but PythonQt in CTK fails everytime with a laundry list of errors. I am using Visual Studio 2015 I turned off Slicer_USE_PYTHONQT_WITH_OPENSSL. I also tried turning off Slicer_USE_PYTHONQT_WITH_TCL and had the exact same result. I have attached my build output, but the problem seems to be with QOpenGLTimeMonitor. Anyone have any suggestions?

For reference I built Qt with the following configure (configure -prefix D:/Qt/5926415R -release -opensource -confirm-license -platform win32-msvc2015 -nomake examples -nomake tests -openssl -I D:/OpenSSL/OpenSSL-64VS15/include -L D:/OpenSSL/OpenSSL-64VS15)

Build output here:

Build Output

I should note that I also tried the latest commit of slicer 4.9.0 as of today and got the same error.

Did you follow the instructions here?: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8#Status

I did that a few weeks ago, with no other changes, and successfully built against Qt 5.9.2 (VS2015 lib) installed with the Qt installer. 28 tests fail, but I think most of them are known issues.

Yep I changed the Slicer_REQUIRED_QT_VERSION to 5.9.2 which made the QT5_DIR come up and then I set that to my qtdirectory/lib/cmake/Qt5.

From an empty directory, if you configure using:

cmake -DQt5_DIR:PATH=... 

There is no need to manually set Slicer_REQUIRED_QT_VERSION.

If you are using cmake-gui or ccmake, just make sure you are NOT configuring a first time and then setting the Qt5_DIR variable.

You need to set the Qt5_DIR variable the first time you configure. That way all default values are properly initialized.

Waiting we test and finalize updates associated with building Qt from source, there is no problem downloading existing binaries. It just mean that if you do a debug build, you will not be able to use the QtDesigner or QtCreator and make use of the custom designer/QtCreator plugins offered by CTK and Slicer to design UI

ok I will try this in a new directory. I will let it build overnight and see if that solves the issue. I will report back. Thanks!

Still not building pythonQt. So I am using the cmake gui. I created a new directory opened the cmake gui and set Qt5_DIR and QT_QMAKE_EXECUTABLE before configuring. Configured generated and opened the project. Started the build. Again most everything built but it is still failing to build pythonQt. The first error occurs at recognizing QOpenGLTimeMonitor… Any other suggestions to get this working?

I usually create a .bat file that configures CMake using -D parameters. It is less work and more reproducible than setting CMake variables manually each time I need a clean rebuild.

2 Likes

FWIW, here’s the selections I used with the Qt online installer. I would also suggest to build from top-of-trunk because there are continuous improvements, and targeting 4.8 because it’s a “release” is meaningless for a non-default configuration.

image

Ok I installed Qt using the Qt installer with the options you suggested. Everything built this time except for python. Python says “unresolved external symbol _Py_silent_invalid_parameter_handler referenced in function new_threadstate” in the libpython-shared project. I am used the top of the trunk for this build. Any ideas to solve this last problem?

Remove the superbuild/[Python-2.7.13, python-build, python-prefix] directories and build again. Should be fixed by the following, but I don’t know if the commit was bumped in slicer yet:

https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/pull/195

Only Qt5_DIR should be set. QT_QMAKE_EXECUTABLE was specific to Qt4 configuration.

Not yet. It will be done shortly. Done - See r26559

1 Like

Gonna try not setting QT_QMAKE_EXECUTABLE and rebuild fresh. Will let it run overnight. Will report back if I have success. Thanks for all of the help. One of these times it is going to build!

1 Like

You are welcome.

It should really be a seamless experience. We will try to improve things.

@lassoan @ihnorton For some time I have been thinking about creating a “SlicerDevelopmentEnvironment” project on GitHub where we would keep:

This would ne lightweight and allow to store:

  • batch/shell script to build Slicer
  • and other misc scripts

Or we could commit batch script directly to Slicer repo.

Here is what was done for ITK: https://github.com/InsightSoftwareConsortium/ITKDevelopmentEnvironment

A post was split to a new topic: Windows build scripts and simplification

(I moved my response to a new topic because it is not directly related to the original post)

Ok it worked! I was able to build it finally. Now I have one last issue that I need to solve. When I open slicer it complains that the OpenGL Core Profile was requested but it is not supported on my current platform… I assumed this must me a graphics card driver issue. I have the NVIDIA NVS 315 which is supposed to support OpenGL. I tried updating the drivers to the latest, but slicer still complains and says it is not supported. Any ideas of how to remedy this?

This comes from QWebEngine, and I believe it is a known issue with the initialization. GL/VTK stuff in Slicer proper should work fine.