/[gentoo-x86]/eclass/cuda.eclass
Gentoo

Diff of /eclass/cuda.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.3
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cuda.eclass,v 1.2 2013/06/22 12:37:28 jlec Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cuda.eclass,v 1.3 2013/08/11 16:20:23 jlec Exp $
4 4
5inherit toolchain-funcs versionator 5inherit flag-o-matic toolchain-funcs versionator
6 6
7# @ECLASS: cuda.eclass 7# @ECLASS: cuda.eclass
8# @MAINTAINER: 8# @MAINTAINER:
9# Justin Lecher <jlec@gentoo.org> 9# Justin Lecher <jlec@gentoo.org>
10# @BLURB: Common functions for cuda packages 10# @BLURB: Common functions for cuda packages
94# @FUNCTION: cuda_sanitize 94# @FUNCTION: cuda_sanitize
95# @DESCRIPTION: 95# @DESCRIPTION:
96# Correct NVCCFLAGS by adding the necessary reference to gcc bindir and 96# Correct NVCCFLAGS by adding the necessary reference to gcc bindir and
97# passing CXXFLAGS to underlying compiler without disturbing nvcc. 97# passing CXXFLAGS to underlying compiler without disturbing nvcc.
98cuda_sanitize() { 98cuda_sanitize() {
99 local rawldflags=$(raw-ldflags)
99 # Be verbose if wanted 100 # Be verbose if wanted
100 [[ "${CUDA_VERBOSE}" == true ]] && NVCCFLAGS+=" -v" 101 [[ "${CUDA_VERBOSE}" == true ]] && NVCCFLAGS+=" -v"
101 102
102 # Tell nvcc where to find a compatible compiler 103 # Tell nvcc where to find a compatible compiler
104 if has_version \<=dev-util/nvidia-cuda-toolkit-5.5; then
103 NVCCFLAGS+=" $(cuda_gccdir -f)" 105 NVCCFLAGS+=" $(cuda_gccdir -f)"
106 fi
104 107
105 # Tell nvcc which flags should be used for underlying C compiler 108 # Tell nvcc which flags should be used for underlying C compiler
106 NVCCFLAGS+=" --compiler-options=\"${CXXFLAGS}\"" 109 NVCCFLAGS+=" --compiler-options=\"${CXXFLAGS}\" --linker-options=\"${rawldflags// /,}\""
107 110
108 debug-print "Using ${NVCCFLAGS} for cuda" 111 debug-print "Using ${NVCCFLAGS} for cuda"
109 export NVCCFLAGS 112 export NVCCFLAGS
110} 113}
111 114

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20