diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5af497a3c..5d1ee623f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 392db8a08..250c5f4b2 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -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: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 3659279e2..e388f1c22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Makefile b/Makefile index c53c1e726..c443cac86 100644 --- a/Makefile +++ b/Makefile @@ -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