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

MNT: Tweaks to cuda compile flags (more to come). Clean target removes FXFILES

and lib files. Ignore CPPFLAGS from the environment.
parent 9430cb9d
No related branches found
No related tags found
No related merge requests found
...@@ -84,29 +84,37 @@ endif # if Linux ...@@ -84,29 +84,37 @@ endif # if Linux
##################################################################### #####################################################################
# #
# Linux specific sys vars and ext libs # CUDA specific sys vars and ext libs
# #
##################################################################### #####################################################################
# CUDA library # CUDA/nvcc compiler options
ifneq ($(shell which nvcc), ) ifneq ($(shell which nvcc), )
# TODO Allow override, don't
# assume CUDADIR=FSLDIR
NVCC = nvcc NVCC = nvcc
CUDAVER = $(shell nvcc --version | grep -Po "release \K[0-9\.]+") CUDAVER = $(shell nvcc --version | grep -Po "release \K[0-9\.]+")
GENCODE_FLAGS = $(shell ${FSLDIR}/config/common/supportedGencodes.sh ${CUDAVER}) GENCODE_FLAGS = $(shell ${FSLDIR}/config/common/supportedGencodes.sh ${CUDAVER})
CUDADIR = ${FSLDIR} CUDADIR = ${FSLDIR}
CUDACXXFLAGS = -I${CUDADIR}/include \ # nvcc-specific tweaks:
${GENCODE_FLAGS} \ # - Define ARMA_ALLOW_FAKE_GCC, otherwise byte-alignment issues
--compiler-options \ # may occur with armadillo datatypes (see compiler_setup.hpp
"-fexpensive-optimizations -Wall -Wno-long-long -fPIC" \ # from the armadillo project)
-DARMA_ALLOW_FAKE_GCC # - Do not use -pedantic, otherwise *every single line* of
CUDALDFLAGS = -L${CUDADIR}/lib -lcuda -lcurand -lcudart # transpiled cuda code will trigger "warning: style of line
# directive is a GCC extension".
$(info "GPU enable") CUDACXXFLAGS = -I${CUDADIR}/include \
${GENCODE_FLAGS} \
-DARMA_ALLOW_FAKE_GCC \
--compiler-options \
"$(filter-out -pedantic, ${ARCHCXXFLAGS})"
CUDALDFLAGS = -lcurand -lcudart
ifeq ($(SYSTYPE), Darwin) ifeq ($(SYSTYPE), Darwin)
#Project specific variables # Project specific variables
EDDYBUILDPARAMETERS = "cuda=1 CUDAVER=7.5" "cpu=1" EDDYBUILDPARAMETERS = "cuda=1 CUDAVER=7.5" "cpu=1"
FDT_COMPILE_GPU = 0 FDT_COMPILE_GPU = 0
PTX2_COMPILE_GPU = 0 PTX2_COMPILE_GPU = 0
...@@ -120,8 +128,4 @@ ifneq ($(shell which nvcc), ) ...@@ -120,8 +128,4 @@ ifneq ($(shell which nvcc), )
FDT_COMPILE_GPU = 1 FDT_COMPILE_GPU = 1
PTX2_COMPILE_GPU = 1 PTX2_COMPILE_GPU = 1
endif # if Linux endif # if Linux
else
$(info "GPU disable")
FDT_COMPILE_GPU = 0
PTX2_COMPILE_GPU = 0
endif endif
...@@ -6,7 +6,8 @@ help: ...@@ -6,7 +6,8 @@ help:
@echo " make install Install into your local FSLDEVDIR"; @echo " make install Install into your local FSLDEVDIR";
clean: clean:
${RM} -f *.o *.a *.so *.exe depend.mk ${XFILES} ${TESTXFILES} ${RM} -f *.o *.a *.so *.exe depend.mk \
${XFILES} ${FXFILES} ${SOFILES} ${AFILES} ${TESTXFILES}
install: install:
@${MAKE} "DESTDIR=${FSLDEVDIR}" master-install-script @${MAKE} "DESTDIR=${FSLDEVDIR}" master-install-script
......
...@@ -54,6 +54,7 @@ INCFLAGS = ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR} ...@@ -54,6 +54,7 @@ INCFLAGS = ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR}
# Ignore flags provided by the environment # Ignore flags provided by the environment
CFLAGS = CFLAGS =
CXXFLAGS = CXXFLAGS =
CPPFLAGS =
LDFLAGS = LDFLAGS =
# All projects must use these flags for # All projects must use these flags for
...@@ -64,8 +65,9 @@ LDFLAGS = ...@@ -64,8 +65,9 @@ LDFLAGS =
# #
# LDFLAGS *must* come at the end, to ensure proper linking. # LDFLAGS *must* come at the end, to ensure proper linking.
LDFLAGS += ${ARCHLDFLAGS} ${USRLDFLAGS} \ LDFLAGS += ${ARCHLDFLAGS} ${USRLDFLAGS} \
-L. -L${DEVLIBDIR} -L${LIBDIR} \ -L. -L${DEVLIBDIR} -L${LIBDIR} \
${LIBS} ${ARCHLIBS} ${LIBS} ${ARCHLIBS}
CFLAGS += ${ARCHCFLAGS} ${USRCFLAGS} ${INCFLAGS} CFLAGS += ${ARCHCFLAGS} ${USRCFLAGS} ${INCFLAGS}
CXXFLAGS += ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${INCFLAGS} CXXFLAGS += ${ARCHCXXFLAGS} ${USRCXXFLAGS} ${INCFLAGS}
CUDACXXFLAGS += ${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