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 60cc59d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
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 60cc59d

Please sign in to comment.