From 1212c36babc93082fd3f72328bed0c792246827b Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 11:52:05 +0200 Subject: [PATCH 1/8] debug messages in CMakeLists.txt --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5410ab8..66961e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,7 @@ set(PYBIND11_VERSION "v2.13.6") set(Geant4_VERSION "11.2.2") if (NOT DEFINED SKBUILD_PROJECT_NAME) - # IDE - set(SKBUILD_PROJECT_NAME geant4-python-application) + set(SKBUILD_PROJECT_NAME geant4-python-application) # required for JetBrains IDEs to show a readable name endif () project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX) @@ -35,8 +34,11 @@ find_package( COMPONENTS ${GEANT4_COMPONENTS} REQUIRED) -message(STATUS "Using Geant4 ${Geant4_VERSION} from ${Geant4_DIR}") +message(STATUS "Using CMake ${CMAKE_VERSION}. CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") message(STATUS "Using Python ${Python_VERSION} from ${Python_EXECUTABLE}") +message(STATUS "Using awkward ${AWKWARD_VERSION}") +message(STATUS "Using pybind11 ${PYBIND11_VERSION}") +message(STATUS "Using Geant4 ${Geant4_VERSION} from ${Geant4_DIR} with components: ${GEANT4_COMPONENTS}") include(FetchContent) From 3c8ca3b4a1bc05d2ec1ea2baaeab6bcff51ce65c Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 12:01:20 +0200 Subject: [PATCH 2/8] add binder environment.yaml --- .binder/environment.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .binder/environment.yaml diff --git a/.binder/environment.yaml b/.binder/environment.yaml new file mode 100644 index 0000000..fac0c71 --- /dev/null +++ b/.binder/environment.yaml @@ -0,0 +1,7 @@ +name: geant4-python-application +channels: + - conda-forge +dependencies: + - python=3.12 + - geant4=11.2.2 + - matplotlib From 610c69801c4f26f57301fc8f32c59e2c222e4b94 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 12:01:49 +0200 Subject: [PATCH 3/8] remove comment --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66961e4..05792bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,6 @@ find_package( COMPONENTS Interpreter Development.Module REQUIRED) -# define geant4 components in a conditional way, "gdml static" if release build, -# "gdml" otherwise set(GEANT4_COMPONENTS "gdml") if (CMAKE_BUILD_TYPE STREQUAL "Release") set(GEANT4_COMPONENTS "gdml static") From 0056c0e780d52b179c186e3fa5dda75d6b66dc3a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:02:33 +0000 Subject: [PATCH 4/8] style: pre-commit fixes --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05792bc..3b71a7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,9 @@ set(PYBIND11_VERSION "v2.13.6") set(Geant4_VERSION "11.2.2") if (NOT DEFINED SKBUILD_PROJECT_NAME) - set(SKBUILD_PROJECT_NAME geant4-python-application) # required for JetBrains IDEs to show a readable name + set(SKBUILD_PROJECT_NAME geant4-python-application) # required for JetBrains + # IDEs to show a + # readable name endif () project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX) @@ -32,11 +34,15 @@ find_package( COMPONENTS ${GEANT4_COMPONENTS} REQUIRED) -message(STATUS "Using CMake ${CMAKE_VERSION}. CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") +message( + STATUS "Using CMake ${CMAKE_VERSION}. CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") message(STATUS "Using Python ${Python_VERSION} from ${Python_EXECUTABLE}") message(STATUS "Using awkward ${AWKWARD_VERSION}") message(STATUS "Using pybind11 ${PYBIND11_VERSION}") -message(STATUS "Using Geant4 ${Geant4_VERSION} from ${Geant4_DIR} with components: ${GEANT4_COMPONENTS}") +message( + STATUS + "Using Geant4 ${Geant4_VERSION} from ${Geant4_DIR} with components: ${GEANT4_COMPONENTS}" +) include(FetchContent) From 255b8c3e2df71b8f1dfac99ccc29eb22f2d1abf6 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 12:16:46 +0200 Subject: [PATCH 5/8] binder with conda --- .binder/Dockerfile | 25 +++++++++++++++++++++++++ .binder/environment.yaml | 7 ------- Dockerfile => dev/Dockerfile | 0 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .binder/Dockerfile delete mode 100644 .binder/environment.yaml rename Dockerfile => dev/Dockerfile (100%) diff --git a/.binder/Dockerfile b/.binder/Dockerfile new file mode 100644 index 0000000..ab50c2f --- /dev/null +++ b/.binder/Dockerfile @@ -0,0 +1,25 @@ +FROM continuumio/miniconda3:main + +# install conda deps +RUN conda install -c conda-forge geant4=11.2.2 matplotlib jupyterlab + +COPY . /src + +RUN cd /src && pip install . && rm -rf /src + +ARG NB_USER=user +ARG NB_UID=1000 +ENV USER ${NB_USER} +ENV NB_UID ${NB_UID} +ENV HOME /home/${NB_USER} + +RUN adduser --disabled-password \ + --gecos "Default user" \ + --uid ${NB_UID} \ + ${NB_USER} + +COPY ./examples/*.ipynb ${HOME}/ +RUN chown -R ${NB_UID} ${HOME} +USER ${NB_USER} + +WORKDIR ${HOME} diff --git a/.binder/environment.yaml b/.binder/environment.yaml deleted file mode 100644 index fac0c71..0000000 --- a/.binder/environment.yaml +++ /dev/null @@ -1,7 +0,0 @@ -name: geant4-python-application -channels: - - conda-forge -dependencies: - - python=3.12 - - geant4=11.2.2 - - matplotlib diff --git a/Dockerfile b/dev/Dockerfile similarity index 100% rename from Dockerfile rename to dev/Dockerfile From 5ccc092a38d0c47b25f61cf56c1bd410d9ee0e01 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 12:24:45 +0200 Subject: [PATCH 6/8] add deps --- .binder/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.binder/Dockerfile b/.binder/Dockerfile index ab50c2f..7ba5ae6 100644 --- a/.binder/Dockerfile +++ b/.binder/Dockerfile @@ -1,7 +1,7 @@ FROM continuumio/miniconda3:main # install conda deps -RUN conda install -c conda-forge geant4=11.2.2 matplotlib jupyterlab +RUN conda install -c conda-forge gxx_linux-64 cmake geant4=11.2.2 matplotlib jupyterlab COPY . /src From e64e027c2c6a8000b18157e205d29dcb3badc817 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 12:26:58 +0200 Subject: [PATCH 7/8] add yes to conda --- .binder/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.binder/Dockerfile b/.binder/Dockerfile index 7ba5ae6..6433e4b 100644 --- a/.binder/Dockerfile +++ b/.binder/Dockerfile @@ -1,7 +1,7 @@ FROM continuumio/miniconda3:main -# install conda deps -RUN conda install -c conda-forge gxx_linux-64 cmake geant4=11.2.2 matplotlib jupyterlab +# install conda deps (auto y) +RUN conda install --yes -c conda-forge gxx_linux-64 cmake geant4=11.2.2 matplotlib jupyterlab COPY . /src From 27a74a81c9ac3900781758d66220aff4653fb857 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 14 Oct 2024 12:35:08 +0200 Subject: [PATCH 8/8] attempt to fix conda build --- .binder/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.binder/Dockerfile b/.binder/Dockerfile index 6433e4b..5b03b75 100644 --- a/.binder/Dockerfile +++ b/.binder/Dockerfile @@ -5,7 +5,7 @@ RUN conda install --yes -c conda-forge gxx_linux-64 cmake geant4=11.2.2 matplotl COPY . /src -RUN cd /src && pip install . && rm -rf /src +RUN cd /src && export CXX=$(which g++) && pip install . && rm -rf /src ARG NB_USER=user ARG NB_UID=1000