Skip to content
Extraits de code Groupes Projets
Vérifiée Valider e5f2b87c rédigé par Kubat's avatar Kubat
Parcourir les fichiers

WIP: Try to check for OpenMP support by the compilers

parent 7c1ffd36
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!189Resolve "Dépendance manquante OpenMP"
......@@ -228,6 +228,22 @@ set(SQL_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/database/memory.sql
)
### ###
# TEST OPENMP #
### ###
try_compile(OPENMP_SUPPORT_OK
${CMAKE_BINARY_DIR/___openmp_test_ok
${CMAKE_CURRENT_SOURCE_DIR}/utils/cmake/TestOpenMP.c}
LINK_LIBRARIES -fopenmp
)
if(OPENMP_SUPPORT_OK)
message(STATUS "Compiler has OpenMP support")
else()
message(FATAL_ERROR "Compiler doesn't have OpenMP support")
endif()
### ###
# THE COMPILATION DIRECTIVES #
### ###
......@@ -258,8 +274,8 @@ else()
${SQL_GENERATED_FILE}
)
endif()
add_executable(lkt ${lkt_SOURCES})
add_executable(luka ${luka_SOURCES} ${SQL_GENERATED_FILE})
add_executable(lkt ${lkt_SOURCES})
add_executable(luka ${luka_SOURCES} ${SQL_GENERATED_FILE})
set(MANPAGES_COMMANDS)
if(GENERATE_MANPAGES)
......
......@@ -21,6 +21,9 @@ A Karaoke player made to replace the old bash scripts on Sakura.
- [cmake](https://cmake.org/) with at least the version 3.17
- a C compiler with C11 support
- a C++ compiler with C++20 support (for the Qt5 module)
- The C and C++ compilers must have OpenMP support (see the
[OpenMP C test program](utils/cmake/TestOpenMp.c))
- the [sqlite3](https://www.sqlite.org/) development library, version
3.31.0 or newer for [generated columns](https://www.sqlite.org/gencol.html) support
- a POSIX.1-2008 compatible system (for MS Windows, use something like WSL2)
......
int
main(void)
{
int res = 0;
int A[10];
memset(&A, 1, sizeof(A));
#pragma omp parallel for shared(A, res) reduction (+res)
for (int i = 0; i < 10; i += 1) {
res += A[i]
}
return res;
}
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter