librabit_wrapper.so error?
Closed this issue · 3 comments
Hi,
I am trying to install rabit on my mac (gcc 4.8.5) and got the following error after typing make. Could you help me figure out what's missing?
$ make
c++ -c -O3 -msse2 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -fPIC -o allreduce_base.o src/allreduce_base.cc
c++ -c -O3 -msse2 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -fPIC -o allreduce_robust.o src/allreduce_robust.cc
c++ -c -O3 -msse2 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -fPIC -o engine.o src/engine.cc
ar cr lib/librabit.a allreduce_base.o allreduce_robust.o engine.o
c++ -c -O3 -msse2 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -fPIC -o engine_mock.o src/engine_mock.cc
ar cr lib/librabit_mock.a allreduce_base.o allreduce_robust.o engine_mock.o
c++ -c -O3 -msse2 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -fPIC -o rabit_wrapper.o wrapper/rabit_wrapper.cc
c++ -O3 -msse2 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -fPIC -shared -o wrapper/librabit_wrapper.so rabit_wrapper.o lib/librabit.a -Llib -lrt
ld: library not found for -lrt
collect2: error: ld returned 1 exit status
make: *** [wrapper/librabit_wrapper.so] Error 1
remove -lrt
Just ran into this as well. I notice that most of the other dmlc projects detect this. For example in dmlc-core:
# Mac OS X does not support "-lrt" flag
OS := $(shell uname -s)
ifneq ($(OS), Darwin)
DMLC_LDFLAGS += -lrt
endif
If no one has time to implement this, I can put together a pull request.
Would be nice to have your PR!