Repository: IBM/aihwkit (language: python)

Issue:
Error occurred while building dockerfile
## Description

Tried to build docker image by dockerfile after cloning the repository, but error occurred while executing setup.py.
Is there any requirements to build dockerfile except docker / nvidia-docker?
Many thanks to your effort to keep aihwkit updated.

## How to reproduce

docker build -t aihwkit:base -f ./CUDA.Dockerfile .

Full terminal message:




>[+] Building 202.9s (18/24)                                                                                                                                 docker:default
 => [internal] load .dockerignore                                                                                                                                     0.0s
 => => transferring context: 2B                                                                                                                                       0.0s
 => [internal] load build definition from CUDA.Dockerfile                                                                                                             0.0s
 => => transferring dockerfile: 3.05kB                                                                                                                                0.0s
 => [internal] load metadata for docker.io/nvidia/cuda:12.2.2-devel-ubuntu22.04                                                                                       2.4s
 => [internal] load metadata for docker.io/nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04                                                                              1.5s
 => [internal] load metadata for docker.io/intel/oneapi-basekit:latest                                                                                                2.2s
 => [build-env  1/10] FROM docker.io/nvidia/cuda:12.2.2-devel-ubuntu22.04@sha256:ae8a022c02aec945c4f8c52f65deaf535de7abb58e840350d19391ec683f4980                     0.0s
 => [mkl-env 1/1] FROM docker.io/intel/oneapi-basekit@sha256:01f9511ea5391c9c6da74554a35b813dc5aed628a8438e593d1f3a523673d1a2                                         0.0s
 => CACHED [stage-2 1/7] FROM docker.io/nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04@sha256:2d913b09e6be8387e1a10976933642c73c840c0b735f0bf3c28d97fc9bc422e0         0.0s
 => [internal] load build context                                                                                                                                     0.0s
 => => transferring context: 39.41kB                                                                                                                                  0.0s
 => CACHED [build-env  2/10] RUN apt-get update &&     DEBIAN_FRONTEND="noninteractive" apt-get install --yes     --no-install-recommends     cmake     git     linu  0.0s
 => CACHED [build-env  3/10] RUN pip install --no-cache-dir --upgrade --no-warn-script-location pip &&     pip install --no-cache-dir --no-warn-script-location pybi  0.0s
 => CACHED [build-env  4/10] RUN groupadd -g 1000 coder &&     useradd coder     --create-home     --uid 1000     --gid 1000     --shell=/bin/bash                    0.0s
 => CACHED [build-env  5/10] COPY --from=mkl-env /opt/intel/oneapi/mkl /opt/intel/oneapi/mkl                                                                          0.0s
 => CACHED [build-env  6/10] COPY . /aihwkit                                                                                                                          0.0s
 => CACHED [build-env  7/10] RUN chown -R coder:coder /aihwkit                                                                                                        0.0s
 => CACHED [build-env  8/10] RUN pip install --no-cache-dir --no-warn-script-location torch torchvision                                                               0.0s
 => CACHED [build-env  9/10] WORKDIR /aihwkit                                                                                                                         0.0s
 => ERROR [build-env 10/10] RUN python setup.py install --user -j$(nproc)     -DCMAKE_BUILD_TYPE=Release     -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE     -DRPU_BLAS=M  200.4s
------                                                                                                                                                                     
 > [build-env 10/10] RUN python setup.py install --user -j$(nproc)     -DCMAKE_BUILD_TYPE=Release     -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE     -DRPU_BLAS=MKL     -DINTEL_MKL_DIR=/opt/intel/oneapi/mkl/latest     -DUSE_CUDA=ON     -DRPU_CUDA_ARCHITECTURES=86:                                                                                     
