Fixed test config to work on yosemite

This commit is contained in:
Gregory Becker 2016-05-25 16:06:14 -07:00
parent 0f40174723
commit 8f99334f11
2 changed files with 42 additions and 20 deletions

View File

@ -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 @@
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 @@ def operating_system(self, name):
return self.operating_sys.get(name, None)
@classmethod
def detect(self):
""" Subclass is responsible for implementing this method.
@ -235,7 +235,7 @@ def __str__(self):
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 @@ def concrete(self):
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)

View File

@ -69,6 +69,17 @@
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 @@
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 = """\