Commit 54a76f31 authored by Luigi Calori's avatar Luigi Calori
Browse files

add several backported packages for openmpi and other dependencies

parent 52db0927
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Gdrcopy(MakefilePackage):
"""A fast GPU memory copy library based on NVIDIA GPUDirect
RDMA technology."""
homepage = "https://github.com/NVIDIA/gdrcopy"
url = "https://github.com/NVIDIA/gdrcopy/archive/2.1.tar.gz"
git = "https://github.com/NVIDIA/gdrcopy"
version('master', branch='master')
version('2.1', sha256='cecc7dcc071107f77396f5553c9109790b6d2298ae29eb2dbbdd52b2a213e4ea')
version('2.0', sha256='98320e6e980a7134ebc4eedd6cf23647104f2b3c557f2eaf0d31a02609f5f2b0')
version('1.3', sha256='f11cdfe389b685f6636b80b4a3312dc014a385ad7220179c1318c60e2e28af3a')
depends_on('binutils')
def url_for_version(self, version):
# if version >= Version('2.1'):
# return super(Gdrcopy, self).url_for_version(version)
url_fmt = "https://github.com/NVIDIA/gdrcopy/archive/v{0}.tar.gz"
return url_fmt.format(version)
def build(self, spec, prefix):
make('lib')
def install(self, spec, prefix):
mkdir(prefix.include)
mkdir(prefix.lib64)
make('lib_install', 'PREFIX={0}'.format(self.prefix))
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mxm(Package):
"""Mellanox Messaging Accelerator (MXM) provides enhancements to parallel
communication libraries by fully utilizing the underlying networking
infrastructure provided by Mellanox HCA/switch hardware."""
homepage = 'https://www.mellanox.com/products/mxm'
has_code = False
version('3.6.3104')
# MXM needs to be added as an external package to SPACK. For this, the
# config file packages.yaml needs to be adjusted:
#
# packages:
# mxm:
# buildable: False
# externals:
# - spec: mxm@3.6.3104
# prefix: /opt/mellanox/mxm (path to your MXM installation)
def install(self, spec, prefix):
raise InstallError(
self.spec.format('{name} is not installable, you need to specify '
'it as an external package in packages.yaml'))
%!PS-Adobe-2.0
%%Pages: (atend)
%%PageOrder: Ascend
%%Creator: NCAR GKS
%%CreationDate: Jan 22 2021 17:28:32
%%DocumentFonts: (atend)
%%EndComments
%%BeginProlog
/M3
{
2 copy lt {pop} {exch pop} ifelse
2 copy lt {pop} {exch pop} ifelse
} bind def
/Sc
{
1. exch sub /ylo exch def
1. exch sub /mag exch def
1. exch sub /cyn exch def
ylo mag cyn M3 /b_cmy exch def
cyn b_cmy sub /c_cmy exch def
mag b_cmy sub /m_cmy exch def
ylo b_cmy sub /y_cmy exch def
c_cmy m_cmy y_cmy b_cmy setcmykcolor
} bind def
/P
{/n exch def
newpath
moveto
2 1 n {pop lineto} for
stroke
} bind def
/F
{/n exch def
newpath
moveto
2 1 n {pop lineto} for
closepath
eofill
} bind def
/B
{ /s exch def
/n exch def
1 1 n {newpath pop s 0 360 arc stroke} for
} bind def
/Q
{ /s exch def
/n exch def
/ms 0 s sub def
/ts s s add def
1 1 n {gsave newpath pop translate
0 0 moveto ms 0 rmoveto ts 0 rlineto
0 0 moveto 90 rotate ms 0 rmoveto ts 0 rlineto
stroke grestore} for
} bind def
/Fs
{ /s exch def
findfont
s scalefont
setfont
} bind def
/V
{ /s exch def
/n exch def
/ms 0 s sub def
/ts s s add def
1 1 n {gsave newpath pop translate
0 0 moveto 30 rotate ms 0 rmoveto ts 0 rlineto
0 0 moveto 60 rotate ms 0 rmoveto ts 0 rlineto
0 0 moveto 60 rotate ms 0 rmoveto ts 0 rlineto
stroke grestore} for
} bind def
/X
{ /s exch def
/n exch def
/s s 1.25 mul def
/ms 0 s sub def
/ts s s add def
1 1 n {gsave newpath pop translate
0 0 moveto 45 rotate ms 0 rmoveto ts 0 rlineto
0 0 moveto 90 rotate ms 0 rmoveto ts 0 rlineto
stroke grestore} for
} bind def
/Ls
{matrix currentmatrix
currentrgbcolor
currentlinewidth
currentlinecap
currentlinejoin
currentdash
} bind def
/Lr
{setdash
setlinejoin
setlinecap
setlinewidth
setrgbcolor
setmatrix
} bind def
/M {stroke newpath moveto} bind def
/L {lineto} bind def
/E {eofill} def
/J {setlinejoin} def
/C {setlinecap} def
/W {setlinewidth} def
/S {stroke showpage} def
/A {scale} def
/U {put} def
/D {setdash} def
/I {currentdash} def
/H {currentlinewidth} def
/G {currentrgbcolor} def
/R {setrgbcolor} def
/N {closepath} def
/K {stroke} def
/Z {rotate} def
/As {ashow} def
/Ch {clippath} def
/Ci {colorimage} def
/Co {concat} def
/Cm {currentmatrix} def
/Cp {clip} def
/Ct {currentpoint} def
/Cu {currentfile} def
/Ex {exch} def
/Im {image} def
/In {initgraphics} def
/Ml {setmiterlimit} def
/Mx {matrix} def
/Np {newpath} def
/Ng {neg} def
/Rh {readhexstring} def
/Rm {rmoveto} def
/Sm {setmatrix} def
/Tr {translate} def
/Gs {gsave} def
/Gr {grestore} def
/Ov
{/strn exch def
/ispc exch def
/str1 1 string def
strn
{/code exch def
/chr str1 0 code put str1 def
0 ispc neg rmoveto
gsave
chr stringwidth pop 2 div neg
0 rmoveto
chr false charpath stroke
grestore
} forall
} bind def
/Oh
{/strn exch def
/ispc exch def
/tstr 1 string def
strn
{
/code exch def
/chr tstr 0 code put tstr def
chr false charpath
currentpoint
/yt exch def /xt exch def
stroke
xt ispc add yt moveto
} forall
} bind def
/T 256 array def
/O
{ T
exch
get
aload
pop
setrgbcolor
} bind def
/Y
{/strn exch def
/ispc exch def
/str1 1 string def
strn
{/code exch def
/chr str1 0 code put str1 def
0 ispc neg rmoveto
gsave
chr stringwidth pop 2 div neg 0 rmoveto
chr show
grestore
} forall
} def
/Bg
{/ury Ex def /urx Ex def /lly Ex def /llx Ex def
Np Ls Gr Gs 0 O Ch E Lr
llx lly M urx lly L urx ury L
llx ury L llx lly L
Cp Np
} def
/Oc
{/ury exch def
/urx exch def
/lly exch def
/llx exch def
Np
llx lly M urx lly L urx ury L llx ury L llx lly L
Cp Np
} def
/Cc
{/CellWidth exch def
/strn CellWidth 1 add string def
/strn1 CellWidth 1 add 3 mul string def
systemdict /colorimage known
{ { Cu strn1 Rh pop } false 3 Ci}
{ { Cu strn1 Rh pop
/ColorStr exch def
0 1 CellWidth {
/YIndx exch def
/GrayVal YIndx 3 mul def
strn YIndx
ColorStr GrayVal get 0.30 mul
ColorStr GrayVal 1 add get 0.59 mul
ColorStr GrayVal 2 add get 0.11 mul
add add cvi
put
} for
strn
} Im
} ifelse
} def
/Ld
{/ury exch def /urx exch def /lly exch def /llx exch def
-90 rotate
lly urx add neg llx lly sub translate
} bind def
/Pt
{/ury exch def /urx exch def /lly exch def /llx exch def
90 rotate
lly urx add lly llx sub translate
} bind def
%%EndProlog
%%BeginSetup
<</PageSize [00612 00792]>> setpagedevice
%%EndSetup
[1. 1. 1.] [0. 0. 0.] [1. 0. 0.] [0. 1. 0.] [0. 0. 1.] [0. 1. 1.] [1. 0. .8]
[1. 1. 0.] [1. .5 0.] [.6 .8 0.] [0. 1. .6] [0. .5 1.] [.5 0. .8] [1. 0. .6]
[.3 .3 .3] [.7 .7 .7] [1. 1. .3] [.7 1. .5] [.5 1. .6] [.2 1. .7] [.3 .8 .8]
[.5 .7 .8] [.7 .5 .8] [1. .3 .9] [.7 .9 .5] [.4 .9 .5] [.2 .9 .7] [.2 .7 .9]
[.2 .5 1.] [.5 .3 1.] [.7 .2 1.] [.9 .1 1.] [.9 1. .2] [.7 1. .3] [.5 1. .3]
[.2 1. .5] [.2 .8 .6] [.2 .7 .7] [.2 .5 .8] [.2 .4 .9] [.4 .3 .9] [.7 .2 .9]
[.8 .2 .8] [.9 .3 .7] [.8 .4 .6] [.8 .6 .5] [.9 .7 .4] [.9 .7 .3] [1. .9 .9]
[.8 1. .1] [.6 1. .2] [.5 1. .2] [.2 .9 .5] [.2 .8 .5] [.2 .7 .7] [.2 .5 .7]
[.2 .4 .9] [.4 .3 .9] [.5 .2 .9] [.8 .2 .7] [1. .2 .7] [1. .3 .6] [1. .4 .5]
[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1] [.1 .6 .1] [.1 .5 .2] [.1 .4 .2]
[.1 .4 .2] [.1 .3 .3] [.1 .2 .4] [.1 .2 .5] [.1 .1 .5] [.1 .0 .6] [.3 .0 .5]
[.5 .0 .4] [.7 .3 .0] [.7 .4 .0] [.5 .4 .1] [.3 .4 .2] [.2 .3 .2] [.2 .2 .3]
[.2 .2 .4] [.3 .1 .4] [.5 .1 .3] [.6 .1 .2] [.7 .1 .2] [.8 .0 .2] [1. .0 .2]
[1. .1 .1] [.9 .2 .1] [.8 .2 .1] [.6 .2 .0] [.4 .4 .0] [.2 .4 .1] [.2 .3 .2]
[.2 .2 .2] [.2 .2 .3] [.2 .1 .3] [.3 .1 .3] [.5 .1 .2] [.7 .1 .2] [.8 .0 .2]
[.9 .0 .1] [1. .0 .1] [1. .1 .1] [.8 .2 .0] [.7 .2 .0] [.5 .2 .0] [.4 .3 .0]
[.1 .4 .1] [.1 .4 .1] [.1 .3 .2] [.1 .2 .2] [.1 .2 .3] [.2 .1 .4] [.2 .0 .3]
[.4 .0 .2] [.6 .0 .2] [.7 .0 .1] [.8 .0 .1] [.7 .1 .1] [.7 .1 .1] [.6 .2 .0]
[.4 .2 .0] [.2 .3 .0] [.1 .3 .0] [.1 .2 .1] [.1 .2 .1] [.1 .1 .2] [.1 .1 .3]
[.1 .0 .3] [.1 .0 .2] [.2 .0 .2] [.3 .0 .2] [.3 .0 .1] [.4 .0 .1] [.4 .1 .1]
[.4 .1 .0] [.2 .1 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0]
[.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0]
[.0 .0 .0] [.0 .0 .0] [.0 .0 .0] [.0 .0 .0] T astore pop
%%Trailer
%%DocumentFonts:
%%Pages: 0
%%EOF
/cineca/prod/opt/tools/spack/0.14.2-prod/none/var/spack/repos/builtin/packages/ncl/hdf5.patch
\ No newline at end of file
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os
import tempfile
class Ncl(Package):
"""NCL is an interpreted language designed specifically for
scientific data analysis and visualization. Supports NetCDF 3/4,
GRIB 1/2, HDF 4/5, HDF-EOD 2/5, shapefile, ASCII, binary.
Numerous analysis functions are built-in."""
homepage = "https://www.ncl.ucar.edu"
url = "https://github.com/NCAR/ncl/archive/6.4.0.tar.gz"
version('6.6.2', sha256='cad4ee47fbb744269146e64298f9efa206bc03e7b86671e9729d8986bb4bc30e')
version('6.5.0', sha256='133446f3302eddf237db56bf349e1ebf228240a7320699acc339a3d7ee414591')
version('6.4.0', sha256='0962ae1a1d716b182b3b27069b4afe66bf436c64c312ddfcf5f34d4ec60153c8')
patch('spack_ncl.patch')
# Make ncl compile with hdf5 1.10 (upstream as of 6.5.0)
patch('hdf5.patch', when="@6.4.0")
# ymake-filter's buffer may overflow (upstream as of 6.5.0)
patch('ymake-filter.patch', when="@6.4.0")
# ymake additional local library and includes will be filtered improperly
patch('ymake.patch', when="@6.4.0:")
# This installation script is implemented according to this manual:
# http://www.ncl.ucar.edu/Download/build_from_src.shtml
variant('hdf4', default=False, description='Enable HDF4 support.')
variant('gdal', default=False, description='Enable GDAL support.')
variant('triangle', default=True, description='Enable Triangle support.')
variant('udunits2', default=True, description='Enable UDUNITS-2 support.')
variant('openmp', default=True, description='Enable OpenMP support.')
# Non-optional dependencies according to the manual:
depends_on('jpeg')
depends_on('netcdf-c')
depends_on('cairo+X+ft+pdf')
# Extra dependencies that may be missing from build system:
depends_on('bison', type='build')
depends_on('flex+lex')
depends_on('iconv')
depends_on('tcsh')
# Also, the manual says that ncl requires zlib, but that comes as a
# mandatory dependency of libpng, which is a mandatory dependency of cairo.
# The following dependencies are required, otherwise several components
# fail to compile:
depends_on('curl')
depends_on('iconv')
depends_on('libx11')
depends_on('libxaw')
depends_on('libxmu')
depends_on('pixman')
depends_on('bzip2')
depends_on('freetype')
depends_on('fontconfig')
# In Spack, we do not have an option to compile netcdf-c without netcdf-4
# support, so we will tell the ncl configuration script that we want
# support for netcdf-4, but the script assumes that hdf5 is compiled with
# szip support. We introduce this restriction with the following dependency
# statement.
depends_on('hdf5+szip')
depends_on('szip')
# ESMF is only required at runtime (for ESMF_regridding.ncl)
depends_on('esmf', type='run')
# In Spack, we also do not have an option to compile netcdf-c without DAP
# support, so we will tell the ncl configuration script that we have it.
# Some of the optional dependencies according to the manual:
depends_on('hdf', when='+hdf4')
depends_on('gdal+proj@:2.4', when='+gdal')
depends_on('udunits', when='+udunits2')
# We need src files of triangle to appear in ncl's src tree if we want
# triangle's features.
resource(
name='triangle',
url='http://www.netlib.org/voronoi/triangle.zip',
sha256='1766327add038495fa3499e9b7cc642179229750f7201b94f8e1b7bee76f8480',
placement='triangle_src',
when='+triangle')
sanity_check_is_file = ['bin/ncl']
def patch(self):
# Make configure scripts use Spack's tcsh
files = ['Configure'] + glob.glob('config/*')
filter_file('^#!/bin/csh -f', '#!/usr/bin/env csh', *files)
@run_before('install')
def filter_sbang(self):
# Filter sbang before install so Spack's sbang hook can fix it up
files = glob.glob('ncarg2d/src/bin/scripts/*')
files += glob.glob('ncarview/src/bin/scripts/*')
files += glob.glob('ni/src/scripts/*')
csh = join_path(self.spec['tcsh'].prefix.bin, 'csh')
filter_file('^#!/bin/csh', '#!{0}'.format(csh), *files)
def install(self, spec, prefix):
if (self.compiler.fc is None) or (self.compiler.cc is None):
raise InstallError('NCL package requires both '
'C and Fortran compilers.')
self.prepare_site_config()
self.prepare_install_config()
self.prepare_src_tree()
make('Everything', parallel=False)
def setup_run_environment(self, env):
env.set('NCARG_ROOT', self.spec.prefix)
def prepare_site_config(self):
fc_flags = []
cc_flags = []
c2f_flags = []
if '+openmp' in self.spec:
fc_flags.append(self.compiler.openmp_flag)
cc_flags.append(self.compiler.openmp_flag)
if self.compiler.name == 'gcc':
fc_flags.append('-fno-range-check')
c2f_flags.extend(['-lgfortran', '-lm'])
elif self.compiler.name == 'intel':
fc_flags.append('-fp-model precise')
cc_flags.append('-fp-model precise')
c2f_flags.extend(['-lifcore', '-lifport'])
with open('./config/Spack', 'w') as f:
f.writelines([
'#define HdfDefines\n',
'#define CppCommand \'/usr/bin/env cpp -traditional\'\n',
'#define CCompiler cc\n',
'#define FCompiler fc\n',
('#define CtoFLibraries ' + ' '.join(c2f_flags) + '\n'
if len(c2f_flags) > 0
else ''),
('#define CtoFLibrariesUser ' + ' '.join(c2f_flags) + '\n'
if len(c2f_flags) > 0
else ''),
('#define CcOptions ' + ' '.join(cc_flags) + '\n'
if len(cc_flags) > 0
else ''),
('#define FcOptions ' + ' '.join(fc_flags) + '\n'
if len(fc_flags) > 0
else ''),
'#define BuildShared NO'
])
def prepare_install_config(self):
# Remove the results of the previous configuration attempts.
self.delete_files('./Makefile', './config/Site.local')
# Generate an array of answers that will be passed to the interactive
# configuration script.
config_answers = [
# Enter Return to continue
'\n',
# Build NCL?
'y\n',
# Parent installation directory :
self.spec.prefix + '\n',
# System temp space directory :
tempfile.gettempdir() + '\n',
# Build NetCDF4 feature support (optional)?
'y\n'
]
if '+hdf4' in self.spec:
config_answers.extend([
# Build HDF4 support (optional) into NCL?
'y\n',
# Also build HDF4 support (optional) into raster library?
'y\n',
# Did you build HDF4 with szip support?
'y\n' if self.spec.satisfies('^hdf+szip') else 'n\n'
])
else:
config_answers.extend([
# Build HDF4 support (optional) into NCL?
'n\n',
# Also build HDF4 support (optional) into raster library?
'n\n'
])
config_answers.extend([
# Build Triangle support (optional) into NCL
'y\n' if '+triangle' in self.spec else 'n\n',
# If you are using NetCDF V4.x, did you enable NetCDF-4 support?
'y\n',
# Did you build NetCDF with OPeNDAP support?
'y\n',
# Build GDAL support (optional) into NCL?
'y\n' if '+gdal' in self.spec else 'n\n',
# Build EEMD support (optional) into NCL?