From 927542aa41ecd7f519ca9d11418f62153a851a1b Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Thu, 28 Sep 2023 21:04:38 +0000 Subject: [PATCH 1/7] Fix Binder run --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d9b6e3c3..226fb507 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ ENV LC_ALL=en_US.UTF-8 \ # Install all OS dependencies for notebook server that starts but lacks all # features (e.g., download as all possible file formats) RUN \ + set -x && \ apt-get update --yes && \ apt-get install --yes --no-install-recommends pciutils && \ _CUDA_=$(lspci -nn | grep '\[03' | grep NVIDIA) && \ From d8dbdd4cf6334c5aa2c8eba76ac7802120bf8b68 Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Thu, 28 Sep 2023 21:10:50 +0000 Subject: [PATCH 2/7] Fix Binder run --- Dockerfile | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 226fb507..8b74df8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,24 +32,25 @@ RUN \ set -x && \ apt-get update --yes && \ apt-get install --yes --no-install-recommends pciutils && \ - _CUDA_=$(lspci -nn | grep '\[03' | grep NVIDIA) && \ + lspci && \ + export_CUDA_="$(lspci -nn | grep '\[03' | grep NVIDIA)" && \ apt-get install --yes --no-install-recommends \ - #fonts-liberation, pandoc, run-one are inherited from base-notebook container image + #fonts-liberation, pandoc, run-one are inherited from base-notebook container image # Other "our" apt installs - unzip \ - curl \ - jq \ - ###libomp-dev \ + unzip \ + curl \ + jq \ + ###libomp-dev \ # Other "our" apt installs (development and testing) - build-essential \ - git \ - nano-tiny \ - less \ - gdb valgrind \ - emacs \ + build-essential \ + git \ + nano-tiny \ + less \ + gdb valgrind \ + emacs \ # CUDA - #cuda \ - $([ -n "$_CUDA_" ] && echo nvidia-cuda-toolkit) \ + #cuda \ + $([ -n "$_CUDA_" ] && echo nvidia-cuda-toolkit) \ && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ From 933cbef632c4dccafbf36cacec1a30dd7eb68358 Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Thu, 28 Sep 2023 21:47:31 +0000 Subject: [PATCH 3/7] Fix Binder run --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8b74df8b..e6a94a7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ RUN \ apt-get update --yes && \ apt-get install --yes --no-install-recommends pciutils && \ lspci && \ - export_CUDA_="$(lspci -nn | grep '\[03' | grep NVIDIA)" && \ + export _CUDA_="$(lspci -nn | grep '\[03' | grep NVIDIA)" && \ apt-get install --yes --no-install-recommends \ #fonts-liberation, pandoc, run-one are inherited from base-notebook container image # Other "our" apt installs From d111b104608155a1fd418bcc6ff8dc9edbad7138 Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Fri, 29 Sep 2023 18:02:07 +0000 Subject: [PATCH 4/7] Add BuildType arg --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6a94a7d..3b51fe3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ ARG BASE_TAG=ubuntu-22.04 ARG BASE_TAG=python-3.10.6 FROM $BASE_CONTAINER:$BASE_TAG +ARG BUILD_TYPE=Release + LABEL maintainer="Xeus-clang-repl Project" #LABEL com.nvidia.volumes.needed="nvidia_driver" @@ -248,7 +250,7 @@ RUN \ mkdir build && \ cd build && \ export CPPINTEROP_BUILD_DIR=$PWD && \ - cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_CLING=OFF -DUSE_REPL=ON -DLLVM_DIR=$PATH_TO_LLVM_BUILD -DLLVM_USE_LINKER=gold -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$CPPINTEROP_DIR .. && \ + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_CLING=OFF -DUSE_REPL=ON -DLLVM_DIR=$PATH_TO_LLVM_BUILD -DLLVM_USE_LINKER=gold -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$CPPINTEROP_DIR .. && \ cmake --build . --parallel $(nproc --all) && \ #make install -j$(nproc --all) export CPLUS_INCLUDE_PATH="$CPPINTEROP_DIR/include:$CPLUS_INCLUDE_PATH" && \ @@ -264,7 +266,7 @@ RUN \ # Install CppInterOp (cd $CPPINTEROP_BUILD_DIR && cmake --build . --target install --parallel $(nproc --all)) && \ # Build and Install cppyy-backend - cmake -DCMAKE_BUILD_TYPE=Debug -DCppInterOp_DIR=$CPPINTEROP_DIR .. && \ + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCppInterOp_DIR=$CPPINTEROP_DIR .. && \ cmake --build . --parallel $(nproc --all) && \ cp libcppyy-backend.so $CPPINTEROP_DIR/lib/ && \ cd ../.. && \ @@ -275,7 +277,7 @@ RUN \ git clone https://github.com/compiler-research/CPyCppyy.git && \ cd CPyCppyy && \ mkdir build && cd build && \ - cmake -DCMAKE_BUILD_TYPE=Debug .. && \ + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && \ cmake --build . --parallel $(nproc --all) && \ export CPYCPPYY_DIR=$PWD && \ cd ../.. && \ @@ -303,7 +305,7 @@ RUN \ cd build && \ echo "export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> ~/.profile && \ ##echo "conda activate .venv" >> ~/.profile - cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_CMAKE_DIR=$PATH_TO_LLVM_BUILD -DCMAKE_PREFIX_PATH=$KERNEL_PYTHON_PREFIX -DCMAKE_INSTALL_PREFIX=$KERNEL_PYTHON_PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DLLVM_CONFIG_EXTRA_PATH_HINTS=${PATH_TO_LLVM_BUILD}/lib -DCPPINTEROP_DIR=$CPPINTEROP_BUILD_DIR -DLLVM_USE_LINKER=gold .. && \ + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DLLVM_CMAKE_DIR=$PATH_TO_LLVM_BUILD -DCMAKE_PREFIX_PATH=$KERNEL_PYTHON_PREFIX -DCMAKE_INSTALL_PREFIX=$KERNEL_PYTHON_PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DLLVM_CONFIG_EXTRA_PATH_HINTS=${PATH_TO_LLVM_BUILD}/lib -DCPPINTEROP_DIR=$CPPINTEROP_BUILD_DIR -DLLVM_USE_LINKER=gold .. && \ make install -j$(nproc --all) && \ cd .. && \ # @@ -313,7 +315,7 @@ RUN \ cd clad && \ mkdir build && \ cd build && \ - cmake -DCMAKE_BUILD_TYPE=Debug .. -DClang_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/clang/ -DLLVM_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/llvm/ -DCMAKE_INSTALL_PREFIX=${CONDA_DIR} -DLLVM_EXTERNAL_LIT="$(which lit)" && \ + cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. -DClang_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/clang/ -DLLVM_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/llvm/ -DCMAKE_INSTALL_PREFIX=${CONDA_DIR} -DLLVM_EXTERNAL_LIT="$(which lit)" && \ make -j$(nproc --all) && \ make install && \ ### install clad in all exist kernels From 0c223b49a27291d354eae32b47d5fb03d6b8fc67 Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Fri, 29 Sep 2023 18:18:25 +0000 Subject: [PATCH 5/7] Disable temporary build clad --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b51fe3b..edae97b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -316,8 +316,8 @@ RUN \ mkdir build && \ cd build && \ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. -DClang_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/clang/ -DLLVM_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/llvm/ -DCMAKE_INSTALL_PREFIX=${CONDA_DIR} -DLLVM_EXTERNAL_LIT="$(which lit)" && \ - make -j$(nproc --all) && \ - make install && \ + #make -j$(nproc --all) && \ + #make install && \ ### install clad in all exist kernels ##for i in "$KERNEL_PYTHON_PREFIX"/share/jupyter/kernels/*; do if [[ $i =~ .*/clad-xcpp.* ]]; then jq '.argv += ["-fplugin=$KERNEL_PYTHON_PREFIX/lib/clad.so"] | .display_name += " (with clad)"' "$i"/kernel.json > tmp.$$.json && mv tmp.$$.json "$i"/kernel.json; fi; done && \ ### From c89ba1574eb92979f7587ae439a893aa7968b19f Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Fri, 29 Sep 2023 19:26:16 +0000 Subject: [PATCH 6/7] Disable temporary parallel build clad --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index edae97b3..13c2d936 100644 --- a/Dockerfile +++ b/Dockerfile @@ -316,8 +316,9 @@ RUN \ mkdir build && \ cd build && \ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. -DClang_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/clang/ -DLLVM_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/llvm/ -DCMAKE_INSTALL_PREFIX=${CONDA_DIR} -DLLVM_EXTERNAL_LIT="$(which lit)" && \ - #make -j$(nproc --all) && \ - #make install && \ + №make -j$(nproc --all) && \ + make && \ + make install && \ ### install clad in all exist kernels ##for i in "$KERNEL_PYTHON_PREFIX"/share/jupyter/kernels/*; do if [[ $i =~ .*/clad-xcpp.* ]]; then jq '.argv += ["-fplugin=$KERNEL_PYTHON_PREFIX/lib/clad.so"] | .display_name += " (with clad)"' "$i"/kernel.json > tmp.$$.json && mv tmp.$$.json "$i"/kernel.json; fi; done && \ ### From 1c82994b6cb16367836edb906194141b2ce47546 Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Fri, 29 Sep 2023 19:46:27 +0000 Subject: [PATCH 7/7] Disable temporary parallel build clad --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 13c2d936..bc7c7606 100644 --- a/Dockerfile +++ b/Dockerfile @@ -316,7 +316,7 @@ RUN \ mkdir build && \ cd build && \ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. -DClang_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/clang/ -DLLVM_DIR=${PATH_TO_LLVM_BUILD}/lib/cmake/llvm/ -DCMAKE_INSTALL_PREFIX=${CONDA_DIR} -DLLVM_EXTERNAL_LIT="$(which lit)" && \ - №make -j$(nproc --all) && \ + #make -j$(nproc --all) && \ make && \ make install && \ ### install clad in all exist kernels