diff --git a/.binder/Dockerfile b/.binder/Dockerfile new file mode 100644 index 0000000..5b03b75 --- /dev/null +++ b/.binder/Dockerfile @@ -0,0 +1,25 @@ +FROM continuumio/miniconda3:main + +# install conda deps (auto y) +RUN conda install --yes -c conda-forge gxx_linux-64 cmake geant4=11.2.2 matplotlib jupyterlab + +COPY . /src + +RUN cd /src && export CXX=$(which g++) && 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/CMakeLists.txt b/CMakeLists.txt index 5410ab8..3b71a7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,9 @@ 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) @@ -23,8 +24,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") @@ -35,8 +34,15 @@ 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) diff --git a/Dockerfile b/dev/Dockerfile similarity index 100% rename from Dockerfile rename to dev/Dockerfile