Skip to content
Open
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
8 changes: 6 additions & 2 deletions .github/workflows/docker-ubuntu-branch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
driver-opts: image=moby/buildkit:v0.11.0
driver-opts: image=moby/buildkit:v0.20.2

- name: Fix qemu multiplatform build
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -54,7 +58,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/riscv64
push: true
context: ./
tags: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/docker-ubuntu-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Fix qemu multiplatform build
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -60,7 +64,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/riscv64
push: true
context: ./
tags: |
Expand Down
33 changes: 30 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,22 @@ option(TON_USE_TSAN "Use \"ON\" to enable ThreadSanitizer." OFF)
option(TON_USE_UBSAN "Use \"ON\" to enable UndefinedBehaviorSanitizer." OFF)
set(TON_ARCH "native" CACHE STRING "Architecture, will be passed to -march=")

#BEGIN M1 support
# detect architecture
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE )

#BEGIN M1 support
if ((ARCHITECTURE MATCHES "arm64") AND (CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND
(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)) # only clang 13+ supports cpu=apple-m1
set(TON_ARCH "apple-m1")
endif()
#END M1 support

#BEGIN RISC-V support
if ((ARCHITECTURE MATCHES "riscv64") AND (CMAKE_SYSTEM_NAME STREQUAL "Linux"))
set(TON_ARCH "riscv64")
endif()
#END RISC-V support

if (TON_USE_ABSEIL)
message("Add abseil-cpp")
set(ABSL_PROPAGATE_CXX_STD TRUE)
Expand Down Expand Up @@ -151,7 +158,7 @@ set(CRC32C_FOUND 1)

if (TON_USE_ROCKSDB)
if (ANDROID)
set(PORTABLE ON CACHE BOOL "portable")
set(PORTABLE 0 CACHE STRING "portable")
endif()
set(WITH_GFLAGS OFF CACHE BOOL "build with GFlags")
set(WITH_TESTS OFF CACHE BOOL "build with tests")
Expand Down Expand Up @@ -227,10 +234,30 @@ endif()

if (TON_ARCH AND NOT MSVC)
CHECK_CXX_COMPILER_FLAG( "-march=${TON_ARCH}" COMPILER_OPT_ARCH_SUPPORTED )
CHECK_CXX_COMPILER_FLAG( "-mcpu=${TON_ARCH}" COMPILER_OPT_CPU_SUPPORTED )
if (TON_ARCH STREQUAL "apple-m1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${TON_ARCH}")
message(STATUS "Found supported Apple Silicon architecture")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${TON_ARCH}")
elseif(TON_ARCH STREQUAL "riscv64")
execute_process(
COMMAND bash -c "cat /proc/cpuinfo | grep -E '^isa\\s*:' | head -1 | cut --delimiter=: -f 2 | cut -b 2-"
OUTPUT_VARIABLE RISC_ISA
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT RISC_ISA)
message(STATUS "RISC-V ISA not detected, using default 'rv64imafdc'")
set(RISC_ISA "rv64imafdc")
endif()
message(STATUS "Found RISC-V architecture with ISA: ${RISC_ISA}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${RISC_ISA}")
set(PORTABLE "${RISC_ISA}")
elseif(COMPILER_OPT_CPU_SUPPORTED)
message(STATUS "Found supported -mcpu=${TON_ARCH}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${TON_ARCH}")
elseif(COMPILER_OPT_ARCH_SUPPORTED)
message(STATUS "Found supported -march=${TON_ARCH}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${TON_ARCH}")
set(PORTABLE "${TON_ARCH}")
elseif(NOT TON_ARCH STREQUAL "native")
message(FATAL_ERROR "Compiler doesn't support arch ${TON_ARCH}")
endif()
Expand Down
31 changes: 14 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
FROM ubuntu:22.04 AS builder
FROM ubuntu:24.04 AS builder
ARG DEBIAN_FRONTEND=noninteractive
RUN cat /proc/cpuinfo
RUN apt-get update && \
rm /var/lib/dpkg/info/libc-bin.* && \
apt-get clean && \
apt-get update && \
apt install libc-bin && \
apt-get install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git \
ninja-build libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool \
libjemalloc-dev lsb-release software-properties-common gnupg
rm /var/lib/dpkg/info/libc-bin.* && \
apt-get clean && \
apt-get update && \
apt-get install -y libc-bin && \
apt-get install -y build-essential cmake clang gcc g++ openssl libssl-dev zlib1g-dev gperf wget git \
ninja-build libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool \
libjemalloc-dev lsb-release software-properties-common gnupg

RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 16 all && \
rm -rf /var/lib/apt/lists/*

ENV CC=/usr/bin/clang-16
ENV CXX=/usr/bin/clang++-16
ENV CC=/usr/bin/clang
ENV CXX=/usr/bin/clang++
ENV CCACHE_DISABLE=1

WORKDIR /
Expand All @@ -31,11 +27,12 @@ RUN mkdir build && \
generate-random-id dht-server lite-client tolk rldp-http-proxy dht-server proxy-liteserver create-state \
blockchain-explorer emulator tonlibjson http-proxy adnl-proxy

FROM ubuntu:22.04
# build image
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y wget curl libatomic1 openssl libsodium-dev libmicrohttpd-dev liblz4-dev libjemalloc-dev htop \
net-tools netcat iptraf-ng jq tcpdump pv plzip && \
net-tools netcat-traditional iptraf-ng jq tcpdump pv plzip && \
rm -rf /var/lib/apt/lists/*

RUN mkdir -p /var/ton-work/db /var/ton-work/scripts /usr/share/ton/smartcont/auto /usr/lib/fift/
Expand Down
2 changes: 1 addition & 1 deletion third-party/blst
Submodule blst updated 155 files