Make: undefined reference to 'check_nan'
fabero opened this issue · 2 comments
fabero commented
I pulled the source code from the master branch and ran cd glove && make
. However, this results in the following error. Does anyone know what the cause of this is? The version of release 1.2 does build, but it returns an error when running demo.sh
, so I am kind of stuck here.
gcc -c src/vocab_count.c -o build/vocab_count.o -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc -c src/cooccur.c -o build/cooccur.o -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc -c src/shuffle.c -o build/shuffle.o -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc -c src/glove.c -o build/glove.o -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc -c src/common.c -o build/common.o -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc build/vocab_count.o build/common.o -o build/vocab_count -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc build/cooccur.o build/common.o -o build/cooccur -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc build/shuffle.o build/common.o -o build/shuffle -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
gcc build/glove.o build/common.o -o build/glove -lm -pthread -O3 -march=native -funroll-loops -Wall -Wextra -Wpedantic
build/glove.o:glove.c:function glove_thread: error: undefined reference to 'check_nan'
build/glove.o:glove.c:function glove_thread: error: undefined reference to 'check_nan'```
AngledLuffa commented
Could this be an issue with the compiler treating the function as an extern
by default? In other words, you might be able to make progress by changing
line 145 to
`static inline real check_nan ...`
I'm in no way a C compiler expert
masterccioli commented
This resolved the issue for me.