Skip to content

build : enable link-time optimizations #3859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ jobs:
id: depends
run: |
sudo apt-get update
sudo apt-get install build-essential gcc-8
sudo apt-get install build-essential gcc-8 g++-8

- name: Build
id: make_build
run: |
CC=gcc-8 make -j $(nproc)
CC=gcc-8 CXX=g++-8 make -j $(nproc)

- name: Test
id: make_test
run: |
CC=gcc-8 make tests -j $(nproc)
CC=gcc-8 CXX=g++-8 make tests -j $(nproc)
make test -j $(nproc)

ubuntu-latest-cmake:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential gcc-8 lcov
sudo apt-get install build-essential gcc-9 g++-9 lcov

- name: Build
run: CC=gcc-8 make -j LLAMA_CODE_COVERAGE=1 tests
run: CC=gcc-9 CXX=g++-9 make -j LLAMA_CODE_COVERAGE=1 tests

- name: Run tests
run: CC=gcc-8 make test
run: CC=gcc-9 CXX=g++-9 make test

- name: Generate coverage report
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ endif()
# general
option(LLAMA_STATIC "llama: static link libraries" OFF)
option(LLAMA_NATIVE "llama: enable -march=native flag" ON)
option(LLAMA_LTO "llama: enable link time optimization" OFF)
option(LLAMA_LTO "llama: enable link time optimization" ON)

# debug
option(LLAMA_ALL_WARNINGS "llama: enable all compiler warnings" ON)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ MK_CXXFLAGS = -std=c++11 -fPIC

# -Ofast tends to produce faster code, but may not be available for some compilers.
ifdef LLAMA_FAST
MK_CFLAGS += -Ofast
MK_CFLAGS += -Ofast -flto=auto
MK_HOST_CXXFLAGS += -Ofast
MK_CUDA_CXXFLAGS += -O3
else
MK_CFLAGS += -O3
MK_CFLAGS += -O3 -flto=auto
MK_CXXFLAGS += -O3
endif

Expand Down