Closed nguyenpham closed 5 years ago
Remove -DNUMA flag , not supported by macOS.
Thanks for your help.
It is hard for me since I am new to make. I tried but still got another error as below. Can you or someone give command lines to compile in MacOs? Thanks
Nguyens-iMac:src nguyenpham$ make build ARCH=x86-64 numa=no
Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
bits: '64'
prefetch: 'yes'
popcnt: 'no'
sse: 'yes'
pext: 'no'
Flags:
CC: gcc
CFLAGS: -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native
LDFLAGS: -lm -m64 -arch x86_64 -mmacosx-version-min=10.9 -lpthread
Testing config sanity. If this fails, try 'make help' ...
/Library/Developer/CommandLineTools/usr/bin/make ARCH=x86-64 COMP=gcc all
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o benchmark.o benchmark.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o bitbase.o bitbase.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o bitboard.o bitboard.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o endgame.o endgame.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o evaluate.o evaluate.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o main.o main.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o material.o material.c
gcc -Wall -std=c11 -pedantic -Wextra -Wshadow -m64 -D_POSIX_C_SOURCE=199506L -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -march=native -c -o misc.o misc.c
misc.c:242:3: warning: implicit declaration of function 'madvise' is invalid in C99 [-Wimplicit-function-declaration]
madvise(data, *map, MADV_RANDOM);
^
misc.c:242:23: error: use of undeclared identifier 'MADV_RANDOM'
madvise(data, *map, MADV_RANDOM);
^
1 warning and 1 error generated.
make[1]: *** [misc.o] Error 1
make: *** [build] Error 2
I’m going to assume you are on Mojave OS. You might be missing some headers , run this at the command line : sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
If that file does not exist, you will need to run this first : xcode-select --install
Thanks. I tried both. The first one installed well, the second one has been installed already in my machine. But the make does not work with the same error
Just for the heck of it - download the source/makefile from my fork. I anticipate you will get the same error, but after that, my next suggestion is don't use Apple clang , go grab Macports gcc or clang , gcc is faster. You will have to install MacPorts first. Apple is not really good about maintaining libraries they don't care about and if you send them a bug report, it made take year to get fixed if you're lucky. Fortunately there is MacPorts and Homebrew ( pick just one , don't try to use both) to keep everything running properly. https://github.com/MichaelB7/Cfish
Just for clarification, clang compiles the exe faster, gcc makes faster exe's - for the mac anyway.
Wow, thanks, your fork works! It is compiled successfully (even there are over 20 warning).
Error message: