Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binder without Dockerfile #83

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand All @@ -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)

Expand Down
File renamed without changes.
Loading