Skip to content

Commit

Permalink
^^
Browse files Browse the repository at this point in the history
  • Loading branch information
like-a-freedom committed Jan 29, 2025
1 parent d02d476 commit 8444c59
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,30 @@ ENV PIP_PREFER_BINARY=1
ENV PIP_ONLY_BINARY=:all:
ENV MAKEFLAGS="-j1"
ENV CMAKE_BUILD_PARALLEL_LEVEL=1

# ONNX specific settings
ENV ONNX_ML=1
ENV ONNX_BUILD_TESTS=OFF
ENV ONNX_USE_PROTOBUF_SHARED_LIBS=OFF

# CMake-specific flags
ENV CMAKE_ARGS=" \
-DONNX_USE_PROTOBUF_SHARED_LIBS=OFF \
-DONNX_USE_LITE_PROTO=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DCMAKE_CXX_FLAGS=-fPIC \
-Wno-dev \
"

# Compiler optimization and position-independent code
ENV CFLAGS="-O3 -pipe -fPIC -Wall"
ENV CXXFLAGS="-O3 -pipe -fPIC -Wall"
ENV CFLAGS="-O3 -fPIC"
ENV CXXFLAGS="-O3 -fPIC"
ENV LDFLAGS="-Wl,--no-as-needed -lprotobuf"

# Linker flags
ENV LDFLAGS="-Wl,--as-needed"
# ENV LDFLAGS="-Wl,--as-needed"

# (Optional) CMake compiler flags for finer control
# These ensure position-independent code and additional compiler warnings
Expand Down

0 comments on commit 8444c59

Please sign in to comment.