caliper: Update caliper package (#4532)
* caliper: Update caliper package * caliper: Explicitly enable/disable cmake options for all variants * caliper: Fix flake8 warnings * caliper: Modify defaults for Mac * caliper: Fix some more flake8 warnings
This commit is contained in:
		 David Böhme
					David Böhme
				
			
				
					committed by
					
						 Adam J. Stewart
						Adam J. Stewart
					
				
			
			
				
	
			
			
			 Adam J. Stewart
						Adam J. Stewart
					
				
			
						parent
						
							75b8d728bd
						
					
				
				
					commit
					e27ccac4a5
				
			| @@ -24,11 +24,15 @@ | ||||
| ############################################################################## | ||||
| from spack import * | ||||
|  | ||||
| import sys | ||||
|  | ||||
| class Caliper(Package): | ||||
|     """Caliper is a generic context annotation system. It gives programmers the | ||||
|     ability to provide arbitrary program context information to (performance) | ||||
|     tools at runtime. | ||||
|  | ||||
| class Caliper(CMakePackage): | ||||
|     """Caliper is a program instrumentation and performance measurement | ||||
|     framework. It provides data collection mechanisms and a source-code | ||||
|     annotation API for a variety of performance engineering use cases, | ||||
|     e.g., performance profiling, tracing, monitoring, and | ||||
|     auto-tuning. | ||||
|     """ | ||||
|  | ||||
|     homepage = "https://github.com/LLNL/Caliper" | ||||
| @@ -36,15 +40,47 @@ class Caliper(Package): | ||||
|  | ||||
|     version('master', git='https://github.com/LLNL/Caliper.git') | ||||
|  | ||||
|     variant('mpi', default=True, description='Enable MPI function wrappers.') | ||||
|     variant('mpi', default=True,  | ||||
|             description='Enable MPI wrappers') | ||||
|     variant('dyninst', default=False,  | ||||
|             description='Enable symbol translation support with dyninst') | ||||
|     # libunwind has some issues on Mac | ||||
|     variant('callpath', default=sys.platform != 'darwin', | ||||
|             description='Enable callpath service (requires libunwind)') | ||||
|     # pthread_self() signature is incompatible with PAPI_thread_init() on Mac | ||||
|     variant('papi', default=sys.platform != 'darwin', | ||||
|             description='Enable PAPI service') | ||||
|     # gotcha doesn't work on Mac | ||||
|     variant('gotcha', default=sys.platform != 'darwin', | ||||
|             description='Enable GOTCHA support') | ||||
|  | ||||
|     depends_on('libunwind') | ||||
|     depends_on('papi') | ||||
|     depends_on('dyninst', when='+dyninst') | ||||
|     depends_on('papi', when='+papi') | ||||
|     depends_on('mpi', when='+mpi') | ||||
|     depends_on('cmake', type='build') | ||||
|     depends_on('libunwind', when='+callpath') | ||||
|  | ||||
|     def install(self, spec, prefix): | ||||
|         with working_dir('build', create=True): | ||||
|             cmake('..', *std_cmake_args) | ||||
|             make() | ||||
|             make("install") | ||||
|     depends_on('cmake', type='build') | ||||
|     depends_on('python', type='build') | ||||
|  | ||||
|     def cmake_args(self): | ||||
|         spec = self.spec | ||||
|  | ||||
|         args = [ | ||||
|             '-DBUILD_TESTING=Off', | ||||
|             '-DWITH_DOCS=Off', | ||||
|             '-DWITH_TEST_APPS=Off', | ||||
|             '-DWITH_DYNINST=%s'  % ('On' if '+dyninst'  in spec else 'Off'), | ||||
|             '-DWITH_CALLPATH=%s' % ('On' if '+callpath' in spec else 'Off'), | ||||
|             '-DWITH_GOTCHA=%s'   % ('On' if '+gotcha'   in spec else 'Off'), | ||||
|             '-DWITH_PAPI=%s'     % ('On' if '+papi'     in spec else 'Off'), | ||||
|             '-DWITH_MPI=%s'      % ('On' if '+mpi'      in spec else 'Off') | ||||
|         ] | ||||
|  | ||||
|         if '+papi' in spec: | ||||
|             args.append('-DPAPI_PREFIX=%s' % spec['papi'].prefix) | ||||
|  | ||||
|         if '+mpi' in spec: | ||||
|             args.append('-DMPI_C_COMPILER=%s' % spec['mpi'].mpicc) | ||||
|             args.append('-DMPI_CXX_COMPILER=%s' % spec['mpi'].mpicxx) | ||||
|  | ||||
|         return args | ||||
|   | ||||
		Reference in New Issue
	
	Block a user