Skip to content

Commit

Permalink
Fix OpenMP stub patch used for FastANI on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Oct 21, 2024
1 parent 450898f commit 4765f51
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

test_linux:
name: Test (Linux)
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
OS: Linux
strategy:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

test_osx:
name: Test (OSX)
runs-on: macos-latest
runs-on: macos-12
env:
OS: OSX
strategy:
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
python-impl: PyPy
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python ${{ matrix.python-version }}
Expand Down
3 changes: 2 additions & 1 deletion src/FastANI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ foreach(_header ${FASTANI_HEADERS})
set(FASTANI_GENERATED_HEADERS ${FASTANI_GENERATED_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/include/${_header})
endforeach()

add_library(fastani src/cgi/core_genome_identity.cpp ${FASTANI_GENERATED_HEADERS})
file(COPY omp.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/src)
add_library(fastani src/cgi/core_genome_identity.cpp omp.cpp ${FASTANI_GENERATED_HEADERS})
target_compile_definitions(fastani PUBLIC USE_BOOST=1 BOOST_NO_EXCEPTIONS=1)
target_include_directories(fastani PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include/src)

Expand Down
2 changes: 2 additions & 0 deletions src/pyfastani/omp.cpp → src/FastANI/omp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ int omp_get_thread_num(void) {
int omp_get_num_threads(void) {
return 1;
}

void omp_set_num_threads(int) {}
1 change: 1 addition & 0 deletions src/pyfastani/omp.h → src/FastANI/omp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern "C" {

extern int omp_get_thread_num(void);
extern int omp_get_num_threads(void);
extern void omp_set_num_threads(int);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion src/pyfastani/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_subdirectory(_sequtils)

cython_extension(_fasta LINKS sequtils )
cython_extension(_fastani LINKS fastani sequtils SOURCES omp.cpp _utils.cpp)
cython_extension(_fastani LINKS fastani sequtils SOURCES _utils.cpp)

0 comments on commit 4765f51

Please sign in to comment.