Skip to content

Commit

Permalink
fix build fail on ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberhan123 committed Nov 27, 2023
1 parent 9216a2b commit d0fda37
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 34 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,36 @@ env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
ubuntu-latest-cmake-sanitizer:
runs-on: ubuntu-latest

continue-on-error: true

strategy:
matrix:
sanitizer: [ADDRESS, THREAD, UNDEFINED]
build_type: [Debug, Release]

steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Dependencies
id: depends
run: |
sudo apt-get update
sudo apt-get install build-essential
- name: Build
id: cmake_build
run: |
mkdir build
cd build
cmake .. -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }}
# ubuntu-latest-cmake-sanitizer:
# runs-on: ubuntu-latest
#
# continue-on-error: true
#
# strategy:
# matrix:
# sanitizer: [ADDRESS, THREAD, UNDEFINED]
# build_type: [Debug, Release]
#
# steps:
# - name: Clone
# id: checkout
# uses: actions/checkout@v3
# with:
# submodules: 'recursive'
#
# - name: Dependencies
# id: depends
# run: |
# sudo apt-get update
# sudo apt-get install build-essential
#
# - name: Build
# id: cmake_build
# run: |
# mkdir build
# cd build
# cmake .. -DGGML_SANITIZE_${{ matrix.sanitizer }}=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
# cmake --build . --config ${{ matrix.build_type }}

ubuntu-latest-cmake:
runs-on: ubuntu-latest
Expand Down
16 changes: 12 additions & 4 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ add_library(${SD_ABI} SHARED

target_include_directories(${SD_ABI} PUBLIC .)

set_target_properties(ggml PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(stable-diffusion PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(${SD_ABI} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(${SD_ABI} PRIVATE STABLE_DIFFUSION_SHARED STABLE_DIFFUSION_BUILD)
target_link_libraries(${SD_ABI} PRIVATE ggml stable-diffusion ${CMAKE_THREAD_LIBS_INIT})
Expand Down

0 comments on commit d0fda37

Please sign in to comment.