Commit 559a56aa authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed tutorial 'Building applications with TNL'

It is superseded by the usage hints documented on the front page and by
the linked example project.
parent bca052c8
Loading
Loading
Loading
Loading
+0 −0

Empty file deleted.

+0 −54
Original line number Diff line number Diff line
include Makefile.inc

SUBDIRS = 
HEADERS =
SOURCES = tnl-make-example.cpp
CUDA_SOURCES = tnl-make-example-cuda.cu
TARGETS = tnl-make-example 
CUDA_TARGETS = tnl-make-example-cuda

FILES = Makefile \
        Makefile.inc \
        $(CUDA_SOURCES) \
        $(SOURCES) \
        $(HEADERS)

SUBDIRSCLEAN=$(addsuffix clean,$(SUBDIRS))

all: bin subdirs $(TARGETS) $(CUDA_TARGETS)

.PHONY:	subdirs $(SUBDIRS)
subdirs:    $(SUBDIRS)
$(SUBDIRS):
	$(MAKE) -C $@	

bin:
	mkdir -p bin

install: all
	mkdir -p $(INSTALL_DIR)/bin
	cp bin/* $(INSTALL_DIR)/bin

.PHONY:	clean
clean:	$(SUBDIRSCLEAN) clean_curdir

clean_curdir:
	rm -f *.o
	
%clean:	%
	$(MAKE) -C $< clean

dist: clean
	tar zcvf $(PROJECT_NAME)-src.tgz $(SUBDIRS) $(FILES)

$(TARGETS): % : %.o
	$(CXX) $(LDFLAGS) -o $@ $< $(LDLIBS)

$(CUDA_TARGETS): % : %.cu.o
	$(CUDA_CXX) $(CUDA_LDFLAGS) -o $@ $< $(CUDA_LDLIBS)

$(SOURCES:%.cpp=%.o): %.o: %.cpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<

$(CUDA_SOURCES:%.cu=%.cu.o): %.cu.o : %.cu
	$(CUDA_CXX) $(CUDA_CPPFLAGS) $(CUDA_CXXFLAGS) -c -o $@ $<
 No newline at end of file
+0 −48
Original line number Diff line number Diff line
# Replace the following with your project name
PROJECT_NAME = tnl-make-example

# Replace the following with your TNL installation path
TNL_HEADERS = ${HOME}/.local/include
INSTALL_DIR = ${HOME}/.local
WITH_CUDA = yes
WITH_OPENMP = yes
WITH_DEBUG = no

# If TNL is installed on your system, CUDA arch can be detected automatically using
# a tool 'tnl-cuda-arch'. This is done by default if CUDA_ARCH is set to 'auto'. 
# Otherwise, if you set it manually by telling the CUDA architecture number
# i.e 50, 60 etc.
CUDA_ARCH = auto

# Set-up compilers
CXX = g++
CUDA_CXX = nvcc

# Set-up CXX_FLAGS
CXXFLAGS = -pthread -Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas -std=c++14 -I$(TNL_HEADERS)
ifeq ( $(WITH_DEBUG), yes )
	CXXFLAGS += -O0 -g
else
   CXXFLAGS += -DNDEBUG -O3 -funroll-loops
endif

# Set-up CUDA_CXXFLAGS
CUDA_CXXFLAGS = -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe --std c++14 -I$(TNL_HEADERS) 
ifeq ( $(WITH_CUDA), yes )
   CUDA_CXXFLAGS += -DHAVE_CUDA
   ifeq ( $(CUDA_ARCH), auto )
      CUDA_CXXFLAGS += `tnl-cuda-arch`
   else
      CUDA_CXXFLAGS += -gencode arch=compute_$(CUDA_ARCH),code=sm_$(CUDA_ARCH)
   endif
endif

# Set-up CPPFLAGS
CPPFLAGS = -MD -MP

# Set-up LDFLAGS
LDFLAGS += -lm
ifeq ( $(WITH_OPENMP), yes )
   LDFLAGS += -lgomp
endif
+0 −1
Original line number Diff line number Diff line
#include "example-cuda-2.h"
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
example-cuda-2.cpp
 No newline at end of file
Loading