]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/tracking-ca/cagpu/CMakelibAliHLTTPCCAGPU.pkg
removing pre-package cxxflags
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / cagpu / CMakelibAliHLTTPCCAGPU.pkg
CommitLineData
c6ac942a 1# -*- mode: CMake -*-
2# $Id$
3#--------------------------------------------------------------------------------#
4# Package File for AliHLTTPCCAGPU #
5# Author : Johny Jose (johny.jose@cern.ch) #
6# Variables Defined : #
7# #
8# SRCS - C++ source files #
9# HDRS - C++ header files #
10# DHDR - ROOT Dictionary Linkdef header file #
11# CSRCS - C source files #
12# CHDRS - C header files #
13# EINCLUDE - Include directories #
14# EDEFINE - Compiler definitions #
15# ELIBS - Extra libraries to link #
16# ELIBSDIR - Extra library directories #
17# PACKFFLAGS - Fortran compiler flags for package #
18# PACKCXXFLAGS - C++ compiler flags for package #
19# PACKCFLAGS - C compiler flags for package #
20# PACKSOFLAGS - Shared library linking flags #
21# PACKLDFLAGS - Module linker flags #
22# PACKBLIBS - Libraries to link (Executables only) #
23# EXPORT - Header files to be exported #
24# CINTHDRS - Dictionary header files #
25# CINTAUTOLINK - Set automatic dictionary generation #
26# ARLIBS - Archive Libraries and objects for linking (Executables only) #
27# SHLIBS - Shared Libraries and objects for linking (Executables only) #
28#--------------------------------------------------------------------------------#
29
30find_package ( CUDA )
31if ( NOT CUDA_FOUND )
32 #fail if CUDA wasn't found
33 message ( FATAL_ERROR "NVIDIA CUDA package not found. Please install or set HLT_CUDA=OFF" )
34endif ( NOT CUDA_FOUND )
35
36#set nvcc flags
37set ( CUDA_NVCC_FLAGS --use_fast_math --maxrregcount 64 -O4 -Xptxas -O4 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 )
38#for convenience
39set ( CAGPUDIR TPCLib/tracking-ca/cagpu )
40#add include path
41include_directories( ${CAGPUDIR} )
42#nvcc fails with std=c++11, remove it temporarily
43string ( FIND ${CMAKE_CXX_FLAGS} "-std=c++11" STDCXX11FOUND )
44if ( STDCXX11FOUND GREATER -1 )
45 string ( REPLACE "-std=c++11" "-std=c++98" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
46endif ( )
47#compile CUDA object file
48cuda_compile ( CAGPU_O ${CAGPUDIR}/AliHLTTPCCAGPUTrackerNVCC.cu )
49#set it back
50if ( STDCXX11FOUND GREATER -1 )
51 string ( REPLACE "-std=c++98" "-std=c++11" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
52endif ( )
53#end of CUDA specific stuff; from here on build usual library
54
55set ( CLASS_HDRS
56 AliHLTTPCCAGPUTrackerBase.h
57 AliHLTTPCCAGPUTrackerNVCC.h
58)
59
60set ( MODULE_SRCS
61 AliHLTTPCCAGPUTrackerBase.cxx
62)
63
64set ( MODULE_HDRS
65 ${CLASS_HDRS}
66 AliHLTTPCCAGPUTrackerCommon.h
67)
68
69set ( MODULE_DHDR )
70
71set ( EINCLUDE HLT/${CAGPUDIR} HLT/TPCLib/tracking-ca HLT/BASE )
72
73#CUDA run-time and driver
74set ( ELIBS ${CUDA_LIBRARIES} -lcuda )
75
76include ("CMakehlt.conf")
77
78if (MODULE_SRCS)
79ALICE_Format (SRCS "${CAGPUDIR}/" "" "${MODULE_SRCS}")
80endif(MODULE_SRCS)
81if (CLASS_HDRS)
82ALICE_Format (CINTHDRS "${CAGPUDIR}/" "" "${CLASS_HDRS}")
83endif(CLASS_HDRS)
84if (MODULE_HDRS)
85ALICE_Format (HDRS "${CAGPUDIR}/" "" "${MODULE_HDRS}")
86endif(MODULE_HDRS)
87if (MODULE_DHDR)
88ALICE_Format (DHDR "${CAGPUDIR}/" "" "${MODULE_DHDR}")
89endif(MODULE_DHDR)
90
91#add CUDA object file(s) as library (link) dependency
92list(APPEND SRCS ${CAGPU_O})
93
94# bit of a hack, but otherwise dictionary compilation fails:
95# defines cudaError_t to make it known
96# defines __ROOT__; triggers "ifdef" in source code to circumvent broken cint behaviour with "volatile" keyword
97# not sure why __ROOT__ is used here, could just as well be something else
98set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/G__AliHLTTPCCAGPU.cxx PROPERTIES COMPILE_DEFINITIONS "cudaError_t=int;__ROOT__")
99
100if(NOT DHDR)
101 set(CINTAUTOLINK 1)
102endif(NOT DHDR)
103
104set ( EDEFINE ${HLTDEFS} )
e31f5817 105#set ( PACKCXXFLAGS "${HLTCXXFLAGS} -Wshadow -Wall -O3")
c6ac942a 106set ( PACKCFLAGS ${HLTCLFAGS})
107set ( PACKDCXXFLAGS ${HLTDCXXFLAGS})
108set ( PACKSOFLAGS ${HLTSOFLAGS})
109#set ( CINTFLAGS )