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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
eba264fc
Commit
eba264fc
authored
9 years ago
by
Denis Davydov
Browse files
Options
Downloads
Patches
Plain Diff
fix formatting
parent
361b6290
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/spack/spack/package_test.py
+9
-7
9 additions, 7 deletions
lib/spack/spack/package_test.py
var/spack/repos/builtin/packages/openblas/package.py
+19
-15
19 additions, 15 deletions
var/spack/repos/builtin/packages/openblas/package.py
with
28 additions
and
22 deletions
lib/spack/spack/package_test.py
+
9
−
7
View file @
eba264fc
...
...
@@ -25,7 +25,8 @@
from
spack
import
*
import
os
def
compile_c_and_execute
(
source_file
,
include_flags
,
link_flags
):
def
compile_c_and_execute
(
source_file
,
include_flags
,
link_flags
):
"""
Compile C @p source_file with @p include_flags and @p link_flags,
run and return the output.
"""
...
...
@@ -46,14 +47,15 @@ def compare_output(current_output, blessed_output):
if
not
(
current_output
==
blessed_output
):
print
"
Produced output does not match expected output.
"
print
"
Expected output:
"
print
'
-
'
*
80
print
'
-
'
*
80
print
blessed_output
print
'
-
'
*
80
print
'
-
'
*
80
print
"
Produced output:
"
print
'
-
'
*
80
print
'
-
'
*
80
print
current_output
print
'
-
'
*
80
raise
RuntimeError
(
"
Ouput check failed. See spack_output.log for details
"
)
print
'
-
'
*
80
raise
RuntimeError
(
"
Ouput check failed.
"
,
"
See spack_output.log for details
"
)
def
compare_output_file
(
current_output
,
blessed_output_file
):
...
...
@@ -61,4 +63,4 @@ def compare_output_file(current_output, blessed_output_file):
with
open
(
blessed_output_file
,
'
r
'
)
as
f
:
blessed_output
=
f
.
read
()
compare_output
(
current_output
,
blessed_output
)
compare_output
(
current_output
,
blessed_output
)
This diff is collapsed.
Click to expand it.
var/spack/repos/builtin/packages/openblas/package.py
+
19
−
15
View file @
eba264fc
from
spack
import
*
from
spack.package_test
import
*
import
sys
import
os
import
shutil
class
Openblas
(
Package
):
"""
OpenBLAS: An optimized BLAS library
"""
...
...
@@ -14,9 +13,9 @@ class Openblas(Package):
version
(
'
0.2.16
'
,
'
fef46ab92463bdbb1479dcec594ef6dc
'
)
version
(
'
0.2.15
'
,
'
b1190f3d3471685f17cfd1ec1d252ac9
'
)
variant
(
'
shared
'
,
default
=
True
,
description
=
"
Build shared libraries as well as static libs.
"
)
variant
(
'
shared
'
,
default
=
True
,
description
=
"
Build shared libraries as well as static libs.
"
)
# NOQA: ignore=E501
variant
(
'
openmp
'
,
default
=
False
,
description
=
"
Enable OpenMP support.
"
)
variant
(
'
fpic
'
,
default
=
True
,
description
=
"
Build position independent code
"
)
variant
(
'
fpic
'
,
default
=
True
,
description
=
"
Build position independent code
"
)
# NOQA: ignore=E501
# virtual dependency
provides
(
'
blas
'
)
...
...
@@ -48,11 +47,11 @@ def install(self, spec, prefix):
# Add support for OpenMP
if
'
+openmp
'
in
spec
:
# Note: Apple's most recent Clang 7.3.0 still does not support OpenMP.
# What is worse, Openblas (as of 0.2.18) hardcoded that OpenMP cannot
# Openblas (as of 0.2.18) hardcoded that OpenMP cannot
# be used with any (!) compiler named clang, bummer.
if
spec
.
satisfies
(
'
%clang
'
):
raise
InstallError
(
'
OpenBLAS does not support OpenMP with clang!
'
)
raise
InstallError
(
'
OpenBLAS does not support
'
,
'
OpenMP with clang!
'
)
make_defs
+=
[
'
USE_OPENMP=1
'
]
...
...
@@ -69,29 +68,34 @@ def install(self, spec, prefix):
symlink
(
'
libopenblas.a
'
,
'
blas.a
'
)
symlink
(
'
libopenblas.a
'
,
'
libblas.a
'
)
if
'
+shared
'
in
spec
:
symlink
(
'
libopenblas.%s
'
%
dso_suffix
,
'
libblas.%s
'
%
dso_suffix
)
symlink
(
'
libopenblas.%s
'
%
dso_suffix
,
'
libblas.%s
'
%
dso_suffix
)
# Lapack virtual package should provide liblapack.a
with
working_dir
(
prefix
.
lib
):
symlink
(
'
libopenblas.a
'
,
'
liblapack.a
'
)
if
'
+shared
'
in
spec
:
symlink
(
'
libopenblas.%s
'
%
dso_suffix
,
'
liblapack.%s
'
%
dso_suffix
)
symlink
(
'
libopenblas.%s
'
%
dso_suffix
,
'
liblapack.%s
'
%
dso_suffix
)
# Openblas may pass its own test but still fail to compile Lapack
# symbols. To make sure we get working Blas and Lapack, do a small test.
# symbols. To make sure we get working Blas and Lapack, do a small
# test.
self
.
check_install
(
spec
)
def
setup_dependent_package
(
self
,
module
,
dspec
):
# This is WIP for a prototype interface for virtual packages.
# We can update this as more builds start depending on BLAS/LAPACK.
libdir
=
find_library_path
(
'
libopenblas.a
'
,
self
.
prefix
.
lib64
,
self
.
prefix
.
lib
)
libdir
=
find_library_path
(
'
libopenblas.a
'
,
self
.
prefix
.
lib64
,
self
.
prefix
.
lib
)
self
.
spec
.
blas_static_lib
=
join_path
(
libdir
,
'
libopenblas.a
'
)
self
.
spec
.
lapack_static_lib
=
self
.
spec
.
blas_static_lib
if
'
+shared
'
in
self
.
spec
:
self
.
spec
.
blas_shared_lib
=
join_path
(
libdir
,
'
libopenblas.%s
'
%
dso_suffix
)
self
.
spec
.
blas_shared_lib
=
join_path
(
libdir
,
'
libopenblas.%s
'
%
dso_suffix
)
self
.
spec
.
lapack_shared_lib
=
self
.
spec
.
blas_shared_lib
def
check_install
(
self
,
spec
):
...
...
@@ -108,5 +112,5 @@ def check_install(self, spec):
if
'
+openmp
'
in
spec
:
link_flags
.
extend
([
self
.
compiler
.
openmp_flag
])
output
=
compile_c_and_execute
(
source_file
,
include_flags
,
link_flags
)
compare_output_file
(
output
,
blessed_file
)
output
=
compile_c_and_execute
(
source_file
,
include_flags
,
link_flags
)
compare_output_file
(
output
,
blessed_file
)
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