Skip to content

Commit

Permalink
cleaned some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Oct 6, 2021
1 parent e04d4f4 commit 54b1353
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 39 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ set(CMAKE_CUDA_COMPILER $ENV{CUDA_HOME}/bin/nvcc)
enable_language(CUDA)
include_directories($ENV{CUDA_HOME}/include)

set(target ts)
add_executable(
ts
${target}
client.c
env.c
error.c
Expand All @@ -28,4 +29,4 @@ add_executable(
tail.c
)

target_link_libraries(ts nvidia-ml)
target_link_libraries(${target} nvidia-ml)
32 changes: 13 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,16 @@ OBJECTS=main.o \
env.o \
tail.o\
gpu.o
TARGET=ts
INSTALL=install -c

all: ts
all: $(TARGET)

tsretry: tsretry.c
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) -o $(TARGET) $^ -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -I$(CUDA_HOME)/include -lpthread -lcudart -lcublas -fopenmp -lnvidia-ml

ts: $(OBJECTS)
$(CC) $(LDFLAGS) -o ts $^ -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -I$(CUDA_HOME)/include -lpthread -lcudart -lcublas -fopenmp -lnvidia-ml

# Test our 'tail' implementation.
ttail: tail.o ttail.o
$(CC) $(LDFLAGS) -o ttail $^


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

# Dependencies
main.o: main.c main.h
Expand All @@ -50,19 +44,19 @@ error.o: error.c main.h
signals.o: signals.c main.h
list.o: list.c main.h
tail.o: tail.c main.h
ttail.o: ttail.c main.h
gpu.o: gpu.c main.h
$(CC) $(CFLAGS) $(CPPFLAGS) -L$(CUDA_HOME)/lib64 -I$(CUDA_HOME)/include -lpthread -c gpu.c
$(CC) $(CFLAGS) $(CPPFLAGS) -L$(CUDA_HOME)/lib64 -I$(CUDA_HOME)/include -lpthread -c $< -o $@

clean:
rm -f *.o ts
rm -f *.o $(TARGET)

install: ts
install: $(TARGET)
$(INSTALL) -d $(PREFIX)/bin
$(INSTALL) ts $(PREFIX)/bin
$(INSTALL) -d $(PREFIX)/share/man/man1
$(INSTALL) -m 644 ts.1 $(PREFIX)/share/man/man1
$(INSTALL) -m 644 $(TARGET).1 $(PREFIX)/share/man/man1

.PHONY: uninstall
uninstall:
rm -f $(PREFIX)/bin/ts
rm -f $(PREFIX)/share/man/man1/ts.1
rm -f $(PREFIX)/bin/$(TARGET)
rm -f $(PREFIX)/share/man/man1/$(TARGET).1
File renamed without changes.
4 changes: 4 additions & 0 deletions install_make
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

make
sudo make install
16 changes: 0 additions & 16 deletions ttail.c

This file was deleted.

3 changes: 1 addition & 2 deletions uninstall
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

ts -K
sudo rm -f /usr/local/bin/ts
sudo rm -f /usr/local/share/man/man1/ts.1
sudo make uninstall

0 comments on commit 54b1353

Please sign in to comment.