Skip to content

Commit

Permalink
Update cirrus with qt6 for mac M1
Browse files Browse the repository at this point in the history
Install qt6 with brew instead of conda
With conda, during ccmake of geant4, I have to set QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR. Even with that I still have problem due to a cross-compile of qt6

workaround for delocate https://github.c/neuronsimulator/nrn/pull/1897
  • Loading branch information
tbaudier committed Sep 10, 2024
1 parent efe5f3a commit f56f415
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest

build_wheel_task:
skip: $CIRRUS_BRANCH != 'master' && $CIRRUS_TAG == ''

env:
PATH: $HOME/miniconda3/bin/:$PATH
Expand Down Expand Up @@ -35,20 +34,22 @@ build_wheel_task:
- conda list
- which python
- pip install wget colored
- pip install cibuildwheel==2.11.2
- conda install -c conda-forge qt==5.15.6
- pip install wheel delocate
- brew install qt
- mkdir -p $HOME/software
- cd $HOME/software
- mkdir -p geant4
- cd geant4
- rm -rf src bin data
- mkdir -p src bin data
- if [ ! -d "src/source" ] ; then git clone --branch v11.1.1 https://github.com/Geant4/geant4.git --depth 1 src ; fi
- if [ ! -d "src/source" ] ; then git clone --branch v11.2.1 https://github.com/Geant4/geant4.git --depth 1 src ; fi
- cd bin
- cmake -DCMAKE_CXX_FLAGS=-std=c++17
-DGEANT4_INSTALL_DATA=OFF
-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
-DGEANT4_USE_SYSTEM_EXPAT=OFF
-DGEANT4_USE_GDML=ON
Expand All @@ -57,6 +58,7 @@ build_wheel_task:
- cd $HOME/software
- mkdir -p itk
- cd itk
- rm -rf src bin
- mkdir -p src bin
- if [ ! -d "src/CMake" ] ; then git clone --branch v5.2.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1 src ; fi
- cd bin
Expand All @@ -70,18 +72,26 @@ build_wheel_task:

opengate_core_script:
- echo $PWD
- ls $HOME/miniconda3/plugins/platforms
- ls /opt/homebrew/share/qt/plugins/platforms
- source $HOME/software/geant4/bin/geant4make.sh
- export CMAKE_PREFIX_PATH=$HOME/software/geant4/bin:$HOME/software/itk/bin/:${CMAKE_PREFIX_PATH}
- ls
- cd core
- mkdir opengate_core/plugins
- mkdir opengate_core/plugins/miniconda
- ls $HOME/miniconda3/lib/
- cp -r /opt/homebrew/share/qt/plugins/platforms/* opengate_core/plugins/
- cp -r /opt/homebrew/share/qt/plugins/imageformats/* opengate_core/plugins/
- ls /opt/homebrew/lib
- rm -rf dist
- python3 setup.py sdist bdist_wheel
- ls dist
- export DYLD_LIBRARY_PATH=$HOME/software/geant4/bin/BuildProducts/lib:/opt/homebrew/share/qt/plugins/platforms/:/opt/X11/lib/:$DYLD_LIBRARY_PATH:/opt/homebrew/lib
- python -c "import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i."" "s/first, /input.pop('i386',None); first, /g" {}
- delocate-listdeps --all dist/*.whl
- delocate-wheel -w fixed_wheels -v dist/*.whl
- rm -rf dist
- export CIBW_BEFORE_BUILD="python -m pip install colored;
python -c \"import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()\" | xargs -I{} sed -i.\"\" \"s/first, /input.pop('i386',None); first, /g\" {}"
- python -m cibuildwheel --output-dir dist
- ls fixed_wheels
- delocate-listdeps --all fixed_wheels/*.whl
- mv fixed_wheels dist
- cd dist
- cd ../..
- mv core/dist .
Expand Down

0 comments on commit f56f415

Please sign in to comment.