I have to use openMP for a project with my university. To do that I downloaded llvm using brew and I replaced cc = gcc in the makefile by CC=/usr/local/opt/llvm/bin/clang.
Now it seemed like it was going to work, but I get an unexpected error ld: library not found for -lomp clang-11: error: linker command failed with exit code 1.
When I run llvm-config --system-libs I get : -lm -lz -lcurses -lxml2.
I'm a complete beginner on this subject, but I think I have to install the ld library ? Can anyone help ?
edit: full makefile
C=/usr/local/opt/llvm/bin/clang
CFLAGS = -O2 -fopenmp
LDFLAGS = -fopenmp
EXEC = bubble.run \
mergesort.run \
odd-even.run
HEADER_FILES = $(wildcard *.h)
RAND_INIT=0
ifeq ($(RAND_INIT), 1)
$(Initialization of the vector is random)
CONFIG_FLAGS += -DRINIT
endif
all: $(EXEC)
%.run: %.o utils.o
$(CC) $(LDFLAGS) -o $@ $^
%.o: %.c $(HEADER_FILES)
$(CC) -c $(CONFIG_FLAGS) $(CFLAGS) $< -o $@
clean:
rm -f $(EXEC) *.o *~
.PHONY: clean