visit-dav / visit

VisIt - Visualization and Data Analysis for Mesh-based Scientific Data
https://visit.llnl.gov
BSD 3-Clause "New" or "Revised" License
428 stars 111 forks source link

3.3.3 build on ubuntu 22.04: build qt fails #19411

Open heinsimon opened 6 months ago

heinsimon commented 6 months ago

Describe the bug

I am trying to build visit on ubuntu 22.04.

Call to build-script:

sudo ./build_visit3_3_3 --makeflags -j4 --required --mpich --mesagl --hdf5 --silo --python --vtk --prefix /opt/visit --llvm --thirdparty-path /opt/visit/third_party

The build process fails during building QT:

Building Qt (~60 minutes)
Unzipping/Untarring qt-everywhere-src-5.14.2.tar.xz . . .
Patching qt . . .
Patching qt 5.14.2 for numeric-limits
Patching qt 5.14.2 for qjp2handler cmath include
Patching qt 5.14.2 for Linux and Mesa-as-GL
Configuring Qt5: 
Building Qt5 . . . (~60 minutes)
Qt5 build failed. Giving up
Unable to build or install Qt. Bailing out.
Error in build process. See build_visit3_3_3_orig_log for more information. If the error is unclear, please include build_visit3_3_3_log and contact the VisIt project via https://visit-help.llnl.gov. You may need to compress the build_visit3_3_3_log using a program like gzip so it will fit within the size limits for attachments.
Log file full path: /PATH/TO/STARTFOLDER/build_visit3_3_3_log

Last lines in build_visit3_3_3_log

Info: creating cache file /PATH/TO/STARTFOLDER/qt-everywhere-src-5.14.2-build/qtdeclarative/.qmake.cache
sh: 1: python: not found
Project ERROR: Building QtQml requires Python.
make: *** [Makefile:215: module-qtdeclarative-make_first] Error 3
make: *** Waiting for unfinished jobs....

Relevant other Issue: #18747 Note: The fix mention in Issue #18747 was not merged: #18642 !

To Reproduce

  1. ubuntu 22.04
  2. Download current build_visit3_3_3 from [release page](https://github.com/visit-dav/visit/releases/tag/v3.3.3
  3. Start build process with command
    sudo ./build_visit3_3_3 --makeflags -j4 --required --mpich --mesagl --hdf5 --silo --python --vtk --prefix /opt/visit --llvm --thirdparty-path /opt/visit/third_party

Expected behavior

Build process works.

Identified reason

The build is failing due to a not working replace of "python" with "python3" in line 18762-18763 in build_visit3_3_3 or L852-853 in bv_qt.sh:

    if ! command -v python > /dev/null 2>&1 ; then
        sed -i "s/python/python3/" ./qtdeclarative/src/3rdparty/masm/masm.pri
        sed -i "s/python -c/python3 -c/" ./qtdeclarative/qtdeclarative.pro
    fi

The sed command gets a relative path to masm.pri and qtdeclarative.pro. These relatives paths are only valid if the current folder is ${QT_SRC_DIR}, but one is currently in ${QT_BUILD_DIR}. This becomes clear by adding a check if the file exists:

    if ! command -v python > /dev/null 2>&1 ; then
        if [[ ! -f ./qtdeclarative/src/3rdparty/masm/masm.pri ]] ; then
            info "DEBUG: file not found! PWD: $(pwd)"
        fi
        sed -i "s/python/python3/" ./qtdeclarative/src/3rdparty/masm/masm.pri
        sed -i "s/python -c/python3 -c/" ./qtdeclarative/qtdeclarative.pro
    fi

This results in the additional line in the console log:

Unzipping/Untarring qt-everywhere-src-5.14.2.tar.xz . . .
Patching qt . . .
Patching qt 5.14.2 for numeric-limits
Patching qt 5.14.2 for qjp2handler cmath include
Patching qt 5.14.2 for Linux and Mesa-as-GL
DEBUG: file not found! PWD: /PATH/TO/STARTFOLDER/qt-everywhere-src-5.14.2-build
Configuring Qt5: 
...

Possible fix

A possible fix to this problem could be following:

Desktop

JustinPrivitera commented 6 months ago

I think we were hoping to move away from qt5, which is why the fix you linked to never got merged. You could try --qt6 when invoking build_visit. Perhaps other members of the team have insight into how to get qt5 working in this instance.

cyrush commented 5 months ago

@heinsimon --qt6 should help you avoid the python vs python3 issue and is fancier in general. Let us know if you get a chance to try and if hit any issues.

heinsimon commented 5 months ago

@heinsimon --qt6 should help you avoid the python vs python3 issue and is fancier in general. Let us know if you get a chance to try and if hit any issues.

The option --qt6 is not available with 3.3.3. I will see, when I find time to test the pre-release 3.4.0.

cyrush commented 5 months ago

Yes, sorry for the confusion. We are releasing 3.4.1, I recommend using that version.