Skip to content
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

macOS compilation #14

Open
paulotex opened this issue Mar 2, 2021 · 2 comments
Open

macOS compilation #14

paulotex opened this issue Mar 2, 2021 · 2 comments

Comments

@paulotex
Copy link

paulotex commented Mar 2, 2021

Minimal changes for macOS:

  • We need g++ from brew, I could not make the XCode accept the pthread syntax. After installing g++ with brew, edit linux_src_bin and use that instead of the default g++.
  • nasm needs -fmacho64 instead of -felf64
  • nasm needs --prefix _

I also added a "clean:" rule.

CC = /usr/local/opt/gcc/bin/g++-10

phenom2_benchmark: main.cpp asm.o
	$(CC) main.cpp asm.o -lpthread -ffast-math -msse3 -O3 -o phenom2_benchmark

asm.o: asm.asm AND_REG_REG.asm CMOVcc_REG_REG.asm PADDB_MMX.asm ADD_REG_1.asm SHR_REG_CL.asm AVXChecker.asm FLOPS.asm IMUL_REG_REG.asm
	nasm asm.asm -fmacho64 --prefix _ -o asm.o

clean:
	rm -f *.o phenom2_benchmark
@paulotex
Copy link
Author

paulotex commented Mar 2, 2021

Even better, thanks to nervosolek (pull requests), "-std=c++11" is enough to use XCode. So the changes are simply:
-fmacho64 --prefix _
for nasm.

@paulotex
Copy link
Author

paulotex commented Mar 2, 2021

phenom2_benchmark: main.cpp asm.o
	g++ main.cpp asm.o -std=c++11 -lpthread -ffast-math -msse3 -O3 -o phenom2_benchmark

asm.o: asm.asm AND_REG_REG.asm CMOVcc_REG_REG.asm PADDB_MMX.asm ADD_REG_1.asm SHR_REG_CL.asm AVXChecker.asm FLOPS.asm IMUL_REG_REG.asm
	nasm asm.asm -fmacho64 --prefix _ -o asm.o

clean:
	rm -f *.o phenom2_benchmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant