From 8f99334f11edd4b56f3e9bc88d2f8666cf0a37a1 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Wed, 25 May 2016 16:06:14 -0700 Subject: Fixed test config to work on yosemite --- lib/spack/spack/architecture.py | 38 +++++++++++++++--------------- lib/spack/spack/test/mock_packages_test.py | 24 ++++++++++++++++++- 2 files changed, 42 insertions(+), 20 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index e9dd489e54..5d16a2f5f5 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -22,26 +22,26 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -""" -This module contains all the elements that are required to create an -architecture object. These include, the target processor, the operating system, -and the architecture platform (i.e. cray, darwin, linux, bgq, etc) classes. +""" +This module contains all the elements that are required to create an +architecture object. These include, the target processor, the operating system, +and the architecture platform (i.e. cray, darwin, linux, bgq, etc) classes. -On a multiple architecture machine, the architecture spec field can be set to -build a package against any target and operating system that is present on the +On a multiple architecture machine, the architecture spec field can be set to +build a package against any target and operating system that is present on the platform. On Cray platforms or any other architecture that has different front and back end environments, the operating system will determine the method of compiler -detection. +detection. -There are two different types of compiler detection: +There are two different types of compiler detection: 1. Through the $PATH env variable (front-end detection) 2. Through the tcl module system. (back-end detection) Depending on which operating system is specified, the compiler will be detected -using one of those methods. +using one of those methods. For platforms such as linux and darwin, the operating system is autodetected and -the target is set to be x86_64. +the target is set to be x86_64. The command line syntax for specifying an architecture is as follows: @@ -52,27 +52,27 @@ the command line and Spack will concretize using the default. These defaults are set in the 'platforms/' directory which contains the different subclasses for platforms. If the machine has multiple architectures, the user can also enter front-end, or fe or back-end or be. These settings will concretize -to their respective front-end and back-end targets and operating systems. +to their respective front-end and back-end targets and operating systems. Additional platforms can be added by creating a subclass of Platform -and adding it inside the platform directory. +and adding it inside the platform directory. Platforms are an abstract class that are extended by subclasses. If the user wants to add a new type of platform (such as cray_xe), they can create a subclass -and set all the class attributes such as priority, front_target ,back_target, +and set all the class attributes such as priority, front_target ,back_target, front_os, back_os. Platforms also contain a priority class attribute. A lower number signifies higher priority. These numbers are arbitrarily set and can be changed though often there isn't much need unless a new platform is added and -the user wants that to be detected first. +the user wants that to be detected first. Targets are created inside the platform subclasses. Most architecture (like linux, and darwin) will have only one target (x86_64) but in the case of Cray machines, there is both a frontend and backend processor. The user can specify which targets are present on front-end and back-end architecture -Depending on the platform, operating systems are either auto-detected or are +Depending on the platform, operating systems are either auto-detected or are set. The user can set the front-end and back-end operating setting by the class attributes front_os and back_os. The operating system as described earlier, will -be responsible for compiler detection. +be responsible for compiler detection. """ import os from collections import namedtuple @@ -216,7 +216,7 @@ class Platform(object): return self.operating_sys.get(name, None) - + @classmethod def detect(self): """ Subclass is responsible for implementing this method. @@ -235,7 +235,7 @@ class Platform(object): def _cmp_key(self): t_keys = ''.join(str(t._cmp_key()) for t in sorted(self.targets.values())) o_keys = ''.join(str(o._cmp_key()) for o in sorted(self.operating_sys.values())) - return (self.name, + return (self.name, self.default, self.front_end, self.back_end, @@ -385,7 +385,7 @@ class Arch(object): def __str__(self): if self.platform or self.platform_os or self.target: if self.platform.name == 'darwin': - os_name = self.platform_os.name + os_name = self.platform_os.name if self.platform_os else "None" else: os_name = str(self.platform_os) diff --git a/lib/spack/spack/test/mock_packages_test.py b/lib/spack/spack/test/mock_packages_test.py index 79dbdb89a6..0cdf01f1b9 100644 --- a/lib/spack/spack/test/mock_packages_test.py +++ b/lib/spack/spack/test/mock_packages_test.py @@ -69,6 +69,17 @@ compilers: f77: None fc: None modules: 'None' + clang3.3OSX: + spec: clang@3.3 + operating_system: + name: yosemite + version: '10.10' + paths: + cc: /path/to/clang + cxx: /path/to/clang++ + f77: None + fc: None + modules: 'None' gcc4.5.0CNL: paths: cc: /path/to/gcc @@ -98,10 +109,21 @@ compilers: f77: /path/to/gfortran fc: /path/to/gfortran operating_system: - name: RHL + name: redhat version: '6.7' spec: gcc@4.5.0 modules: 'None' + gcc4.5.0OSX: + paths: + cc: /path/to/gcc + cxx: /path/to/g++ + f77: /path/to/gfortran + fc: /path/to/gfortran + operating_system: + name: yosemite + version: '10.10' + spec: gcc@4.5.0 + modules: 'None' """ mock_packages_config = """\ -- cgit v1.2.3-70-g09d2