Page 1 of 1

Sugar NN for Mac

Posted: Tue Jan 14, 2020 9:42 am
by maxdeg
Trying to compile the latest Sugar NN for my Mac - this error popped up - need help here please .. many thanks .. :D

g++ -Wall -Wcast-qual -std=c++11 -pedantic -Wextra -Wshadow -m64 -arch x86_64 -mmacosx-version-min=10.9 -DNDEBUG -O3 -mdynamic-no-pic -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_PEXT -msse4 -mbmi2 -flto -c -o tt.o tt.cpp
tt.cpp:42:10: fatal error: 'windows.h' file not found
#include "windows.h"
^~~~~~~~~~~
1 error generated.
make[1]: *** [tt.o] Error 1
make: *** [build] Error 2
➜ src

Re: Sugar NN for Mac

Posted: Tue Jan 14, 2020 11:41 am
by Max
Looks like the author is aware of this issue (for Linux). But no solution yet.

Re: Sugar NN for Mac

Posted: Tue Jan 14, 2020 12:45 pm
by maxdeg
Max wrote: Tue Jan 14, 2020 11:41 am Looks like the author is aware of this issue (for Linux). But no solution yet.
OK - many thanks .. :D

Re: Sugar NN for Mac

Posted: Tue Jan 14, 2020 9:04 pm
by thunderstruck
I could compile it for Linux applying these fixes.

# windows.h: No such file or directory
sed -i 's|#include "windows.h"||' tt.cpp

# Disable large pages code for Linux
sed -i '92i#ifdef _WIN32' tt.cpp
sed -i '145i#endif' tt.cpp
sed -i '162i#ifdef _WIN32' tt.cpp
sed -i '164i#endif' tt.cpp
sed -i '170i#ifdef _WIN32' tt.cpp
sed -i '174i#endif' tt.cpp
sed -i '180i#ifdef _WIN32' tt.cpp
sed -i '182i#endif' tt.cpp
sed -i '186i#ifdef _WIN32' tt.cpp
sed -i '190i#endif' tt.cpp
sed -i '195i#ifdef _WIN32' tt.cpp
sed -i '197i#endif' tt.cpp
sed -i '199i#ifdef _WIN32' tt.cpp
sed -i '228i#endif' tt.cpp

# /usr/bin/ld: cannot find -lws2_32
sed -i 's| -lws2_32||' Makefile

And compile : make profile-build ARCH=x86-64-bmi2 COMP=gcc

Re: Sugar NN for Mac

Posted: Thu Jan 16, 2020 1:03 pm
by maxdeg
@thunderstruck

Thanks .. :D .. will try this weekend - hope it works !