diff --git a/.github/workflows/Dockerfile_opengate_core b/.github/workflows/Dockerfile_opengate_core index b764de92e..0bda21bda 100644 --- a/.github/workflows/Dockerfile_opengate_core +++ b/.github/workflows/Dockerfile_opengate_core @@ -4,27 +4,35 @@ #build: docker build -t tbaudier/opengate_core -f Dockerfile_opengate_core . #push: docker push tbaudier/opengate_core #run: docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDERMANYLINUX}" -v $(Pipeline.Workspace)/software:/home tbaudier/opengate_core /home/opengate_core/azureCreateWheelLinux.sh -#interactive: docker run -ti --rm -v $(Pipeline.Workspace)/software:/home quay.io/pypa/manylinux2014_x86_64 /bin/bash +#interactive: docker run -ti --rm -v $PWD:/home quay.io/pypa/manylinux_2_28_x86_64 /bin/bash -FROM quay.io/pypa/manylinux2014_x86_64 +FROM quay.io/pypa/manylinux_2_28_x86_64 MAINTAINER Thomas Baudier #Install packages -RUN yum install -y gcc wget git expat-devel fftw-devel qt5-qtbase-devel freeglut-devel libXmu-devel xerces-c-devel \ +RUN yum install -y gcc wget git expat-devel fftw-devel freeglut-devel libXmu-devel libxkbcommon-x11-devel.x86_64 libxcb-devel.x86_64 xcb-util.x86_64 xcb-util-wm.x86_64 xcb-util-keysyms.x86_64 xcb-util-image.x86_64 xcb-util-renderutil.x86_64 libwayland-cursor.x86_64 libwayland-egl.x86_64 \ + +#Install xcb_cursor needed by qt6 + && wget https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/x/xcb-util-cursor-0.1.3-9.el8.x86_64.rpm \ + && yum install -y xcb-util-cursor-0.1.3-9.el8.x86_64.rpm \ + && rm -rf xcb-util-cursor-0.1.3-9.el8.x86_64.rpm \ + +#Install qt6 manually #Create folder - && mkdir -p /software/cmake /software/geant4/src /software/geant4/bin /software/geant4/data /software/itk/src /software/itk/bin /software/wheelhouse \ + && mkdir -p /software/cmake /software/geant4/src /software/geant4/bin /software/itk/src /software/itk/bin /software/wheelhouse \ #Install cmake && cd /software/cmake \ && wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.tar.gz \ && tar xzvf cmake-3.18.2-Linux-x86_64.tar.gz \ + && rm -rf cmake-3.18.2-Linux-x86_64.tar.gz \ && export PATH=/software/cmake/cmake-3.18.2-Linux-x86_64/bin/:${PATH} \ #Compile Geant4 && cd /software/geant4 \ && git clone --branch v11.2.1 https://github.com/Geant4/geant4.git --depth 1 src \ && cd bin \ - && cmake -DCMAKE_CXX_FLAGS=-std=c++17 -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_USE_GDML=ON -DGEANT4_INSTALL_DATA=OFF -DGEANT4_INSTALL_DATADIR=/sofware/geant4/data -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON ../src \ + && cmake -DCMAKE_CXX_FLAGS=-std=c++17 -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_USE_GDML=OFF -DGEANT4_INSTALL_DATA=OFF -DGEANT4_INSTALL_DATADIR=/sofware/geant4/data -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT_QT6=ON -DQT_DIR=/opt/Qt/6.7.2/gcc_64/lib/cmake/Qt6 -DQt6_DIR=/opt/Qt/6.7.2/gcc_64/lib/cmake/Qt6 -DQt6OpenGLWidgets_DIR=/opt/Qt/6.7.2/gcc_64/lib/cmake/Qt6OpenGLWidgets ../src \ && make -j10 \ && source /software/geant4/bin/geant4make.sh \ diff --git a/.github/workflows/createWheelLinux.sh b/.github/workflows/createWheelLinux.sh index 8e101335c..86a3659dc 100755 --- a/.github/workflows/createWheelLinux.sh +++ b/.github/workflows/createWheelLinux.sh @@ -7,11 +7,11 @@ export PATH=/software/cmake/cmake-3.18.2-Linux-x86_64/bin/:${PATH} source /software/geant4/bin/geant4make.sh export CMAKE_PREFIX_PATH=/software/geant4/bin:/software/itk/bin/:${CMAKE_PREFIX_PATH} mkdir opengate_core/plugins -cp -r /lib64/qt5/plugins/platforms opengate_core/plugins -cp -r /lib64/qt5/plugins/imageformats opengate_core/plugins +cp -r /opt/Qt/6.7.2/gcc_64/plugins/platforms/* opengate_core/plugins +cp -r /opt/Qt/6.7.2/gcc_64/plugins/* opengate_core/plugins /opt/python/${PYTHONFOLDER}/bin/pip install wget colored /opt/python/${PYTHONFOLDER}/bin/python setup.py sdist bdist_wheel -auditwheel repair /home/core/dist/*.whl -w /software/wheelhouse/ --plat "manylinux2014_x86_64" +auditwheel repair /home/core/dist/*.whl -w /software/wheelhouse/ --plat "manylinux_2_28_x86_64" cp -r /software/wheelhouse /home/ #/opt/python/${PYTHONFOLDER}/bin/pip install twine #/opt/python/${PYTHONFOLDER}/bin/twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*manylinux2014*.whl diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7f18c846..7be7d5789 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -91,7 +91,7 @@ jobs: export PYTHONFOLDER="cp312-cp312" fi mkdir -p $HOME/software - docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${{ env.GEANT4_VERSION }} /home/.github/workflows/createWheelLinux.sh + docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${{ env.GEANT4_VERSION }}_qt6 /home/.github/workflows/createWheelLinux.sh ls wheelhouse rm -rf dist mv wheelhouse dist @@ -102,6 +102,23 @@ jobs: ls -lrt dist_opengate/ mv dist_opengate/* dist/ fi + - name: Create opengate_core Wheel Linux for old OS + if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + run: | + if [ ${{ matrix.python-version }} == "3.9" ]; then + export PYTHONFOLDER="cp39-cp39" + elif [ ${{ matrix.python-version }} == "3.10" ]; then + export PYTHONFOLDER="cp310-cp310" + elif [ ${{ matrix.python-version }} == "3.11" ]; then + export PYTHONFOLDER="cp311-cp311" + elif [ ${{ matrix.python-version }} == "3.12" ]; then + export PYTHONFOLDER="cp312-cp312" + fi + mkdir -p $HOME/software + docker run --rm -e "PYTHONFOLDER=${PYTHONFOLDER}" -v $GITHUB_WORKSPACE:/home tbaudier/opengate_core:${{ env.GEANT4_VERSION }} /home/.github/workflows/createWheelLinux.sh + ls wheelhouse + mv wheelhouse/* dist/ + sudo chown -R runner:docker dist - uses: conda-incubator/setup-miniconda@v3 if: (matrix.os == 'macos-12') || (matrix.os == 'windows-latest') with: diff --git a/docs/source/developer_guide.md b/docs/source/developer_guide.md index 784b967c0..29bb41eb5 100644 --- a/docs/source/developer_guide.md +++ b/docs/source/developer_guide.md @@ -37,10 +37,10 @@ The subpackage `opengate_core` depends on the ITK and Geant4 libraries. Therefor Installing QT is optional. Currently, QT visualisation is not working on all architectures. -If you wish to use QT, you must install qt5 **before** installing Geant4 so that Geant4 can find the correct qt lib. It can be done for example with conda: +If you wish to use QT, you must install qt6 **before** installing Geant4 so that Geant4 can find the correct qt lib. It can be done for example with conda: ```bash - conda install qt=5 + conda install conda-forge::qt6-main conda::forge::qt6-3d ``` For **Geant4**, you need to compile with the following options: @@ -54,6 +54,7 @@ cmake -DCMAKE_CXX_FLAGS=-std=c++17 \ -DGEANT4_INSTALL_DATADIR=$HOME/software/geant4/data \ -DGEANT4_USE_QT=ON \ -DGEANT4_USE_OPENGL_X11=ON \ + -DGEANT4_USE_QT_QT6=ON \ -DGEANT4_BUILD_MULTITHREADED=ON \ ../geant4 make -j 32 @@ -61,7 +62,7 @@ make -j 32 Change the QT flag (GEANT4_USE_QT) to OFF if you did not install QT. -WARNING : since June 2023, [Geant4 11.1.1](https://geant4.web.cern.ch/download/11.1.1.html) is needed. +WARNING : since June 2023, [Geant4 11.2.1](https://geant4.web.cern.ch/download/11.2.1.html) is needed. #### STEP 2 - ITK