From 815097920b855de827ca1d64b8d3945cd273649a Mon Sep 17 00:00:00 2001 From: torikizi Date: Sat, 11 Nov 2023 22:03:29 +0900 Subject: [PATCH] =?UTF-8?q?Ubuntu20.04=20=E3=81=A8=20Ubuntu22.04=20?= =?UTF-8?q?=E3=81=AE=E3=83=93=E3=83=AB=E3=83=89=E3=81=AB=20clang-15=20?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20-=20Ubuntu20.04=20=E3=81=AF=20llvm.sh=20=E3=81=A7?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=20-=20Ubuntu22.04=20=E3=81=AF=20apt=20=E3=81=A7?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 16 +-- build/ubuntu-20.04_x86_64/Dockerfile | 162 ++++++++++++++------------- build/ubuntu-22.04_x86_64/Dockerfile | 156 +++++++++++++------------- 3 files changed, 168 insertions(+), 166 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7b18e64..587f8fe0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,8 +151,8 @@ elseif(MOMO_PACKAGE_NAME STREQUAL "ubuntu-20.04_x86_64") set(WEBRTC_LIBRARY_DIR /root/webrtc/lib) # /root/llvm/clang にあるコンパイラは使わず、apt でインストールした clang-10 を利用する - set(CMAKE_C_COMPILER clang-10) - set(CMAKE_CXX_COMPILER clang++-10) + set(CMAKE_C_COMPILER clang-15) + set(CMAKE_CXX_COMPILER clang++-15) set(USE_LIBCXX ON) set(LIBCXX_INCLUDE_DIR /root/llvm/libcxx/include) @@ -196,9 +196,9 @@ elseif(MOMO_PACKAGE_NAME STREQUAL "ubuntu-22.04_x86_64") set(WEBRTC_INCLUDE_DIR /root/webrtc/include) set(WEBRTC_LIBRARY_DIR /root/webrtc/lib) - # /root/llvm/clang にあるコンパイラは使わず、apt でインストールした clang-12 を利用する - set(CMAKE_C_COMPILER clang-12) - set(CMAKE_CXX_COMPILER clang++-12) + # /root/llvm/clang にあるコンパイラは使わず、apt でインストールした clang-15 を利用する + set(CMAKE_C_COMPILER clang-15) + set(CMAKE_CXX_COMPILER clang++-15) set(USE_LIBCXX ON) set(LIBCXX_INCLUDE_DIR /root/llvm/libcxx/include) @@ -316,11 +316,7 @@ target_sources(momo target_include_directories(momo PRIVATE src) -if (WIN32) - set_target_properties(momo PROPERTIES CXX_STANDARD 20 C_STANDARD 99) -else() - set_target_properties(momo PROPERTIES CXX_STANDARD 17 C_STANDARD 99) -endif() +set_target_properties(momo PROPERTIES CXX_STANDARD 20 C_STANDARD 99) target_link_libraries(momo PRIVATE diff --git a/build/ubuntu-20.04_x86_64/Dockerfile b/build/ubuntu-20.04_x86_64/Dockerfile index 0c47a728..031e0596 100644 --- a/build/ubuntu-20.04_x86_64/Dockerfile +++ b/build/ubuntu-20.04_x86_64/Dockerfile @@ -39,29 +39,29 @@ RUN \ && cd /root/boost-source/source \ && echo 'using clang : : /root/llvm/clang/bin/clang++ : ;' > project-config.jam \ && ./b2 \ - cxxstd=17 \ - cxxflags=' \ - -D_LIBCPP_ABI_NAMESPACE=Cr \ - -D_LIBCPP_ABI_VERSION=2 \ - -D_LIBCPP_DISABLE_AVAILABILITY \ - -nostdinc++ \ - -isystem/root/llvm/libcxx/include \ - ' \ - linkflags=' \ - ' \ - toolset=clang \ - visibility=global \ - target-os=linux \ - address-model=64 \ - link=static \ - variant=release \ - install \ - -d+0 \ - -j`nproc` \ - --ignore-site-config \ - --prefix=/root/boost \ - --with-filesystem \ - --with-json + cxxstd=17 \ + cxxflags=' \ + -D_LIBCPP_ABI_NAMESPACE=Cr \ + -D_LIBCPP_ABI_VERSION=2 \ + -D_LIBCPP_DISABLE_AVAILABILITY \ + -nostdinc++ \ + -isystem/root/llvm/libcxx/include \ + ' \ + linkflags=' \ + ' \ + toolset=clang \ + visibility=global \ + target-os=linux \ + address-model=64 \ + link=static \ + variant=release \ + install \ + -d+0 \ + -j`nproc` \ + --ignore-site-config \ + --prefix=/root/boost \ + --with-filesystem \ + --with-json # CLI11 の取得 @@ -85,45 +85,45 @@ RUN \ && mkdir -p /root/sdl2-source/build \ && cd /root/sdl2-source/build \ && cmake ../source \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/root/SDL2 \ - -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ - -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ - -DBUILD_SHARED_LIBS=OFF \ - -DSDL_ATOMIC=OFF \ - -DSDL_AUDIO=OFF \ - -DSDL_VIDEO=ON \ - -DSDL_RENDER=ON \ - -DSDL_EVENTS=ON \ - -DSDL_JOYSTICK=ON \ - -DSDL_HAPTIC=ON \ - -DSDL_POWER=ON \ - -DSDL_THREADS=ON \ - -DSDL_TIMERS=OFF \ - -DSDL_FILE=OFF \ - -DSDL_LOADSO=ON \ - -DSDL_CPUINFO=OFF \ - -DSDL_FILESYSTEM=OFF \ - -DSDL_DLOPEN=ON \ - -DSDL_SENSOR=ON \ - -DVIDEO_OPENGL=ON \ - -DVIDEO_OPENGLES=ON \ - -DVIDEO_RPI=OFF \ - -DVIDEO_WAYLAND=OFF \ - -DVIDEO_X11=ON \ - -DX11_SHARED=OFF \ - -DVIDEO_X11_XCURSOR=OFF \ - -DVIDEO_X11_XINERAMA=OFF \ - -DVIDEO_X11_XINPUT=OFF \ - -DVIDEO_X11_XRANDR=OFF \ - -DVIDEO_X11_XSCRNSAVER=OFF \ - -DVIDEO_X11_XSHAPE=OFF \ - -DVIDEO_X11_XVM=OFF \ - -DVIDEO_VULKAN=OFF \ - -DVIDEO_VIVANTE=OFF \ - -DVIDEO_COCOA=OFF \ - -DVIDEO_METAL=OFF \ - -DVIDEO_KMSDRM=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/root/SDL2 \ + -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ + -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ + -DBUILD_SHARED_LIBS=OFF \ + -DSDL_ATOMIC=OFF \ + -DSDL_AUDIO=OFF \ + -DSDL_VIDEO=ON \ + -DSDL_RENDER=ON \ + -DSDL_EVENTS=ON \ + -DSDL_JOYSTICK=ON \ + -DSDL_HAPTIC=ON \ + -DSDL_POWER=ON \ + -DSDL_THREADS=ON \ + -DSDL_TIMERS=OFF \ + -DSDL_FILE=OFF \ + -DSDL_LOADSO=ON \ + -DSDL_CPUINFO=OFF \ + -DSDL_FILESYSTEM=OFF \ + -DSDL_DLOPEN=ON \ + -DSDL_SENSOR=ON \ + -DVIDEO_OPENGL=ON \ + -DVIDEO_OPENGLES=ON \ + -DVIDEO_RPI=OFF \ + -DVIDEO_WAYLAND=OFF \ + -DVIDEO_X11=ON \ + -DX11_SHARED=OFF \ + -DVIDEO_X11_XCURSOR=OFF \ + -DVIDEO_X11_XINERAMA=OFF \ + -DVIDEO_X11_XINPUT=OFF \ + -DVIDEO_X11_XRANDR=OFF \ + -DVIDEO_X11_XSCRNSAVER=OFF \ + -DVIDEO_X11_XSHAPE=OFF \ + -DVIDEO_X11_XVM=OFF \ + -DVIDEO_VULKAN=OFF \ + -DVIDEO_VIVANTE=OFF \ + -DVIDEO_COCOA=OFF \ + -DVIDEO_METAL=OFF \ + -DVIDEO_KMSDRM=OFF \ && make -j`nproc` \ && make install @@ -137,7 +137,13 @@ RUN set -ex \ && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub \ && add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install cuda=$CUDA_VERSION clang-10 + && DEBIAN_FRONTEND=noninteractive apt-get -y install cuda=$CUDA_VERSION + +# llvm.sh で Clang 15 のインストール +RUN set -ex \ + && wget https://apt.llvm.org/llvm.sh \ + && chmod a+x llvm.sh \ + && ./llvm.sh 15 # libva ARG LIBVA_VERSION @@ -146,13 +152,13 @@ RUN set -ex \ && mkdir -p /root/libva-build \ && cd /root/libva-build \ && CC=/root/llvm/clang/bin/clang \ - CXX=/root/llvm/clang/bin/clang++ \ - CFLAGS="-fPIC" \ - /root/libva-source/autogen.sh \ - --enable-static \ - --disable-shared \ - --with-drivers-path=/usr/lib/x86_64-linux-gnu/dri \ - --prefix /root/libva \ + CXX=/root/llvm/clang/bin/clang++ \ + CFLAGS="-fPIC" \ + /root/libva-source/autogen.sh \ + --enable-static \ + --disable-shared \ + --with-drivers-path=/usr/lib/x86_64-linux-gnu/dri \ + --prefix /root/libva \ && make -j`nproc` \ && make install \ && rm -rf /root/libva-build \ @@ -167,14 +173,14 @@ RUN set -ex \ && mkdir -p /root/msdk-build \ && cd /root/msdk-build \ && cmake \ - -DCMAKE_INSTALL_PREFIX=/root/msdk \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=/root/libva \ - -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ - -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ - -DBUILD_SAMPLES=OFF \ - -DBUILD_TUTORIALS=OFF \ - /root/msdk-source \ + -DCMAKE_INSTALL_PREFIX=/root/msdk \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=/root/libva \ + -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ + -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ + -DBUILD_SAMPLES=OFF \ + -DBUILD_TUTORIALS=OFF \ + /root/msdk-source \ && cmake --build . -j`nproc` \ && cmake --install . \ && rm -rf /root/msdk-build \ diff --git a/build/ubuntu-22.04_x86_64/Dockerfile b/build/ubuntu-22.04_x86_64/Dockerfile index ff541c47..3cd213c3 100644 --- a/build/ubuntu-22.04_x86_64/Dockerfile +++ b/build/ubuntu-22.04_x86_64/Dockerfile @@ -39,29 +39,29 @@ RUN \ && cd /root/boost-source/source \ && echo 'using clang : : /root/llvm/clang/bin/clang++ : ;' > project-config.jam \ && ./b2 \ - cxxstd=17 \ - cxxflags=' \ - -D_LIBCPP_ABI_NAMESPACE=Cr \ - -D_LIBCPP_ABI_VERSION=2 \ - -D_LIBCPP_DISABLE_AVAILABILITY \ - -nostdinc++ \ - -isystem/root/llvm/libcxx/include \ - ' \ - linkflags=' \ - ' \ - toolset=clang \ - visibility=global \ - target-os=linux \ - address-model=64 \ - link=static \ - variant=release \ - install \ - -d+0 \ - -j`nproc` \ - --ignore-site-config \ - --prefix=/root/boost \ - --with-filesystem \ - --with-json + cxxstd=17 \ + cxxflags=' \ + -D_LIBCPP_ABI_NAMESPACE=Cr \ + -D_LIBCPP_ABI_VERSION=2 \ + -D_LIBCPP_DISABLE_AVAILABILITY \ + -nostdinc++ \ + -isystem/root/llvm/libcxx/include \ + ' \ + linkflags=' \ + ' \ + toolset=clang \ + visibility=global \ + target-os=linux \ + address-model=64 \ + link=static \ + variant=release \ + install \ + -d+0 \ + -j`nproc` \ + --ignore-site-config \ + --prefix=/root/boost \ + --with-filesystem \ + --with-json # CLI11 の取得 @@ -85,45 +85,45 @@ RUN \ && mkdir -p /root/sdl2-source/build \ && cd /root/sdl2-source/build \ && cmake ../source \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/root/SDL2 \ - -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ - -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ - -DBUILD_SHARED_LIBS=OFF \ - -DSDL_ATOMIC=OFF \ - -DSDL_AUDIO=OFF \ - -DSDL_VIDEO=ON \ - -DSDL_RENDER=ON \ - -DSDL_EVENTS=ON \ - -DSDL_JOYSTICK=ON \ - -DSDL_HAPTIC=ON \ - -DSDL_POWER=ON \ - -DSDL_THREADS=ON \ - -DSDL_TIMERS=OFF \ - -DSDL_FILE=OFF \ - -DSDL_LOADSO=ON \ - -DSDL_CPUINFO=OFF \ - -DSDL_FILESYSTEM=OFF \ - -DSDL_DLOPEN=ON \ - -DSDL_SENSOR=ON \ - -DVIDEO_OPENGL=ON \ - -DVIDEO_OPENGLES=ON \ - -DVIDEO_RPI=OFF \ - -DVIDEO_WAYLAND=OFF \ - -DVIDEO_X11=ON \ - -DX11_SHARED=OFF \ - -DVIDEO_X11_XCURSOR=OFF \ - -DVIDEO_X11_XINERAMA=OFF \ - -DVIDEO_X11_XINPUT=OFF \ - -DVIDEO_X11_XRANDR=OFF \ - -DVIDEO_X11_XSCRNSAVER=OFF \ - -DVIDEO_X11_XSHAPE=OFF \ - -DVIDEO_X11_XVM=OFF \ - -DVIDEO_VULKAN=OFF \ - -DVIDEO_VIVANTE=OFF \ - -DVIDEO_COCOA=OFF \ - -DVIDEO_METAL=OFF \ - -DVIDEO_KMSDRM=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/root/SDL2 \ + -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ + -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ + -DBUILD_SHARED_LIBS=OFF \ + -DSDL_ATOMIC=OFF \ + -DSDL_AUDIO=OFF \ + -DSDL_VIDEO=ON \ + -DSDL_RENDER=ON \ + -DSDL_EVENTS=ON \ + -DSDL_JOYSTICK=ON \ + -DSDL_HAPTIC=ON \ + -DSDL_POWER=ON \ + -DSDL_THREADS=ON \ + -DSDL_TIMERS=OFF \ + -DSDL_FILE=OFF \ + -DSDL_LOADSO=ON \ + -DSDL_CPUINFO=OFF \ + -DSDL_FILESYSTEM=OFF \ + -DSDL_DLOPEN=ON \ + -DSDL_SENSOR=ON \ + -DVIDEO_OPENGL=ON \ + -DVIDEO_OPENGLES=ON \ + -DVIDEO_RPI=OFF \ + -DVIDEO_WAYLAND=OFF \ + -DVIDEO_X11=ON \ + -DX11_SHARED=OFF \ + -DVIDEO_X11_XCURSOR=OFF \ + -DVIDEO_X11_XINERAMA=OFF \ + -DVIDEO_X11_XINPUT=OFF \ + -DVIDEO_X11_XRANDR=OFF \ + -DVIDEO_X11_XSCRNSAVER=OFF \ + -DVIDEO_X11_XSHAPE=OFF \ + -DVIDEO_X11_XVM=OFF \ + -DVIDEO_VULKAN=OFF \ + -DVIDEO_VIVANTE=OFF \ + -DVIDEO_COCOA=OFF \ + -DVIDEO_METAL=OFF \ + -DVIDEO_KMSDRM=OFF \ && make -j`nproc` \ && make install @@ -137,7 +137,7 @@ RUN set -ex \ && apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub \ && add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install cuda=$CUDA_VERSION clang-12 + && DEBIAN_FRONTEND=noninteractive apt-get -y install cuda=$CUDA_VERSION clang-15 # libva ARG LIBVA_VERSION @@ -146,13 +146,13 @@ RUN set -ex \ && mkdir -p /root/libva-build \ && cd /root/libva-build \ && CC=/root/llvm/clang/bin/clang \ - CXX=/root/llvm/clang/bin/clang++ \ - CFLAGS="-fPIC" \ - /root/libva-source/autogen.sh \ - --enable-static \ - --disable-shared \ - --with-drivers-path=/usr/lib/x86_64-linux-gnu/dri \ - --prefix /root/libva \ + CXX=/root/llvm/clang/bin/clang++ \ + CFLAGS="-fPIC" \ + /root/libva-source/autogen.sh \ + --enable-static \ + --disable-shared \ + --with-drivers-path=/usr/lib/x86_64-linux-gnu/dri \ + --prefix /root/libva \ && make -j`nproc` \ && make install \ && rm -rf /root/libva-build \ @@ -169,14 +169,14 @@ RUN set -ex \ && mkdir -p /root/msdk-build \ && cd /root/msdk-build \ && cmake \ - -DCMAKE_INSTALL_PREFIX=/root/msdk \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=/root/libva \ - -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ - -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ - -DBUILD_SAMPLES=OFF \ - -DBUILD_TUTORIALS=OFF \ - /root/msdk-source \ + -DCMAKE_INSTALL_PREFIX=/root/msdk \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=/root/libva \ + -DCMAKE_C_COMPILER=/root/llvm/clang/bin/clang \ + -DCMAKE_CXX_COMPILER=/root/llvm/clang/bin/clang++ \ + -DBUILD_SAMPLES=OFF \ + -DBUILD_TUTORIALS=OFF \ + /root/msdk-source \ && cmake --build . -j`nproc` \ && cmake --install . \ && rm -rf /root/msdk-build \