Skip to content

Commit

Permalink
build_shim.sh: fix bugs regarding the build
Browse files Browse the repository at this point in the history
Signed-off-by: Alireza Sanaee <[email protected]>
  • Loading branch information
sarsanaee committed Sep 28, 2024
1 parent 6c673a0 commit 2a8a4f0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions build_shim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ fi
BASE_DIR="$(dirname "$(readlink -f "$0")")"
SRC_DIR="${BASE_DIR}/src/ext"

blue "Downloding dependency ..."
sudo apt install libgflags-dev

blue "Building Machnet shim library..."

cd "${SRC_DIR}" || exit 1
Expand Down
2 changes: 1 addition & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC = g++
CFLAGS = -I../src/ext -L../ -lmachnet_shim -lrt -lgflags -Wl,-rpath,..
CFLAGS = -I../src/include -I../src/ext -L../ -lmachnet_shim -lrt -lgflags -Wl,-rpath,..

all: hello_world

Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void assert_with_msg(bool cond, const char *msg) {
}

int main(int argc, char *argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
gflags::ParseCommandLineFlags(&argc, &argv, true);

int ret = machnet_init();
assert_with_msg(ret == 0, "machnet_init() failed");
Expand Down
3 changes: 2 additions & 1 deletion src/ext/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LDFLAGS = -shared
LIBS = -luuid
TARGET = libmachnet_shim.so
SRCS = machnet.c
INC = ../include
OBJS = $(SRCS:.c=.o)

all: $(TARGET)
Expand All @@ -12,7 +13,7 @@ $(TARGET): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)

%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(CC) -I$(INC) $(CFLAGS) -c $< -o $@

clean:
rm -f $(OBJS) $(TARGET)
Expand Down
3 changes: 2 additions & 1 deletion src/ext/jring_elem_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ extern "C" {
#endif

#include <memory.h>
#include <pause.h>
#include <stdint.h>

#include "pause.h"

#ifndef likely
#define likely(x) __builtin_expect((x), 1)
#endif
Expand Down

0 comments on commit 2a8a4f0

Please sign in to comment.