Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
d2004a18
Commit
d2004a18
authored
May 10, 2016
by
Todd Gamblin
Browse files
Options
Downloads
Plain Diff
Merge pull request #825 from xjrc/packages/scotch
Update Package : Scotch
parents
69f6baf2
ceab445b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
var/spack/repos/builtin/packages/scotch/Makefile.esmumps
+5
-0
5 additions, 0 deletions
var/spack/repos/builtin/packages/scotch/Makefile.esmumps
var/spack/repos/builtin/packages/scotch/package.py
+94
-58
94 additions, 58 deletions
var/spack/repos/builtin/packages/scotch/package.py
with
99 additions
and
58 deletions
var/spack/repos/builtin/packages/scotch/Makefile.esmumps
0 → 100644
+
5
−
0
View file @
d2004a18
esmumps
:
scotch
(
cd
esmumps
;
$(
MAKE
)
scotch
&&
$(
MAKE
)
install
)
ptesmumps
:
ptscotch
(
cd
esmumps
;
$(
MAKE
)
ptscotch
&&
$(
MAKE
)
ptinstall
)
This diff is collapsed.
Click to expand it.
var/spack/repos/builtin/packages/scotch/package.py
+
94
−
58
View file @
d2004a18
from
spack
import
*
from
spack
import
*
import
os
import
os
,
re
class
Scotch
(
Package
):
class
Scotch
(
Package
):
"""
Scotch is a software package for graph and mesh/hypergraph
"""
Scotch is a software package for graph and mesh/hypergraph
partitioning, graph clustering, and sparse matrix ordering.
"""
partitioning, graph clustering, and sparse matrix ordering.
"""
homepage
=
"
http://www.labri.fr/perso/pelegrin/scotch/
"
homepage
=
"
http://www.labri.fr/perso/pelegrin/scotch/
"
url
=
"
http://gforge.inria.fr/frs/download.php/file/34099/scotch_6.0.3.tar.gz
"
url
=
"
http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.3.tar.gz
"
base_url
=
"
http://gforge.inria.fr/frs/download.php/latestfile/298
"
list_url
=
"
http://gforge.inria.fr/frs/?group_id=248
"
list_url
=
"
http://gforge.inria.fr/frs/?group_id=248
"
version
(
'
6.0.3
'
,
'
10b0cc0f184de2de99859eafaca83cfc
'
)
version
(
'
6.0.3
'
,
'
10b0cc0f184de2de99859eafaca83cfc
'
)
version
(
'
6.0.0
'
,
'
c50d6187462ba801f9a82133ee666e8e
'
)
version
(
'
5.1.10b
'
,
'
f587201d6cf5cf63527182fbfba70753
'
)
variant
(
'
mpi
'
,
default
=
False
,
description
=
'
Activate the compilation of PT-Scotch
'
)
variant
(
'
mpi
'
,
default
=
False
,
description
=
'
Activate the compilation of PT-Scotch
'
)
variant
(
'
compression
'
,
default
=
True
,
description
=
'
Activate the posibility to use compressed files
'
)
variant
(
'
compression
'
,
default
=
True
,
description
=
'
Activate the posibility to use compressed files
'
)
variant
(
'
esmumps
'
,
default
=
False
,
description
=
'
Activate the compilation of the lib esmumps needed by mumps
'
)
variant
(
'
esmumps
'
,
default
=
False
,
description
=
'
Activate the compilation of the lib esmumps needed by mumps
'
)
variant
(
'
shared
'
,
default
=
True
,
description
=
'
Build shared libraries
'
)
variant
(
'
shared
'
,
default
=
True
,
description
=
'
Build shared libraries
'
)
depends_on
(
'
mpi
'
,
when
=
'
+mpi
'
)
depends_on
(
'
zlib
'
,
when
=
'
+compression
'
)
depends_on
(
'
flex
'
)
depends_on
(
'
flex
'
)
depends_on
(
'
bison
'
)
depends_on
(
'
bison
'
)
depends_on
(
'
mpi
'
,
when
=
'
+mpi
'
)
depends_on
(
'
zlib
'
,
when
=
'
+compression
'
)
def
compiler_specifics
(
self
,
makefile_inc
,
defines
):
# NOTE: Versions of Scotch up to version 6.0.0 don't include support for
if
self
.
compiler
.
name
==
'
gcc
'
:
# building with 'esmumps' in their default packages. In order to enable
defines
.
append
(
'
-Drestrict=__restrict
'
)
# support for this feature, we must grab the 'esmumps' enabled archives
elif
self
.
compiler
.
name
==
'
intel
'
:
# from the Scotch hosting site. These alternative archives include a strict
defines
.
append
(
'
-restrict
'
)
# superset of the behavior in their default counterparts, so we choose to
# always grab these versions for older Scotch versions for simplicity.
@when
(
'
@:6.0.0
'
)
def
url_for_version
(
self
,
version
):
return
'
%s/scotch_%s_esmumps.tar.gz
'
%
(
Scotch
.
base_url
,
version
)
@when
(
'
@6.0.1:
'
)
def
url_for_version
(
self
,
version
):
return
super
(
Scotch
,
self
).
url_for_version
(
version
)
# NOTE: Several of the 'esmumps' enabled Scotch releases up to version 6.0.0
# have broken build scripts that don't properly build 'esmumps' as a separate
# target, so we need a patch procedure to remove 'esmumps' from existing targets
# and to add it as a standalone target.
@when
(
'
@:6.0.0
'
)
def
patch
(
self
):
makefile_path
=
os
.
path
.
join
(
'
src
'
,
'
Makefile
'
)
with
open
(
makefile_path
,
'
r
'
)
as
makefile
:
esmumps_enabled
=
any
(
re
.
search
(
r
'
^esmumps(\s*):(.*)$
'
,
line
)
for
line
in
makefile
.
readlines
())
makefile_inc
.
append
(
'
CCS = $(CC)
'
)
if
not
esmumps_enabled
:
mff
=
FileFilter
(
makefile_path
)
mff
.
filter
(
r
'
^.*((esmumps)|(ptesmumps)).*(install).*$
'
,
''
)
if
'
+mpi
'
in
self
.
spec
:
makefile_esmumps_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'
Makefile.esmumps
'
)
makefile_inc
.
extend
([
with
open
(
makefile_path
,
'
a
'
)
as
makefile
:
'
CCP = %s
'
%
os
.
path
.
join
(
self
.
spec
[
'
mpi
'
].
prefix
.
bin
,
'
mpicc
'
),
makefile
.
write
(
'
\n
include %s
\n
'
%
makefile_esmumps_path
)
'
CCD = $(CCP)
'
])
else
:
makefile_inc
.
extend
([
'
CCP = mpicc
'
,
# It is set but not used
'
CCD = $(CCS)
'
])
@when
(
'
@6.0.1:
'
)
def
patch
(
self
):
pass
# NOTE: Configuration of Scotch is achieved by writing a 'Makefile.inc' file
# that contains all of the configuration variables and their desired values
# for the installation. This function writes this file based on the given
# installation variants.
def
configure
(
self
):
makefile_inc
=
[]
cflags
=
[
'
-O3
'
,
'
-DCOMMON_RANDOM_FIXED_SEED
'
,
'
-DSCOTCH_DETERMINISTIC
'
,
'
-DSCOTCH_RENAME
'
,
'
-DIDXSIZE64
'
]
def
library_build_type
(
self
,
makefile_inc
,
defines
):
## Library Build Type ##
makefile_inc
.
extend
([
'
LIB = .a
'
,
'
CLIBFLAGS =
'
,
'
RANLIB = ranlib
'
,
'
AR = ar
'
,
'
ARFLAGS = -ruv
'
])
@when
(
'
+shared
'
)
if
'
+shared
'
in
self
.
spec
:
def
library_build_type
(
self
,
makefile_inc
,
defines
):
makefile_inc
.
extend
([
makefile_inc
.
extend
([
'
LIB = .so
'
,
'
LIB = .so
'
,
'
CLIBFLAGS = -shared -fPIC
'
,
'
CLIBFLAGS = -shared -fPIC
'
,
...
@@ -59,30 +84,42 @@ def library_build_type(self, makefile_inc, defines):
...
@@ -59,30 +84,42 @@ def library_build_type(self, makefile_inc, defines):
'
AR = $(CC)
'
,
'
AR = $(CC)
'
,
'
ARFLAGS = -shared $(LDFLAGS) -o
'
'
ARFLAGS = -shared $(LDFLAGS) -o
'
])
])
cflags
.
append
(
'
-fPIC
'
)
else
:
makefile_inc
.
extend
([
'
LIB = .a
'
,
'
CLIBFLAGS =
'
,
'
RANLIB = ranlib
'
,
'
AR = ar
'
,
'
ARFLAGS = -ruv
'
])
## Compiler-Specific Options ##
if
self
.
compiler
.
name
==
'
gcc
'
:
cflags
.
append
(
'
-Drestrict=__restrict
'
)
elif
self
.
compiler
.
name
==
'
intel
'
:
cflags
.
append
(
'
-restrict
'
)
makefile_inc
.
append
(
'
CCS = $(CC)
'
)
makefile_inc
.
append
(
'
CCP = %s
'
%
(
self
.
spec
[
'
mpi
'
].
mpicc
if
'
+mpi
'
in
self
.
spec
else
'
mpicc
'
))
makefile_inc
.
append
(
'
CCD = $(CCS)
'
)
## Extra Features ##
def
extra_features
(
self
,
makefile_inc
,
defines
):
ldflags
=
[]
ldflags
=
[]
if
'
+compression
'
in
self
.
spec
:
if
'
+compression
'
in
self
.
spec
:
define
s
.
append
(
'
-DCOMMON_FILE_COMPRESS_GZ
'
)
cflag
s
.
append
(
'
-DCOMMON_FILE_COMPRESS_GZ
'
)
ldflags
.
append
(
'
-L%s -lz
'
%
(
self
.
spec
[
'
zlib
'
].
prefix
.
lib
))
ldflags
.
append
(
'
-L%s -lz
'
%
(
self
.
spec
[
'
zlib
'
].
prefix
.
lib
))
define
s
.
append
(
'
-DCOMMON_PTHREAD
'
)
cflag
s
.
append
(
'
-DCOMMON_PTHREAD
'
)
ldflags
.
append
(
'
-lm -lrt -pthread
'
)
ldflags
.
append
(
'
-lm -lrt -pthread
'
)
makefile_inc
.
append
(
'
LDFLAGS = %s
'
%
'
'
.
join
(
ldflags
))
makefile_inc
.
append
(
'
LDFLAGS = %s
'
%
'
'
.
join
(
ldflags
))
def
patch
(
self
):
## General Features ##
makefile_inc
=
[]
defines
=
[
'
-DCOMMON_RANDOM_FIXED_SEED
'
,
'
-DSCOTCH_DETERMINISTIC
'
,
'
-DSCOTCH_RENAME
'
,
'
-DIDXSIZE64
'
]
self
.
library_build_type
(
makefile_inc
,
defines
)
self
.
compiler_specifics
(
makefile_inc
,
defines
)
self
.
extra_features
(
makefile_inc
,
defines
)
makefile_inc
.
extend
([
makefile_inc
.
extend
([
'
EXE =
'
,
'
EXE =
'
,
...
@@ -93,11 +130,10 @@ def patch(self):
...
@@ -93,11 +130,10 @@ def patch(self):
'
MKDIR = mkdir
'
,
'
MKDIR = mkdir
'
,
'
MV = mv
'
,
'
MV = mv
'
,
'
CP = cp
'
,
'
CP = cp
'
,
'
CFLAGS =
-O3
%s
'
%
(
'
'
.
join
(
defines
)
),
'
CFLAGS = %s
'
%
'
'
.
join
(
cflags
),
'
LEX = %s -Pscotchyy -olex.yy.c
'
%
os
.
path
.
join
(
self
.
spec
[
'
flex
'
].
prefix
.
bin
,
'
flex
'
),
'
LEX = %s -Pscotchyy -olex.yy.c
'
%
os
.
path
.
join
(
self
.
spec
[
'
flex
'
].
prefix
.
bin
,
'
flex
'
),
'
YACC = %s -pscotchyy -y -b y
'
%
os
.
path
.
join
(
self
.
spec
[
'
bison
'
].
prefix
.
bin
,
'
bison
'
),
'
YACC = %s -pscotchyy -y -b y
'
%
os
.
path
.
join
(
self
.
spec
[
'
bison
'
].
prefix
.
bin
,
'
bison
'
),
'
prefix = %s
'
%
self
.
prefix
,
'
prefix = %s
'
%
self
.
prefix
''
])
])
with
working_dir
(
'
src
'
):
with
working_dir
(
'
src
'
):
...
@@ -105,6 +141,8 @@ def patch(self):
...
@@ -105,6 +141,8 @@ def patch(self):
fh
.
write
(
'
\n
'
.
join
(
makefile_inc
))
fh
.
write
(
'
\n
'
.
join
(
makefile_inc
))
def
install
(
self
,
spec
,
prefix
):
def
install
(
self
,
spec
,
prefix
):
self
.
configure
()
targets
=
[
'
scotch
'
]
targets
=
[
'
scotch
'
]
if
'
+mpi
'
in
self
.
spec
:
if
'
+mpi
'
in
self
.
spec
:
targets
.
append
(
'
ptscotch
'
)
targets
.
append
(
'
ptscotch
'
)
...
@@ -115,12 +153,10 @@ def install(self, spec, prefix):
...
@@ -115,12 +153,10 @@ def install(self, spec, prefix):
targets
.
append
(
'
ptesmumps
'
)
targets
.
append
(
'
ptesmumps
'
)
with
working_dir
(
'
src
'
):
with
working_dir
(
'
src
'
):
for
app
in
targets
:
for
target
in
targets
:
make
(
app
,
parallel
=
(
not
app
==
'
ptesmumps
'
))
make
(
target
,
parallel
=
(
target
!=
'
ptesmumps
'
))
install_tree
(
'
bin
'
,
prefix
.
bin
)
install_tree
(
'
bin
'
,
prefix
.
bin
)
install_tree
(
'
lib
'
,
prefix
.
lib
)
install_tree
(
'
lib
'
,
prefix
.
lib
)
install_tree
(
'
include
'
,
prefix
.
include
)
install_tree
(
'
include
'
,
prefix
.
include
)
install_tree
(
'
man/man1
'
,
prefix
.
share_man1
)
install_tree
(
'
man/man1
'
,
prefix
.
share_man1
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment