Skip to content

Commit

Permalink
Makefile for saiserver and add entrypoint API (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 authored Nov 20, 2024
1 parent e49cd40 commit 28bd78a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ PROTO_OBJ = $(patsubst dataplane/proto/sai/%.proto, dataplane/proto/sai/%.pb.o,
GRPC_OBJ = $(patsubst dataplane/proto/sai/%.proto, dataplane/proto/sai/%.grpc.pb.o, $(PROTOS))
SAI_SRC = $(wildcard dataplane/standalone/sai/*.cc)
SAI_OBJ = $(patsubst dataplane/standalone/sai/%.cc, dataplane/standalone/sai/%.o, $(SAI_SRC))
SAISERV_SRC = $(wildcard dataplane/standalone/saiserver/*.cc)
SAISERV_OBJ = $(patsubst dataplane/standalone/saiserver/%.cc, dataplane/standalone/saiserver/%.o, $(SAISERV_SRC))

.PHONY: sai-clean
sai-clean:
Expand All @@ -77,10 +79,16 @@ dataplane/proto/sai/%.grpc.pb.o: dataplane/proto/sai/%.grpc.pb.cc
dataplane/standalone/sai/%.o: dataplane/standalone/sai/%.cc $(PROTO_SRC)
g++ -fPIC -c $< -o $@ -I . -I external/com_github_opencomputeproject_sai -I external/com_github_opencomputeproject_sai/inc -I external/com_github_opencomputeproject_sai/experimental


libsai.so: $(PROTO_OBJ) $(GRPC_OBJ) $(SAI_OBJ)
g++ -fPIC -o libsai.so -shared dataplane/standalone/entrypoint.cc dataplane/proto/sai/*.o dataplane/standalone/sai/*.o -lglog -lprotobuf -lgrpc++ -I . -I external/com_github_opencomputeproject_sai -I external/com_github_opencomputeproject_sai/inc -I external/com_github_opencomputeproject_sai/experimental

dataplane/standalone/saiserver/%.o: dataplane/standalone/saiserver/%.cc $(PROTO_SRC)
g++ -fPIC -c $< -o $@ -I . -I external/com_github_opencomputeproject_sai -I external/com_github_opencomputeproject_sai/inc -I external/com_github_opencomputeproject_sai/experimental

dataplane/standalone/server: $(PROTO_OBJ) $(GRPC_OBJ) $(SAISERV_OBJ)
g++ -o dataplane/standalone/server dataplane/standalone/server.cc dataplane/standalone/saiserver/*.o dataplane/proto/sai/*.o -libsaivs -labsl_synchronization -lglog -lgpr -lprotobuf -lgrpc -lgrpc++ -I . -I external/com_github_opencomputeproject_sai -I external/com_github_opencomputeproject_sai/inc -I external/com_github_opencomputeproject_sai/experimental


define DEB_CONTROL =
Package: lucius-libsai
Version: 1.0-3
Expand Down
3 changes: 3 additions & 0 deletions dataplane/standalone/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ int main() {

grpc::ServerBuilder builder;

Entry entry;

builder.RegisterService(&entry);
builder.RegisterService(acl.get());
builder.RegisterService(bfd.get());
builder.RegisterService(buffer.get());
Expand Down

0 comments on commit 28bd78a

Please sign in to comment.