Add NAG Fortran compiler package

This commit is contained in:
Adam J. Stewart 2016-04-01 12:23:08 -05:00
parent 82ce798f41
commit 240c0643f2
2 changed files with 32 additions and 39 deletions

View File

@ -0,0 +1,26 @@
from spack import *
import os
class Nag(Package):
"""The NAG Fortran Compiler."""
homepage = "http://www.nag.com/nagware/np.asp"
version('6.1', '1e29d9d435b7ccc2842a320150b28ba4',
url='http://www.nag.com/downloads/impl/npl6a61na_amd64.tgz')
# Licensing
license_required = True
license_files = ['lib/nag.key',
'lib/nag.licence',
'lib/nagware.licence']
license_vars = ['NAG_KUSARI_FILE']
license_url = 'http://www.nag.com/doc/inun/np61/lin-mac/klicence.txt'
def install(self, spec, prefix):
# Set installation directories
os.environ['INSTALL_TO_BINDIR'] = prefix.bin
os.environ['INSTALL_TO_LIBDIR'] = prefix.lib
os.environ['INSTALL_TO_MANDIR'] = prefix + '/share/man/man'
# Run install script
os.system('./INSTALLU.sh')

View File

@ -1,6 +1,4 @@
from spack import *
import spack
import llnl.util.tty as tty
import os
class Pgi(Package):
@ -27,46 +25,18 @@ class Pgi(Package):
variant('java', default=False, description="Enable installation of Java Runtime Environment")
variant('mpi', default=False, description="Enable installation of Open MPI")
def set_up_license(self, prefix):
license_path = "%s/license.dat" % prefix
with open(license_path, "w") as license:
license.write("""\
# The PGI compilers require a license to use. There are two ways to set this up.
#
# 1. (Recommended) Store your license key in this license.dat file. Example:
#
# SERVER <hostname> 0123456789ab 27000
# DAEMON pgroupd
# PACKAGE PGI2015-<PGI_PIN> pgroupd <subscription end date> A13AB920D570 \\
# <...>
# 6167 7015 3F05 9C37 2315 ACDF 1B73 DAA9 FBAE"
#
# 2. Use the environment variable PGROUPD_LICENSE_FILE or LM_LICENSE_FILE.
#
# If you choose to store your license in a non-standard location, you may
# set either one of these variables to a full pathname to the license
# file, or port@host if you store your license keys on a dedicated
# license server. You will likely want to set this variable in a module
# file so that it gets loaded every time someone wants to use PGI.
#
# For further information on how to acquire a license, please refer to:
# http://www.pgroup.com/doc/pgiinstall.pdf
#
# You may enter your license below.
""")
#spack.editor(license_path)
tty.msg("Set up license file %s" % license_path)
# Licensing
license_required = True
license_files = ['license.dat']
license_vars = ['PGROUPD_LICENSE_FILE', 'LM_LICENSE_FILE']
license_url = 'http://www.pgroup.com/doc/pgiinstall.pdf'
def install(self, spec, prefix):
# Enable the silent installation feature
os.environ['PGI_SILENT'] = "true"
os.environ['PGI_ACCEPT_EULA'] = "accept"
os.environ['PGI_INSTALL_DIR'] = "%s" % prefix
os.environ['PGI_INSTALL_DIR'] = prefix
if '+network' in spec and '~single' in spec:
os.environ['PGI_INSTALL_TYPE'] = "network"
@ -92,6 +62,3 @@ def install(self, spec, prefix):
# Run install script
os.system("./install")
# Prompt user to set up license file
self.set_up_license(prefix)