Skip to content

Commit

Permalink
compatible for low version glibc on centos5.4
Browse files Browse the repository at this point in the history
 1. Makefile add version check and rpath;
 2. Add if marco for EPOLLRDHUP
  • Loading branch information
zhaoanan committed Nov 15, 2015
1 parent 8d84e7e commit 2f77e8e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

RPATH = /usr/local/pika/lib/
OSVERSION := $(shell cat /etc/redhat-release | cut -d "." -f 1 | awk '{print $$NF}')
ifeq ($(OSVERSION), 5)
LFLAGS = -Wl,-rpath=$(RPATH)
endif

CXX = g++
CXXFLAGS = -Wall -W -DDEBUG -g -O0 -D__XDEBUG__ -fPIC -Wno-unused-function -std=c++11
OBJECT = pika
Expand All @@ -14,7 +21,6 @@ INCLUDE_PATH = -I./include/ \

LIB_PATH = -L./ \
-L$(THIRD_PATH)/nemo/output/lib/ \
-L$(THIRD_PATH)/nemo/3rdparty/rocksdb/ \
-L$(THIRD_PATH)/mario/output/lib/


Expand Down Expand Up @@ -46,13 +52,14 @@ all: $(OBJECT)
mkdir $(OUTPUT)
mkdir $(OUTPUT)/bin
cp -r ./conf $(OUTPUT)/
cp -r ./lib $(OUTPUT)/
cp $(OBJECT) $(OUTPUT)/bin/
rm -rf $(OBJECT)
@echo "Success, go, go, go..."


$(OBJECT): $(ROCKSDB) $(GLOG) $(MARIO) $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(INCLUDE_PATH) $(LIB_PATH) -Wl,-Bdynamic $(LIBS)
$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(INCLUDE_PATH) $(LIB_PATH) $(LFLAGS) $(LIBS)

$(ROCKSDB):
make -C $(THIRD_PATH)/nemo/
Expand Down
Binary file added lib/libstdc++.so.6.0.13
Binary file not shown.
4 changes: 4 additions & 0 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,11 @@ void PikaServer::RunProcess()
write(pikaThread_[last_thread_]->notify_send_fd(), "", 1);
last_thread_++;
last_thread_ %= g_pikaConf->thread_num();
#ifndef EPOLLRDHUP
} else if ((tfe + i)->mask_ & (EPOLLERR | EPOLLHUP)) {
#else
} else if ((tfe + i)->mask_ & (EPOLLRDHUP | EPOLLERR | EPOLLHUP)) {
#endif
LOG(WARNING) << "Epoll timeout event";
}
}
Expand Down
2 changes: 1 addition & 1 deletion third/nemo
Submodule nemo updated from 4bb9ab to 16c9db

0 comments on commit 2f77e8e

Please sign in to comment.