Skip to content
Snippets Groups Projects
Commit 202d87d7 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: Variables for CUDA compilation, some clean up and comments

parent 227326d7
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,12 @@ ARCHLDFLAGS =
# Libraries available for linking by all projects.
ARCHLIBS =
# Compiler flags for CUDA projects.
ARCHCUDACXXFLAGS =
# Linker flags for CUDA projects.
ARCHCUDALDFLAGS =
#####################################################################
#
# Darwin specific sys vars and ext libs
......@@ -105,12 +111,14 @@ ifneq ($(shell which nvcc), )
# - Do not use -pedantic, otherwise *every single line* of
# transpiled cuda code will trigger "warning: style of line
# directive is a GCC extension".
CUDACXXFLAGS = -I${CUDADIR}/include \
${GENCODE_FLAGS} \
-DARMA_ALLOW_FAKE_GCC \
--compiler-options \
"$(filter-out -pedantic, ${ARCHCXXFLAGS})"
CUDALDFLAGS = -lcurand -lcudart
ARCCUDACXXFLAGS = -I${CUDADIR}/include \
-maxrregcount=64 \
${GENCODE_FLAGS} \
-DARMA_ALLOW_FAKE_GCC \
--compiler-options \
"$(filter-out -pedantic, ${ARCHCXXFLAGS})"
ARCHCUDALDFLAGS = -L${CUDADIR}/lib \
-L${CUDADIR}/lib/stubs
ifeq ($(SYSTYPE), Darwin)
......
# $Id$
# Make rules for FSL projects
#
# Automatic GNU make rules are used for compiling C and C++ files.
all:
help:
@echo " make Rebuild project targets";
@echo " make clean Remove executables, libraries and object files";
@echo " make install Install into your local FSLDEVDIR";
clean:
${RM} -f *.o *.a *.so *.exe depend.mk \
${XFILES} ${FXFILES} ${SOFILES} ${AFILES} ${TESTXFILES}
insertcopyright:
${FSLCONFDIR}/common/insertcopyright * */*
depend:
${RM} -f depend.mk
${MAKE} depend.mk
depend.mk:
@echo Building dependency file depend.mk
@for srcfile in `find . -name "*.c" -or -name "*.cc" -or -name "*.cxx" -or -name "*.cpp" -or -name "*.inc" -or -name "*.hpp"` verylongdummyname ; do \
if [ -f $$srcfile ] ; then \
${CC} -MM ${INCFLAGS} $$srcfile >> depend.mk ; \
else \
touch depend.mk; \
fi \
done
install:
@${MAKE} "DESTDIR=${FSLDEVDIR}" master-install-script
......@@ -164,22 +185,4 @@ datainstall:
fi; \
done
insertcopyright:
${FSLCONFDIR}/common/insertcopyright * */*
depend:
${RM} -f depend.mk
${MAKE} depend.mk
depend.mk:
@echo Building dependency file depend.mk
@for srcfile in `find . -name "*.c" -or -name "*.cc" -or -name "*.cxx" -or -name "*.cpp" -or -name "*.inc" -or -name "*.hpp"` verylongdummyname ; do \
if [ -f $$srcfile ] ; then \
${CC} -MM ${INCFLAGS} $$srcfile >> depend.mk ; \
else \
touch depend.mk; \
fi \
done
include depend.mk
......@@ -7,25 +7,37 @@ PROJNAME =
# Project-specific compiler/linker flags - these
# can be overridden in the project Makefile.
USRLDFLAGS =
USRINCFLAGS =
USRCFLAGS =
USRCXXFLAGS =
LIBS =
USRLDFLAGS = # Project-specific linker flags
USRINCFLAGS = # Project-specific include directories
USRCFLAGS = # Project-specific compiler flags for C projects
USRCXXFLAGS = # Project-specific compiler flags for C++ projects
LIBS = # Project-specific libraries to link against for C
# and C++ projects - these are incorporated into the
# final LDFLAGS, below.
USRCUDACXXFLAGS = # Project-specific compiler flags for CUDA projects
USRCUDALDFLAGS = # Project-specific linker flags for CUDA projects
CUDALIBS = # Project-specific libraries to link against for CUDA
# projects - these are incorporated into the final
# CUDALDFLAGS, below.
# Project outputs - these variables control
# what gets installed from a project. The
# values given below are the defaults -
# they may be customised/overridden in
# project Makefiles
HFILES = *.h
AFILES = *.a
SOFILES = *.so
XFILES =
SCRIPTS =
PYFILES = *.py
TCLFILES = *.tcl
TESTXILES =
# values given below are the defaults - they
# may be customised/overridden in project
# Makefiles.
HFILES = *.h # installed into $FSLDIR/include/$PROJNAME/
AFILES = *.a # installed into $FSLDIR/lib/
SOFILES = *.so # installed into $FSLDIR/lib/
XFILES = # installed into $FSLDIR/bin/
SCRIPTS = # installed into $FSLDIR/bin/
RUNTCLS = # link to Runtcl created in $FSLDIR/bin/ which assumes
# that <file>.tcl has been installed into
# $FSLDIR/tcl/
PYFILES = *.py # installed into $FSLDIR/etc/fsl/python/$PROJNAME/
TCLFILES = *.tcl # installed into $FSLDIR/tcl/
DATAFILES = # installed into $FSLDIR/data/$PROJNAME/
TESTXILES = # not currently used
# Final install destinations
# for project outputs
......@@ -52,22 +64,28 @@ INCFLAGS = ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR}
#############################
# Ignore flags provided by the environment
CFLAGS =
CXXFLAGS =
CPPFLAGS =
LDFLAGS =
CFLAGS =
CXXFLAGS =
CPPFLAGS =
CUDACXXFLAGS =
LDFLAGS =
CUDALDFLAGS =
# All projects must use these flags for
# compilation/linking, using the form:
#
# $(CXX) $(CXXFLAGS) <project flags/files> $(LDFLAGS)
# $(CC) $(CFLAGS) <project flags/files> $(LDFLAGS)
# $(CC) $(CFLAGS) <project flags/files> $(LDFLAGS)
# $(CXX) $(CXXFLAGS) <project flags/files> $(LDFLAGS)
# $(NVCC) $(CUDACXXFLAGS) <project flags/files> $(LDFLAGS) $(CUDALDFLAGS)
#
# LDFLAGS *must* come at the end, to ensure proper linking.
LDFLAGS += ${ARCHLDFLAGS} ${USRLDFLAGS} \
-L. -L${DEVLIBDIR} -L${LIBDIR} \
${LIBS} ${ARCHLIBS}
CFLAGS += ${ARCHCFLAGS} ${USRCFLAGS} ${INCFLAGS}
CXXFLAGS += ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${INCFLAGS}
CUDACXXFLAGS += ${INCFLAGS}
LDFLAGS += ${ARCHLDFLAGS} ${USRLDFLAGS} \
-L. -L${DEVLIBDIR} -L${LIBDIR} \
${LIBS} ${ARCHLIBS}
CUDALDFLAGS += ${ARCHCUDALDFLAGS} ${USRCUDALDFLAGS} \
-L. -L${DEVLIBDIR} -L${LIBDIR} \
${CUDALIBS}
CFLAGS += ${ARCHCFLAGS} ${USRCFLAGS} ${INCFLAGS}
CXXFLAGS += ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${INCFLAGS}
CUDACXXFLAGS += ${ARCHCUDACXXFLAGS} ${USRCUDACXXFLAGS} ${INCFLAGS}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment