From de8ce1c6eea05d299a6ddbf9000784f8d2d3c22d Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Mon, 2 Dec 2024 08:19:21 -0600 Subject: [PATCH 1/9] Add fully headless option Signed-off-by: Georgia Stuart --- src/Main/scirunMain.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Main/scirunMain.cc b/src/Main/scirunMain.cc index 869374370d..e66bbb3788 100644 --- a/src/Main/scirunMain.cc +++ b/src/Main/scirunMain.cc @@ -65,7 +65,11 @@ int mainImpl(int argc, const char* argv[], char **environment) //TODO: must read --headless flag here, or try pushing command queue building all the way up here //TODO: https://doc.qt.io/qt-5/qapplication.html#details #ifndef BUILD_HEADLESS - return GuiApplication::run(argc, argv); + if (!Application::Instance().parameters()->disableGui()) { + return GuiApplication::run(argc, argv); + } else { + return ConsoleApplication::run(argc, argv); + } #else return ConsoleApplication::run(argc, argv); #endif From ab59dd44876f2b911197b15d2986e2dea5e5c874 Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Mon, 2 Dec 2024 08:20:06 -0600 Subject: [PATCH 2/9] Add Dockerfile Signed-off-by: Georgia Stuart --- .dockerignore | 9 +++++++++ Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..aa0ce99f68 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.github +scripts +.clang-format +.git +.gitattributes +.gitignore +.travis.yml +build.sh +compile_commands.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..0a1d48c1c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +#syntax=docker/dockerfile:1-labs +FROM ubuntu:24.04 + +ARG SCIRUN_VERSION="v5.0-beta.2023" + +RUN apt-get -y update \ + && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install qtbase5-dev libqt5svg5-dev \ + cmake git openssl tzdata build-essential g++ zlib1g-dev libssl-dev libncurses-dev libsqlite3-dev \ + libreadline-dev libtk-img-dev libgdm-dev libdb-dev libpcap-dev \ + && rm -rf /var/cache/apt/archives /var/lib/apt/lists/* + +WORKDIR /scirun-src +COPY . /scirun-src/ +# RUN git clone --depth 1 --branch ${SCIRUN_VERSION} https://github.com/georgiastuart/SCIRun.git . + +WORKDIR /opt/scirun +# TODO: Separate external building from SCIRun +RUN cmake -DQt_PATH=/usr/lib/x86_64-linux-gnu/cmake \ + -DCMAKE_BUILD_TYPE=Release /scirun-src/Superbuild && make + +# Make the internal python usable externally +ENV LD_LIBRARY_PATH=/opt/scirun/Externals/Install/Python_external/lib:$LD_LIBRARY_PATH +ENV PATH=/opt/scirun/SCIRun:/opt/scirun/Externals/Install/Python_external/bin:$PATH +RUN python3 -m ensurepip && python3 -m pip install --upgrade pip && python3 -m venv /opt/venv + +WORKDIR /opt/scripts +COPY < Date: Mon, 2 Dec 2024 14:48:41 -0600 Subject: [PATCH 3/9] Update Dockerfile and avoid GUI for help flag Signed-off-by: Georgia Stuart --- Dockerfile | 1 - src/Main/scirunMain.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a1d48c1c3..063874e4bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ RUN apt-get -y update \ WORKDIR /scirun-src COPY . /scirun-src/ -# RUN git clone --depth 1 --branch ${SCIRUN_VERSION} https://github.com/georgiastuart/SCIRun.git . WORKDIR /opt/scirun # TODO: Separate external building from SCIRun diff --git a/src/Main/scirunMain.cc b/src/Main/scirunMain.cc index e66bbb3788..eedd0544de 100644 --- a/src/Main/scirunMain.cc +++ b/src/Main/scirunMain.cc @@ -65,7 +65,7 @@ int mainImpl(int argc, const char* argv[], char **environment) //TODO: must read --headless flag here, or try pushing command queue building all the way up here //TODO: https://doc.qt.io/qt-5/qapplication.html#details #ifndef BUILD_HEADLESS - if (!Application::Instance().parameters()->disableGui()) { + if (!Application::Instance().parameters()->disableGui() && !Application::Instance().parameters()->help()) { return GuiApplication::run(argc, argv); } else { return ConsoleApplication::run(argc, argv); From 0dc5e5c80c47f128518a78c6101c71a694f14375 Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Mon, 2 Dec 2024 15:05:55 -0600 Subject: [PATCH 4/9] Use pip --no-cache-dir flag Signed-off-by: Georgia Stuart --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 063874e4bd..0b5ac982ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN cmake -DQt_PATH=/usr/lib/x86_64-linux-gnu/cmake \ # Make the internal python usable externally ENV LD_LIBRARY_PATH=/opt/scirun/Externals/Install/Python_external/lib:$LD_LIBRARY_PATH ENV PATH=/opt/scirun/SCIRun:/opt/scirun/Externals/Install/Python_external/bin:$PATH -RUN python3 -m ensurepip && python3 -m pip install --upgrade pip && python3 -m venv /opt/venv +RUN python3 -m ensurepip && python3 -m pip install --no-cache-dir --upgrade pip && python3 -m venv /opt/venv WORKDIR /opt/scripts COPY < Date: Mon, 2 Dec 2024 15:10:55 -0600 Subject: [PATCH 5/9] Update build docs Signed-off-by: Georgia Stuart --- docs/start/build.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/start/build.md b/docs/start/build.md index fc6f3951d4..bf66566261 100644 --- a/docs/start/build.md +++ b/docs/start/build.md @@ -32,21 +32,25 @@ #### Linux - - Tested on Ubuntu 16.04 LTS, 18.04 LTS, 22.04 LTS, OpenSUSE Leap 42.1, Arch Linux + - Tested on Ubuntu 16.04 LTS, 18.04 LTS, 22.04 LTS, 24.04 LTS, OpenSUSE Leap 42.1, Arch Linux - gcc 7+ - Qt 5.15 or later + [Download](https://download.qt.io/archive/qt/) and run the desired Qt 5.x or 6.x installer. Make sure to turn off other versions and system configurations to save space and build time. Optionally, install Qt through your distro's package manager instead(apt on Ubuntu/Debian, pacman on Arch). - To install Qt 5, the command on Ubuntu/Debian is: + To install Qt 5, the command on Ubuntu (20.04 LTS or earlier) or Debian is: ``` sudo apt-get install qt5-default ``` + or, on Ubuntu 22.04 LTS and later + ``` + sudo apt-get install qtbase5-dev libqt5svg5-dev + ``` To install Qt 6, the command on Ubuntu/Debian is: ``` sudo apt-get install qt6-base-dev libqt6svg6-dev ``` - The installation directory for the CMake variable `Qt5_DIR`(for Qt5) or `Qt_PATH`(for Qt6) will then be `/usr/lib/x86_64-linux-gnu/cmake/`. + The installation directory for the CMake variable `Qt_PATH` will then be `/usr/lib/x86_64-linux-gnu/cmake/`. To install Qt 5, the command on Arch is: ``` @@ -56,7 +60,7 @@ ``` sudo pacman -S qt6-base ``` - The installation directory for the CMake variable `Qt5_DIR`(for Qt5) or `Qt_PATH`(for Qt6) will then be `/usr/lib/cmake/`. + The installation directory for the CMake variable `Qt_PATH` will then be `/usr/lib/cmake/`. #### All Platforms - [CMake](https://cmake.org/) (platform independent configuring system that is used for generating Makefiles, Visual Studio project files, or Xcode project files) @@ -97,15 +101,15 @@ If you installed Qt in the default location, it should find Qt automatically. ### Configuring SCIRun with Qt 5 -Building SCIRun with Qt 5 requires additional input. Use the `Qt5_PATH` CMake variable to point to the Qt 5 build location. Look at the Qt install steps above for information about the directory. This can be done through the command line with a command similar to: +Building SCIRun with Qt 5 requires additional input. Use the `Qt_PATH` CMake variable to point to the Qt 5 build location. Look at the Qt install steps above for information about the directory. This can be done through the command line with a command similar to: ``` -cmake -DQt5_PATH=path_to_Qt5_build/ ../Superbuild/ +cmake -DQt_PATH=path_to_Qt5_build/ ../Superbuild/ ``` Or they can be set in the CMake GUI or with the `ccmake` function. The command will be similar to the following: ``` -cmake -DQt5_PATH=path_to_Qt5/5.15.1/clang_64/ ../Superbuild/ +cmake -DQt_PATH=path_to_Qt5/5.15.1/clang_64/ ../Superbuild/ ``` ### Configuring SCIRun with Qt 6 From f74d473015186f0bae5a5d6132ca8910b3ce6ec9 Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Mon, 16 Dec 2024 09:53:22 -0600 Subject: [PATCH 6/9] Bump install-qt-action to v4 Signed-off-by: Georgia Stuart --- .github/workflows/mac.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 8b11e3ddf6..61a91e07f8 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: @@ -75,7 +75,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: @@ -118,7 +118,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: From 3d4a14366c790536789f5768cf6ce806b9c79c5d Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Mon, 16 Dec 2024 19:13:53 -0600 Subject: [PATCH 7/9] Update actions Signed-off-by: Georgia Stuart --- .github/workflows/mac.yml | 12 ++++++------ .github/workflows/windows.yml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 61a91e07f8..6c5b1d006e 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -24,7 +24,7 @@ jobs: version: 5.15.2 target: desktop host: mac - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Print out Qt directory @@ -47,7 +47,7 @@ jobs: ./repair_package.sh - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: SCIRunMacInstaller path: bin/SCIRun/SCIRun-5.0.beta.*-Darwin.pkg @@ -82,7 +82,7 @@ jobs: version: 5.15.2 target: desktop host: mac - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Prepare @@ -102,7 +102,7 @@ jobs: ./repair_package.sh - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: SCIRunMacNPInstaller path: bin/SCIRun/SCIRun-5.0.beta.*-Darwin.pkg @@ -125,7 +125,7 @@ jobs: version: 5.15.2 target: desktop host: mac - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Print out Qt directory @@ -148,7 +148,7 @@ jobs: ./repair_package.sh - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: SCIRunMacOsprayInstaller path: bin/SCIRun/SCIRun-5.0.beta.*-Darwin.pkg diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ae20c6175d..b6d2b72ecf 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -45,7 +45,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: @@ -76,7 +76,7 @@ jobs: run: cmake --build . --config Release --target package - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 continue-on-error: true with: name: SCIRunWindowsInstaller_qt5 @@ -93,7 +93,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: @@ -124,7 +124,7 @@ jobs: run: cmake --build . --config Release --target package - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 continue-on-error: true with: name: SCIRunWindowsInstaller_qt6 @@ -141,7 +141,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: @@ -169,7 +169,7 @@ jobs: run: cmake --build . --config Release --target package - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 continue-on-error: true with: name: SCIRunWindowsPythonInstaller @@ -197,7 +197,7 @@ jobs: fetch-depth: 0 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' with: @@ -225,7 +225,7 @@ jobs: run: cmake --build . --config Release --target package - name: Upload installer - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 continue-on-error: true with: name: SCIRunWindowsOsprayInstaller From b7ca08844c0c262dee2ce6a3bc66ec658c8f33d1 Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Tue, 17 Dec 2024 19:49:40 -0600 Subject: [PATCH 8/9] Update src/Main/scirunMain.cc Co-authored-by: Dan White --- src/Main/scirunMain.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Main/scirunMain.cc b/src/Main/scirunMain.cc index eedd0544de..2c3caadc03 100644 --- a/src/Main/scirunMain.cc +++ b/src/Main/scirunMain.cc @@ -65,11 +65,13 @@ int mainImpl(int argc, const char* argv[], char **environment) //TODO: must read --headless flag here, or try pushing command queue building all the way up here //TODO: https://doc.qt.io/qt-5/qapplication.html#details #ifndef BUILD_HEADLESS - if (!Application::Instance().parameters()->disableGui() && !Application::Instance().parameters()->help()) { - return GuiApplication::run(argc, argv); - } else { + if (Application::Instance().parameters()->disableGui() || Application::Instance().parameters()->help()) + { return ConsoleApplication::run(argc, argv); } + + return GuiApplication::run(argc, argv); + #else return ConsoleApplication::run(argc, argv); #endif From 7d955be5dcd06560cdde425a3f1edf25d9ba2188 Mon Sep 17 00:00:00 2001 From: Georgia Stuart Date: Tue, 17 Dec 2024 20:00:10 -0600 Subject: [PATCH 9/9] Update workflows Signed-off-by: Georgia Stuart --- .github/workflows/mac.yml | 16 ---------------- .github/workflows/windows.yml | 10 +++++----- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6c5b1d006e..8630d5efdd 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -30,10 +30,6 @@ jobs: - name: Print out Qt directory run: echo $Qt5_DIR; echo $Qt5_Dir - - name: Prepare - run: | - ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/ /usr/local/include/X11 - - name: make run: ./build.sh -DQt_PATH="${Qt5_Dir}" @@ -85,10 +81,6 @@ jobs: setup-python: 'true' install-deps: true - - name: Prepare - run: | - ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/ /usr/local/include/X11 - - name: make run: ./build.sh -DBUILD_WITH_PYTHON=OFF -DQt_PATH="${Qt5_Dir}" @@ -131,10 +123,6 @@ jobs: - name: Print out Qt directory run: echo $Qt5_DIR; echo $Qt5_Dir - - name: Prepare - run: | - ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/ /usr/local/include/X11 - - name: make run: ./build.sh -DWITH_OSPRAY:BOOL=ON -DQt_PATH="${Qt5_Dir}" @@ -173,10 +161,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Prepare - run: | - ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/ /usr/local/include/X11 - - name: Compile run: ./build.sh -DBUILD_HEADLESS:BOOL=ON -DBUILD_TESTING:BOOL=ON diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b6d2b72ecf..c67ad7f4d4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -53,7 +53,7 @@ jobs: target: desktop host: windows arch: win64_msvc2019_64 - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Print out Qt directory @@ -101,7 +101,7 @@ jobs: target: desktop host: windows arch: win64_msvc2019_64 - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Print out Qt directory @@ -110,7 +110,7 @@ jobs: - name: Configure working-directory: bin run: | - cmake ..\Superbuild -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 16 2019" -Ax64 -DSCIRUN_QT_MIN_VERSION:STRING="6.3.1" -DQt_PATH:PATH="$env:Qt6_Dir" -DBUILD_WITH_PYTHON:BOOL=OFF + cmake ..\Superbuild -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 16 2019" -Ax64 -DSCIRUN_QT_MIN_VERSION:STRING="6.3.1" -DQt_PATH:PATH="$env:QT_ROOT_DIR" -DBUILD_WITH_PYTHON:BOOL=OFF - name: Compile working-directory: bin @@ -149,7 +149,7 @@ jobs: target: desktop host: windows arch: win64_msvc2019_64 - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Configure @@ -205,7 +205,7 @@ jobs: target: desktop host: windows arch: win64_msvc2019_64 - setup-python: 'false' + setup-python: 'true' install-deps: true - name: Configure