dlopen failed: library “libomp.so” not found
#I have changed flags in CMakeLists.txt as following: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp -static-openmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -static-openmp")
Here is what the above code is Doing:
1. It is setting the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to include the -fopenmp flag.
2. It is setting the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to include the -static-openmp flag.
The -fopenmp flag tells the compiler to use OpenMP.
The -static-openmp flag tells the compiler to statically link the OpenMP library.