# Docker build issue 0.9.0\< version \<0.10.0

**URL:** <https://fenicsproject.discourse.group/t/docker-build-issue-0-9-0-version-0-10-0/16972>\
**Category:** installation\
**Created:** [February 9, 2025, 9:40am UTC](https://fenicsproject.discourse.group/t/docker-build-issue-0-9-0-version-0-10-0/16972 "2025-02-09T09:40:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![acino](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@acino](https://fenicsproject.discourse.group/u/acino)\
**Post date:** [February 9, 2025, 9:40am UTC](https://fenicsproject.discourse.group/t/docker-build-issue-0-9-0-version-0-10-0/16972/1 "2025-02-09T09:40:07Z")

</div>

Hello everyone,

I’m building my docker image from scratch because I need to enable the Fortran bindings for ADIOS2. I’m try to build latest commit in the main branch (797e47c7e8034). After building locally the dockerfile.test-env, I’ve used to build dockerfile.end-user. However, this last step fails due to an error compiling the python wrapper:

```auto
156.6 [17/25] Building CXX object CMakeFiles/cpp.dir/dolfinx/wrappers/geometry.cpp.o
156.6 FAILED: CMakeFiles/cpp.dir/dolfinx/wrappers/geometry.cpp.o
156.6 /usr/bin/x86_64-linux-gnu-g++ -DADIOS2_USE_MPI -DDOLFINX_VERSION=\"0.10.0.0\" -DFMT_SHARED -DHAS_ADIOS2 -DHAS_KAHIP -DHAS_PETSC -DHAS_PETSC4PY -DHAS_PTSCOTCH -DHAS_SLEPC -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -Dcpp_EXPORTS -Dcxx_std_20 -I/dolfinx-env/lib/python3.12/site-packages/petsc4py/include -I/dolfinx-env/lib/python3.12/site-packages/mpi4py/include -isystem /usr/include/python3.12 -isystem /dolfinx-env/lib/python3.12/site-packages/nanobind/include -isystem /usr/local/dolfinx-real/include -isystem /dolfinx-env/lib/python3.12/site-packages/ffcx/codegeneration -isystem /usr/local/petsc/linux-gnu-real64-32/include -isystem /usr/local/petsc/include -isystem /usr/local/slepc/linux-gnu-real64-32/include -isystem /usr/local/slepc/include -O3 -DNDEBUG -std=gnu++20 -fPIC -fvisibility=hidden -fno-stack-protector -Wall -Werror -Wextra -pedantic -ffunction-sections -fdata-sections -MD -MT CMakeFiles/cpp.dir/dolfinx/wrappers/geometry.cpp.o -MF CMakeFiles/cpp.dir/dolfinx/wrappers/geometry.cpp.o.d -o CMakeFiles/cpp.dir/dolfinx/wrappers/geometry.cpp.o -c /src/dolfinx/python/dolfinx/wrappers/geometry.cpp
156.6 In file included from /usr/include/c++/13/string:51,
156.6 from /usr/include/c++/13/stdexcept:39,
156.6 from /dolfinx-env/lib/python3.12/site-packages/nanobind/include/nanobind/nanobind.h:33,
156.6 from /src/dolfinx/python/dolfinx/wrappers/array.h:11,
156.6 from /src/dolfinx/python/dolfinx/wrappers/geometry.cpp:7:
156.7 In static member function ‘static constexpr _Up* std:: __copy_move<_IsMove, true, std::random_access_iterator_tag>::__ copy_m(_Tp*, _Tp*, _Up*) [with _Tp = unsigned int; _Up = unsigned int; bool _IsMove = false]’,
156.7 inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30,
156.7 inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42,
156.7 inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31,
156.7 inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7,
156.7 inlined from ‘static _ForwardIterator std:: __uninitialized_copy<true>::__ uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = unsigned int*; _ForwardIterator = unsigned int*]’ at /usr/include/c++/13/bits/stl_uninitialized.h:147:27,
156.7 inlined from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = unsigned int*; _ForwardIterator = unsigned int*]’ at /usr/include/c++/13/bits/stl_uninitialized.h:185:15,
156.7 inlined from ‘constexpr void fmt::v9::basic_memory_buffer<T, SIZE, Allocator>::grow(size_t) [with T = unsigned int; long unsigned int SIZE = 32; Allocator = std::allocator<unsigned int>]’ at /usr/include/fmt/format.h:925:26,
156.7 inlined from ‘constexpr void fmt::v9::detail::buffer<T>::try_reserve(size_t) [with T = unsigned int]’ at /usr/include/fmt/core.h:928:39,
156.7 inlined from ‘constexpr void fmt::v9::detail::buffer<T>::try_resize(size_t) [with T = unsigned int]’ at /usr/include/fmt/core.h:919:16,
156.7 inlined from ‘constexpr void fmt::v9::basic_memory_buffer<T, SIZE, Allocator>::resize(size_t) [with T = unsigned int; long unsigned int SIZE = 32; Allocator = std::allocator<unsigned int>]’ at /usr/include/fmt/format.h:897:63,
156.7 inlined from ‘constexpr void fmt::v9::detail::bigint::assign(UInt) [with UInt = long unsigned int; typename std::enable_if<(std::is_same<UInt, long unsigned int>::value || std::is_same<UInt, __int128 unsigned>::value), int>::type <anonymous> = 0]’ at /usr/include/fmt/format.h:2792:19,
156.7 inlined from ‘constexpr void fmt::v9::detail::bigint::operator=(Int) [with Int = int]’ at /usr/include/fmt/format.h:2813:11,
156.7 inlined from ‘constexpr void fmt::v9::detail::format_dragon(basic_fp<__int128 unsigned>, unsigned int, int, buffer<char>&, int&)’ at /usr/include/fmt/format.h:3006:17:
156.7 /usr/include/c++/13/bits/stl_algobase.h:437:30: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 4 is out of the bounds [0, 4] [-Werror=array-bounds=]
156.7 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
156.7 | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156.7 In static member function ‘static constexpr _Up* std:: __copy_move<_IsMove, true, std::random_access_iterator_tag>::__ copy_m(_Tp*, _Tp*, _Up*) [with _Tp = unsigned int; _Up = unsigned int; bool _IsMove = false]’,
156.7 inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30,
156.7 inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42,
156.7 inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31,
156.7 inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = unsigned int*; _OI = unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7,
156.7 inlined from ‘static _ForwardIterator std:: __uninitialized_copy<true>::__ uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = unsigned int*; _ForwardIterator = unsigned int*]’ at /usr/include/c++/13/bits/stl_uninitialized.h:147:27,
156.7 inlined from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = unsigned int*; _ForwardIterator = unsigned int*]’ at /usr/include/c++/13/bits/stl_uninitialized.h:185:15,
156.7 inlined from ‘constexpr void fmt::v9::basic_memory_buffer<T, SIZE, Allocator>::grow(size_t) [with T = unsigned int; long unsigned int SIZE = 32; Allocator = std::allocator<unsigned int>]’ at /usr/include/fmt/format.h:925:26,
156.7 inlined from ‘constexpr void fmt::v9::detail::buffer<T>::try_reserve(size_t) [with T = unsigned int]’ at /usr/include/fmt/core.h:928:39,
156.7 inlined from ‘constexpr void fmt::v9::detail::buffer<T>::try_resize(size_t) [with T = unsigned int]’ at /usr/include/fmt/core.h:919:16,
156.7 inlined from ‘constexpr void fmt::v9::basic_memory_buffer<T, SIZE, Allocator>::resize(size_t) [with T = unsigned int; long unsigned int SIZE = 32; Allocator = std::allocator<unsigned int>]’ at /usr/include/fmt/format.h:897:63,
156.7 inlined from ‘constexpr void fmt::v9::detail::bigint::assign(UInt) [with UInt = long unsigned int; typename std::enable_if<(std::is_same<UInt, long unsigned int>::value || std::is_same<UInt, __int128 unsigned>::value), int>::type <anonymous> = 0]’ at /usr/include/fmt/format.h:2792:19,
156.7 inlined from ‘constexpr void fmt::v9::detail::bigint::operator=(Int) [with Int = int]’ at /usr/include/fmt/format.h:2813:11,
156.7 inlined from ‘constexpr void fmt::v9::detail::bigint::assign_pow10(int)’ at /usr/include/fmt/format.h:2893:11,       
156.7 inlined from ‘constexpr void fmt::v9::detail::bigint::assign_pow10(int)’ at /usr/include/fmt/format.h:2884:24,       
156.7 inlined from ‘constexpr void fmt::v9::detail::format_dragon(basic_fp<__int128 unsigned>, unsigned int, int, buffer<char>&, int&)’ at /usr/include/fmt/format.h:3011:29:
156.7 /usr/include/c++/13/bits/stl_algobase.h:437:30: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 4 is out of the bounds [0, 4] [-Werror=array-bounds=]
156.7 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
156.7 | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156.7 cc1plus: all warnings being treated as errors

```

```auto
docker build --target dev-env -t dev-env:currentf --file dolfinx/docker/Dockerfile.test-env --build-arg PETSC_SLEPC_OPTFLAGS="-O2 -march=native" .
docker build -f .\dolfinx\docker\Dockerfile.end-user -t dolfinx-fortran:current .

```

do you have any suggestion?

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [February 9, 2025, 9:50am UTC](https://fenicsproject.discourse.group/t/docker-build-issue-0-9-0-version-0-10-0/16972/2 "2025-02-09T09:50:39Z")

</div>

I encountered the same issue after

> <https://github.com/FEniCS/dolfinx/pull/3617>
>
> This is now possible thanks to a change in the nanobind 2.5.0 CMake configuratio…n.

It might be fixed with

> <https://github.com/FEniCS/dolfinx/pull/3622>
>
> Needed due to #3617. Otherwise the user may get odd errors like
> 
> \`\`\`
> \#23 127.…3 CMake Error at /usr/local/lib/python3.12/site-packages/nanobind/cmake/nanobind-config.cmake:316 (add\_library):
> \#23 127.3 Cannot find source file:
> \#23 127.3       
> \#23 127.3 NB\_SUPPRESS\_WARNINGS
> \#23 127.3 Call Stack (most recent call first):
> \#23 127.3 CMakeLists.txt:34 (nanobind\_add\_module)
> \#23 127.3       
> \#23 127.3       
> \#23 127.3 CMake Error at /usr/local/lib/python3.12/site-packages/nanobind/cmake/nanobind-config.cmake:316 (add\_library):
> \#23 127.3 No SOURCES given to target: cpp
> \#23 127.3 Call Stack (most recent call first):
> \#23 127.3 CMakeLists.txt:34 (nanobind\_add\_module)
> \#23 127.3       
> \#23 127.3       
> \#23 127.3 CMake Generate step failed. Build files cannot be regenerated correctly.
> \`\`\`

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [February 9, 2025, 1:15pm UTC](https://fenicsproject.discourse.group/t/docker-build-issue-0-9-0-version-0-10-0/16972/3 "2025-02-09T13:15:27Z")

</div>

This PR by Garth should resolve the issue: [Disable some GCC checks that trigger false positive warnings by garth-wells · Pull Request #3623 · FEniCS/dolfinx · GitHub](https://github.com/FEniCS/dolfinx/pull/3623)

---

<div class="post-metadata">

**Author:** ![acino](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@acino](https://fenicsproject.discourse.group/u/acino)\
**Post date:** [February 9, 2025, 3:11pm UTC](https://fenicsproject.discourse.group/t/docker-build-issue-0-9-0-version-0-10-0/16972/4 "2025-02-09T15:11:22Z")

</div>

thank @dokken, and Garth. It works.