0.505 /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.                                                                                                                                                               
0.505   warnings.warn(                                                                                                                                                     
0.511 
0.511 
0.511 --------------------------------------------------------------------------------
0.511 -- Trying 'Ninja' generator
0.511 --------------------------------
0.511 ---------------------------
0.511 ----------------------
0.511 -----------------
0.511 ------------
0.511 -------
0.511 --
0.516 Not searching for unused variables given on the command line.
0.521 CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
0.521 -- Configuring incomplete, errors occurred!
0.521 See also "/aihwkit/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
0.521 --
0.521 -------
0.521 ------------
0.521 -----------------
0.521 ----------------------
0.521 ---------------------------
0.521 --------------------------------
0.521 -- Trying 'Ninja' generator - failure
0.521 --------------------------------------------------------------------------------
0.521 
0.521 
0.521 
0.521 --------------------------------------------------------------------------------
0.521 -- Trying 'Unix Makefiles' generator
0.521 --------------------------------
0.521 ---------------------------
0.521 ----------------------
0.521 -----------------
0.521 ------------
0.521 -------
0.521 --
0.525 Not searching for unused variables given on the command line.
0.602 -- The C compiler identification is GNU 11.4.0
0.608 -- Detecting C compiler ABI info
0.641 -- Detecting C compiler ABI info - done
0.645 -- Check for working C compiler: /usr/bin/cc - skipped
0.645 -- Detecting C compile features
0.646 -- Detecting C compile features - done
0.673 -- The CXX compiler identification is GNU 11.4.0
0.678 -- Detecting CXX compiler ABI info
0.712 -- Detecting CXX compiler ABI info - done
0.716 -- Check for working CXX compiler: /usr/bin/c++ - skipped
0.717 -- Detecting CXX compile features
0.717 -- Detecting CXX compile features - done
0.717 -- Configuring done
0.718 -- Generating done
0.718 -- Build files have been written to: /aihwkit/_cmake_test_compile/build
0.719 --
0.719 -------
0.719 ------------
0.719 -----------------
0.719 ----------------------
0.719 ---------------------------
0.719 --------------------------------
0.719 -- Trying 'Unix Makefiles' generator - success
0.719 --------------------------------------------------------------------------------
0.719 
0.812 Configuring Project
0.812   Working directory:
0.812     /aihwkit/_skbuild/linux-x86_64-3.10/cmake-build
0.812   Command:
0.812     /usr/bin/cmake /aihwkit -G 'Unix Makefiles' --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/aihwkit/_skbuild/linux-x86_64-3.10/cmake-install -DPYTHON_VERSION_STRING:STRING=3.10.12 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/usr/local/lib/python3.10/dist-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/usr/bin/python -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.10 -DPYTHON_LIBRARY:PATH=/usr/lib/x86_64-linux-gnu/libpython3.10.so -DPython_EXECUTABLE:PATH=/usr/bin/python -DPython_ROOT_DIR:PATH=/usr -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/usr/include/python3.10 -DPython_NumPy_INCLUDE_DIRS:PATH=/home/coder/.local/lib/python3.10/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/usr/bin/python -DPython3_ROOT_DIR:PATH=/usr -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/usr/include/python3.10 -DPython3_NumPy_INCLUDE_DIRS:PATH=/home/coder/.local/lib/python3.10/site-packages/numpy/core/include -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DRPU_BLAS=MKL -DINTEL_MKL_DIR=/opt/intel/oneapi/mkl/latest -DUSE_CUDA=ON -DRPU_CUDA_ARCHITECTURES=86
0.812 
0.818 Not searching for unused variables given on the command line.
0.873 -- The C compiler identification is GNU 11.4.0
0.898 -- The CXX compiler identification is GNU 11.4.0
0.901 -- Detecting C compiler ABI info
0.932 -- Detecting C compiler ABI info - done
0.935 -- Check for working C compiler: /usr/bin/cc - skipped
0.935 -- Detecting C compile features
0.936 -- Detecting C compile features - done
0.937 -- Detecting CXX compiler ABI info
0.972 -- Detecting CXX compiler ABI info - done
0.975 -- Check for working CXX compiler: /usr/bin/c++ - skipped
0.975 -- Detecting CXX compile features
0.976 -- Detecting CXX compile features - done
0.976 -- Invoking cmake through scikit-build
1.120 -- The BLAS backend of choice:MKL
1.121 -- MKL_THREADING = OMP
1.122 -- Looking for sys/types.h
1.152 -- Looking for sys/types.h - found
1.152 -- Looking for stdint.h
1.181 -- Looking for stdint.h - found
1.181 -- Looking for stddef.h
1.210 -- Looking for stddef.h - found
1.210 -- Check size of void*
1.242 -- Check size of void* - done
1.242 -- Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
1.242 --   Library mkl_intel_lp64: /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.so
1.242 --   Library mkl_gnu_thread: /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_gnu_thread.so
1.242 --   Library mkl_core: /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.so
1.244 --   Library gomp: -fopenmp
1.244 --   Library pthread: /usr/lib/x86_64-linux-gnu/libpthread.a
1.244 --   Library m: /usr/lib/x86_64-linux-gnu/libm.so
1.245 --   Library dl: /usr/lib/x86_64-linux-gnu/libdl.a
1.245 -- Looking for cblas_sgemm
1.355 -- Looking for cblas_sgemm - found
1.356 -- MKL library found
1.357 -- Performing Test C_HAS_AVX_1
1.455 -- Performing Test C_HAS_AVX_1 - Failed
1.456 -- Performing Test C_HAS_AVX_2
1.568 -- Performing Test C_HAS_AVX_2 - Success
1.568 -- Performing Test C_HAS_AVX2_1
1.657 -- Performing Test C_HAS_AVX2_1 - Failed
1.657 -- Performing Test C_HAS_AVX2_2
1.764 -- Performing Test C_HAS_AVX2_2 - Success
1.764 -- Performing Test CXX_HAS_AVX_1
1.852 -- Performing Test CXX_HAS_AVX_1 - Failed
1.852 -- Performing Test CXX_HAS_AVX_2
1.958 -- Performing Test CXX_HAS_AVX_2 - Success
1.958 -- Performing Test CXX_HAS_AVX2_1
2.047 -- Performing Test CXX_HAS_AVX2_1 - Failed
2.048 -- Performing Test CXX_HAS_AVX2_2
2.152 -- Performing Test CXX_HAS_AVX2_2 - Success
2.152 -- AVX compiler support found
2.152 -- MKL include for RPU is /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.so;/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_gnu_thread.so;/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.so;-fopenmp;/usr/lib/x86_64-linux-gnu/libpthread.a;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/libdl.a;/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_avx2.so.2
2.239 -- Found Python3: /usr/bin/python (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed 
2.265 -- Performing Test HAS_FLTO
2.317 -- Performing Test HAS_FLTO - Success
2.317 -- Found pybind11: /usr/local/lib/python3.10/dist-packages/pybind11/include (found version "2.11.1")
2.372 -- Found Python: /usr/bin/python (found version "3.10.12") found components: Interpreter 
4.282 -- Found Torch: /home/coder/.local/lib/python3.10/site-packages/torch/include;/home/coder/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include  
5.022 -- Set _GLIBCXX_USE_CXX11_ABI=0
5.430 -- The CUDA compiler identification is NVIDIA 12.2.140
5.433 -- Detecting CUDA compiler ABI info
5.825 -- Detecting CUDA compiler ABI info - done
5.838 -- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
5.838 -- Detecting CUDA compile features
5.838 -- Detecting CUDA compile features - done
5.840 -- Found CUDAToolkit: /usr/local/cuda/include (found version "12.2.140") 
5.843 -- Looking for pthread.h
5.875 -- Looking for pthread.h - found
5.875 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
5.907 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
5.907 -- Found Threads: TRUE  
5.916 -- Configuring done
5.925 -- Generating done
5.926 -- Build files have been written to: /aihwkit/_skbuild/linux-x86_64-3.10/cmake-build
5.951 [  1%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/dense_bit_line_maker.cpp.o
5.951 [  5%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu.cpp.o
5.951 [  5%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/math_util.cpp.o
5.951 [  7%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_chopped_transfer_device.cpp.o
5.951 [  7%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_buffered_transfer_device.cpp.o
5.952 [  7%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rng.cpp.o
5.952 [  8%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_constantstep_device.cpp.o
5.953 [ 10%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_hidden_device.cpp.o
5.954 [ 12%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_dynamic_transfer_device.cpp.o
5.954 [ 12%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_mixedprec_device.cpp.o
5.954 [ 15%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_expstep_device.cpp.o
5.954 [ 15%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_forward_backward_pass.cpp.o
5.954 [ 16%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_onesided_device.cpp.o
5.954 [ 17%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_linearstep_device.cpp.o
5.954 [ 18%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_piecewisestep_device.cpp.o
5.954 [ 21%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_powstep_reference_device.cpp.o
5.954 [ 21%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_pulsed_device.cpp.o
5.954 [ 22%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_pulsed.cpp.o
5.955 [ 24%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_mixedprec_device_base.cpp.o
5.955 [ 25%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_mixedprec_int_device.cpp.o
5.955 [ 26%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_softbounds_reference_device.cpp.o
5.955 [ 27%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_powstep_device.cpp.o
5.955 [ 29%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_simple_device.cpp.o
5.961 [ 30%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_pulsed_meta_parameter.cpp.o
11.89 [ 31%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_transfer_device.cpp.o
11.98 [ 32%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_vector_device.cpp.o
12.22 [ 34%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/rpu_weight_updater.cpp.o
12.27 [ 35%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/sparse_bit_line_maker.cpp.o
12.38 [ 36%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/utility_functions.cpp.o
12.42 [ 37%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/weight_clipper.cpp.o
12.50 [ 39%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/weight_drifter.cpp.o
12.58 [ 40%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/weight_modifier.cpp.o
12.66 [ 41%] Building CXX object CMakeFiles/RPU_CPU.dir/src/rpucuda/weight_remapper.cpp.o
16.65 [ 43%] Linking CXX static library libRPU_CPU.a
16.69 [ 43%] Built target RPU_CPU
16.70 [ 44%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/bit_line_maker.cu.o
16.70 [ 46%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/cuda_buffer.cu.o
16.70 [ 48%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/cuda_math_util.cu.o
16.70 [ 48%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/chopped_weight_output.cu.o
16.70 [ 49%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/forward_backward_pass.cu.o
16.70 [ 50%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/cuda_util.cu.o
16.70 [ 51%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/io_manager.cu.o
16.70 [ 53%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/pulsed_weight_updater.cu.o
16.70 [ 54%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/maximizer.cu.o
16.70 [ 55%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/noise_manager.cu.o
16.70 [ 59%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_constantstep_device.cu.o
16.70 [ 59%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_buffered_transfer_device.cu.o
16.70 [ 59%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda.cu.o
16.70 [ 60%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_chopped_transfer_device.cu.o
16.70 [ 63%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_linearstep_device.cu.o
16.70 [ 63%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_expstep_device.cu.o
16.70 [ 64%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_mixedprec_device.cu.o
16.70 [ 65%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_dynamic_transfer_device.cu.o
16.70 [ 67%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_piecewisestep_device.cu.o
16.70 [ 69%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_hidden_device.cu.o
16.70 [ 69%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_powstep_device.cu.o
16.70 [ 70%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_onesided_device.cu.o
16.70 [ 72%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_mixedprec_device_base.cu.o
16.70 [ 73%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_mixedprec_int_device.cu.o
42.37 [ 74%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_powstep_reference_device.cu.o
43.52 [ 75%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_pulsed.cu.o
44.38 [ 77%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_pulsed_device.cu.o
45.27 [ 78%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_simple_device.cu.o
45.44 [ 79%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_softbounds_reference_device.cu.o
45.61 [ 81%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_transfer_device.cu.o
46.06 [ 82%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/rpucuda_vector_device.cu.o
46.62 [ 83%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/test_helper.cu.o
47.64 [ 84%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/update_management_helper.cu.o
47.88 [ 86%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/weight_clipper_cuda.cu.o
48.33 [ 87%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/weight_drifter_cuda.cu.o
48.41 [ 88%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/weight_modifier_cuda.cu.o
49.78 [ 89%] Building CUDA object CMakeFiles/RPU_GPU.dir/src/rpucuda/cuda/weight_remapper_cuda.cu.o
178.5 [ 91%] Linking CUDA device code CMakeFiles/RPU_GPU.dir/cmake_device_link.o
179.8 [ 92%] Linking CXX static library libRPU_GPU.a
180.4 [ 92%] Built target RPU_GPU
180.4 [ 93%] Building CXX object src/aihwkit/simulator/CMakeFiles/rpu_base.dir/rpu_base_src/rpu_base.cpp.o
180.4 [ 96%] Building CXX object src/aihwkit/simulator/CMakeFiles/rpu_base.dir/rpu_base_src/rpu_base_tiles.cpp.o
180.4 [ 96%] Building CXX object src/aihwkit/simulator/CMakeFiles/rpu_base.dir/rpu_base_src/rpu_base_devices.cpp.o
180.4 [ 97%] Building CXX object src/aihwkit/simulator/CMakeFiles/rpu_base.dir/rpu_base_src/rpu_base_utils.cpp.o
180.4 [ 98%] Building CXX object src/aihwkit/simulator/CMakeFiles/rpu_base.dir/rpu_base_src/rpu_base_tiles_cuda.cpp.o
191.8 [100%] Linking CXX shared module rpu_base.cpython-310-x86_64-linux-gnu.so
192.7 lto-wrapper: warning: using serial compilation of 14 LTRANS jobs
200.2 /bin/sh: 1: stubgen: not found
200.2 gmake[2]: *** [src/aihwkit/simulator/CMakeFiles/rpu_base.dir/build.make:172: src/aihwkit/simulator/rpu_base.cpython-310-x86_64-linux-gnu.so] Error 127
200.2 gmake[2]: *** Deleting file 'src/aihwkit/simulator/rpu_base.cpython-310-x86_64-linux-gnu.so'
200.2 gmake[1]: *** [CMakeFiles/Makefile2:191: src/aihwkit/simulator/CMakeFiles/rpu_base.dir/all] Error 2
200.2 gmake: *** [Makefile:136: all] Error 2
200.2 Traceback (most recent call last):
200.2   File "/usr/local/lib/python3.10/dist-packages/skbuild/setuptools_wrap.py", line 674, in setup
200.2     cmkr.make(make_args, install_target=cmake_install_target, env=env)
200.2   File "/usr/local/lib/python3.10/dist-packages/skbuild/cmaker.py", line 697, in make
200.2     self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
200.2   File "/usr/local/lib/python3.10/dist-packages/skbuild/cmaker.py", line 742, in make_impl
200.2     raise SKBuildError(msg)
200.2 
200.2 An error occurred while building with CMake.
200.2   Command:
200.2     /usr/bin/cmake --build . --target install --config Release -- -j 24
200.2   Install target:
200.2     install
200.2   Source directory:
200.2     /aihwkit
200.2   Working directory:
200.2     /aihwkit/_skbuild/linux-x86_64-3.10/cmake-build
200.2 Please check the install target is valid and see CMake's output for more information.
200.2 
------
>CUDA.Dockerfile:55
--------------------
  >54 |     ARG CUDA_ARCH=86
  55 | >>> RUN python setup.py install --user -j$(nproc) \
  56 | >>>     -DCMAKE_BUILD_TYPE=Release \
  57 | >>>     -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
  58 | >>>     -DRPU_BLAS=MKL \
  59 | >>>     -DINTEL_MKL_DIR=${MKLROOT} \
  60 | >>>     -DUSE_CUDA=ON \
  61 | >>>     -DRPU_CUDA_ARCHITECTURES=${CUDA_ARCH}
  62 |     
--------------------
>ERROR: failed to solve: process "/bin/sh -c python setup.py install --user -j$(nproc)     -DCMAKE_BUILD_TYPE=Release     -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE     -DRPU_BLAS=MKL     -DINTEL_MKL_DIR=${MKLROOT}     -DUSE_CUDA=ON     -DRPU_CUDA_ARCHITECTURES=${CUDA_ARCH}" did not complete successfully: exit code: 1


## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Other information

<!-- Feel free to add more information that can help solving the bug. -->

* Pytorch version:
* Package version:
* OS: Ubuntu 22.04 LTS + NVIDIA RTX 4070Ti
* Python version:
* Conda version (or N/A):



Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d0e851cf..ff750a1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,6 +33,7 @@ The format is based on [Keep a Changelog], and this project adheres to
 * Custom tile bugfixes (\#563)
 * Bug-fixes for specialized learning algorithms (\#563)
 * Bug-fix for data-parallel hardware-aware training for inference (\#569)
+* Fix docker build stubgen (\#581)
 
 ### Changed
 
diff --git a/CUDA.Dockerfile b/CUDA.Dockerfile
index a7ec7370..351d8856 100644
--- a/CUDA.Dockerfile
+++ b/CUDA.Dockerfile
@@ -20,7 +20,7 @@ RUN apt-get update && \
 
 # Install Python build dependencies
 RUN pip install --no-cache-dir --upgrade --no-warn-script-location pip && \
-    pip install --no-cache-dir --no-warn-script-location pybind11 scikit-build protobuf
+    pip install --no-cache-dir --no-warn-script-location pybind11 scikit-build protobuf mypy
 
 ARG USERNAME=coder
 ARG USERID=1000


Test patch:
diff --git a/tests/test_simulator_tiles.py b/tests/test_simulator_tiles.py
index b12a1f6b..2378f730 100644
--- a/tests/test_simulator_tiles.py
+++ b/tests/test_simulator_tiles.py
@@ -673,12 +673,14 @@ def test_set_forward_out_noise_std(self) -> None:
         inputs = Tensor([[-0.1, 0.4], [-0.5, 0.1]])
         if analog_tile.is_cuda:
             inputs = inputs.cuda()
+        y_1_lst = []
         for _ in range(10):
-            y_1 = analog_tile(inputs)
+            y_1_lst.append(analog_tile(inputs))
+        y_2_lst = []
         for _ in range(10):
-            y_2 = analog_tile(inputs)
-        self.assertTensorAlmostEqual(y_1[:, 1], y_2[:, 1])
-        self.assertNotAlmostEqualTensor(y_1[:, 0], y_2[:, 0])
+            y_2_lst.append(analog_tile(inputs))
+        self.assertTensorAlmostEqual(y_1_lst[-1][:, 1], y_2_lst[-1][:, 1])
+        self.assertNotAlmostEqualTensor(y_1_lst[-1][:, 0], y_2_lst[-1][:, 0])
 
         with self.assertRaises(ArgumentError):
             forward_parameters["_not_existent"] = Tensor([1.0])