-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
installation error: Undefined symbols for architecture arm64 #67
Comments
You might try installing the OpenMP library
Then run the configure and make steps again. |
Thank you for your reply. I already have the |
For some reason it didn't get picked up by the configure. Try editing the makefile manually and add
to the line that starts
|
Just wanted to add how I fixed this problem in case others come across it in the future! In short, it has to do with directives and functions not playing nicely with the newer MacOS. But a lot of the nuance goes way over my head. This StackOverflow forum is exactly how I ended up solving it! In short I had to add not only To see the full Makefile example with the edits here is what mine looked: #edited Makefile
# compilers and flags
CC=g++
CXX=g++
LD=g++
CFLAGS = -std=c++11 -I. -O3 -include config.h
LINKER = $(LD) -std=c++11 -O3 -o
LFLAGS = -I.
AUX = CHANGELOG.md configure INSTALL LICENSE Makefile.in README.md config.h.in docs/tutorial examples Test_data
# directories
SRCDIR = src
OBJDIR = obj
BINDIR = bin
# our program
TARGET = cafe5
# Default build
all: prep release
release: $(BINDIR)/$(TARGET)
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS) $(OBJDIR)/main.o
$(LINKER) $@ $(LFLAGS) $(OBJECTS) $(OBJDIR)/main.o -lm -Xpreprocessor -fopenmp -lomp
$(OBJECTS): $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
$(OBJDIR)/main.o: main.cpp
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/test.o: test.cpp
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
$(rm) $(OBJECTS) $(OBJDIR)/main.o
.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
#
# Debug build settings
#
DBGDIR = debug
DBG_OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(DBGDIR)/%.o)
DBG_CFLAGS = -std=c++11 -Wall -Werror -g -I. -include config.h $(INCLUDES) -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
DBG_LINKER = $(LD) -std=c++11 -o
$(DBG_OBJECTS): $(DBGDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $(DBG_CFLAGS) -c $< -o $@
$(DBGDIR)/main.o: main.cpp
$(CC) $(DBG_CFLAGS) -c $< -o $@
$(DBGDIR)/$(TARGET): $(DBG_OBJECTS) $(DBGDIR)/main.o
$(DBG_LINKER) $@ $(LFLAGS) $(DBG_OBJECTS) $(DBGDIR)/main.o -lm -Xpreprocessor -fopenmp -lomp
.PHONY: debug
debug: $(DBGDIR)/$(TARGET)
TESTDIR = test
TEST_TARGET = runtests
TEST_OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(TESTDIR)/%.o)
$(TEST_OBJECTS): $(TESTDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $(DBG_CFLAGS) $(INCLUDES) -DSILENT -c $< -o $@
$(TESTDIR)/test.o: test.cpp
$(CC) $(DBG_CFLAGS) -c $< -o $@
$(TESTDIR)/$(TEST_TARGET): $(TEST_OBJECTS) $(TESTDIR)/test.o
$(LINKER) $@ $(LFLAGS) $(TEST_OBJECTS) $(TESTDIR)/test.o -lm -Xpreprocessor -fopenmp -lomp
.PHONY: test
test: $(TESTDIR)/$(TEST_TARGET)
prep:
@mkdir -p $(OBJDIR) $(BINDIR) $(TESTDIR)
.PHONY: docs
docs:
$(MAKE) -C docs
.PHONY: dist
dist: $(AUX)
mkdir -p distro
tar --transform "s,^,CAFE5/," --transform "s,docs/,," --owner=0 --group=0 -czf distro/CAFE5-5.0.0.tar.gz src test.cpp main.cpp $(AUX) |
Thanks, this is very helpful! I added a link to your answer to a new wiki page and will close this issue. |
Hi, when I try to compile CAFE 5 I get the following error:
about my computer: MacOS Big Sur (version 11.2.3), apple M1 processor.
Any help is greatly appreciated!
The text was updated successfully, but these errors were encountered: