Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CXX = g++
CXXFLAGS = -Wall -Werror -std=c++17 -march=native -O2 -g -Ibuild/libfabric/include -I/usr/local/cuda/include
LDFLAGS = -Lbuild/libfabric/lib -L/usr/local/cuda/lib64
LIBFABRIC_HOME ?= build/libfabric
CUDA_HOME ?= /usr/local/cuda
CXXFLAGS = -Wall -Werror -std=c++17 -march=native -O2 -g -I$(LIBFABRIC_HOME)/include -I$(CUDA_HOME)/include
LDFLAGS = -L$(LIBFABRIC_HOME)/lib -L$(CUDA_HOME)/lib64
LDLIBS = -lfabric -lpthread -lcudart -lcuda
BINARIES = build/4_hello \
build/5_reverse \
Expand All @@ -15,7 +17,7 @@ BINARIES = build/4_hello \
build/14_batch \
build/15_lazy

export LD_LIBRARY_PATH := $(PWD)/build/libfabric/lib:$(LD_LIBRARY_PATH)
export LD_LIBRARY_PATH := $(PWD)/$(LIBFABRIC_HOME)/lib:$(LD_LIBRARY_PATH)

.PHONY: all clean

Expand All @@ -24,5 +26,5 @@ all: $(BINARIES)
clean:
rm -rf $(BINARIES)

build/%: src/%.cpp build/libfabric/lib/libfabric.so
build/%: src/%.cpp $(LIBFABRIC_HOME)/lib/libfabric.so
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS)
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,22 @@ Build the demo code:
```bash
make
```

See the comments at the top of each source file for instructions and examples of each demo.

## Build with standard AWS libraries
AWS provides librabric as a part of [efa_installer](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa-start.html) bundle.
Starting from efa_installer-1.39.0 is use libfarbic-2.x, so this demo can be build with it.
```bash
# Install EFA installer bundle
AWS_EFA_INSTALLER_VER=1.39.0
curl -sL https://efa-installer.amazonaws.com/aws-efa-installer-${AWS_EFA_INSTALLER_VER}.tar.gz | tar zx
cd aws-efa-installer
./efa_installer.sh -y -n

# just create build dir
mkdir -p build
# Build source with preinstalled library
make LIBFABRIC_HOME=/opt/amazon/efa
```