How compile program with openMP functions?

31 Views Asked by At

I tried to run the code related to OpenMP and parallelization on mac m1, but I ran into a number of problems. The usual connection of the header file <omp.h> didn't work in VSC, so I installed libomp via homebrew and now have the following: path to the header file: /opt/homebrew/Cellar/libomp/18.1.2/include/omp and library path: /opt/homebrew/Cellar/libomp/18.1.2/lib/libgmp.dylib

How can I compile the final project? He always gives me an error: Undefined symbols for architecture arm64 ... linker command failed with exit code 1 OR unsupported option '-fopenmp'.

I try use gcc -Xpreprocessor -fopenmp -I/opt/homebrew/Cellar/libomp/18.1.2/include matrix_functions.c -o main, but it's useless.

0

There are 0 best solutions below