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
d9cc1f85
Commit
d9cc1f85
authored
9 years ago
by
Todd Gamblin
Browse files
Options
Downloads
Plain Diff
Merge pull request #932 from adamjstewart/features/elk
Elk: Use new openmp_flag and mpi attributes
parents
e7ced543
03307f91
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
var/spack/repos/builtin/packages/elk/package.py
+46
-34
46 additions, 34 deletions
var/spack/repos/builtin/packages/elk/package.py
with
46 additions
and
34 deletions
var/spack/repos/builtin/packages/elk/package.py
+
46
−
34
View file @
d9cc1f85
...
...
@@ -22,8 +22,9 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from
spack
import
*
import
spack
from
spack
import
*
class
Elk
(
Package
):
'''
An all-electron full-potential linearised augmented-plane wave
...
...
@@ -35,79 +36,90 @@ class Elk(Package):
version
(
'
3.3.17
'
,
'
f57f6230d14f3b3b558e5c71f62f0592
'
)
# Elk provides these libraries, but allows you to specify your own
variant
(
'
blas
'
,
default
=
True
,
description
=
'
Build with custom BLAS library
'
)
variant
(
'
lapack
'
,
default
=
True
,
description
=
'
Build with custom LAPACK library
'
)
variant
(
'
fft
'
,
default
=
True
,
description
=
'
Build with custom FFT library
'
)
variant
(
'
blas
'
,
default
=
True
,
description
=
'
Build with custom BLAS library
'
)
variant
(
'
lapack
'
,
default
=
True
,
description
=
'
Build with custom LAPACK library
'
)
variant
(
'
fft
'
,
default
=
True
,
description
=
'
Build with custom FFT library
'
)
# Elk does not provide these libraries, but allows you to use them
variant
(
'
mpi
'
,
default
=
True
,
description
=
'
Enable MPI parallelism
'
)
variant
(
'
openmp
'
,
default
=
True
,
description
=
'
Enable OpenMP support
'
)
variant
(
'
libxc
'
,
default
=
True
,
description
=
'
Link to Libxc functional library
'
)
variant
(
'
mpi
'
,
default
=
True
,
description
=
'
Enable MPI parallelism
'
)
variant
(
'
openmp
'
,
default
=
True
,
description
=
'
Enable OpenMP support
'
)
variant
(
'
libxc
'
,
default
=
True
,
description
=
'
Link to Libxc functional library
'
)
depends_on
(
'
blas
'
,
when
=
'
+blas
'
)
depends_on
(
'
lapack
'
,
when
=
'
+lapack
'
)
depends_on
(
'
fftw
'
,
when
=
'
+fft
'
)
depends_on
(
'
mpi
'
,
when
=
'
+mpi
'
)
depends_on
(
'
mpi
@2:
'
,
when
=
'
+mpi
'
)
depends_on
(
'
libxc
'
,
when
=
'
+libxc
'
)
# Cannot be built in parallel
parallel
=
False
def
configure
(
self
,
spec
):
# Dictionary of configuration options
config
=
{
'
MAKE
'
:
'
make
'
,
'
F90
'
:
join_path
(
spack
.
build_env_path
,
'
f90
'
),
'
F77
'
:
join_path
(
spack
.
build_env_path
,
'
f77
'
),
'
AR
'
:
'
ar
'
,
'
LIB_FFT
'
:
'
fftlib.a
'
,
'
SRC_MPI
'
:
'
mpi_stub.f90
'
,
'
SRC_OMP
'
:
'
omp_stub.f90
'
,
'
SRC_libxc
'
:
'
libxcifc_stub.f90
'
,
'
SRC_FFT
'
:
'
zfftifc.f90
'
'
MAKE
'
:
'
make
'
,
'
AR
'
:
'
ar
'
}
# Compiler-specific flags
flags
=
''
if
self
.
compiler
.
name
==
'
intel
'
:
flags
=
'
-O3 -ip -unroll -no-prec-div
-openmp
'
if
self
.
compiler
.
name
==
'
intel
'
:
flags
=
'
-O3 -ip -unroll -no-prec-div
'
elif
self
.
compiler
.
name
==
'
gcc
'
:
flags
=
'
-O3 -ffast-math -funroll-loops
-fopenmp
'
flags
=
'
-O3 -ffast-math -funroll-loops
'
elif
self
.
compiler
.
name
==
'
pgi
'
:
flags
=
'
-O3
-mp
-lpthread
'
flags
=
'
-O3 -lpthread
'
elif
self
.
compiler
.
name
==
'
g95
'
:
flags
=
'
-O3 -fno-second-underscore
'
elif
self
.
compiler
.
name
==
'
nag
'
:
flags
=
'
-O4 -kind=byte -dusty -dcfuns
'
elif
self
.
compiler
.
name
==
'
xl
'
:
flags
=
'
-O3
-qsmp=omp
'
flags
=
'
-O3
'
config
[
'
F90_OPTS
'
]
=
flags
config
[
'
F77_OPTS
'
]
=
flags
# BLAS/LAPACK support
# Note: BLAS/LAPACK must be compiled with OpenMP support
# if the +openmp variant is chosen
blas
=
'
blas.a
'
lapack
=
'
lapack.a
'
if
'
+blas
'
in
spec
:
blas
=
join_path
(
spec
[
'
blas
'
].
prefix
.
lib
,
'
libblas.so
'
)
if
'
+blas
'
in
spec
:
blas
=
spec
[
'
blas
'
].
blas_shared_lib
if
'
+lapack
'
in
spec
:
lapack
=
join_path
(
spec
[
'
lapack
'
].
prefix
.
lib
,
'
liblapack.so
'
)
config
[
'
LIB_LPK
'
]
=
'
'
.
join
([
lapack
,
blas
])
# lapack must come before blas
lapack
=
spec
[
'
lapack
'
].
lapack_shared_lib
# lapack must come before blas
config
[
'
LIB_LPK
'
]
=
'
'
.
join
([
lapack
,
blas
])
# FFT support
if
'
+fft
'
in
spec
:
config
[
'
LIB_FFT
'
]
=
join_path
(
spec
[
'
fftw
'
].
prefix
.
lib
,
'
libfftw3.so
'
)
config
[
'
LIB_FFT
'
]
=
join_path
(
spec
[
'
fftw
'
].
prefix
.
lib
,
'
libfftw3.so
'
)
config
[
'
SRC_FFT
'
]
=
'
zfftifc_fftw.f90
'
else
:
config
[
'
LIB_FFT
'
]
=
'
fftlib.a
'
config
[
'
SRC_FFT
'
]
=
'
zfftifc.f90
'
# MPI support
if
'
+mpi
'
in
spec
:
config
.
pop
(
'
SRC_MPI
'
)
config
[
'
F90
'
]
=
join_path
(
spec
[
'
mpi
'
].
prefix
.
bin
,
'
mpif90
'
)
config
[
'
F77
'
]
=
join_path
(
spec
[
'
mpi
'
].
prefix
.
bin
,
'
mpif77
'
)
config
[
'
F90
'
]
=
spec
[
'
mpi
'
].
mpifc
config
[
'
F77
'
]
=
spec
[
'
mpi
'
].
mpif77
else
:
config
[
'
F90
'
]
=
join_path
(
spack
.
build_env_path
,
'
f90
'
)
config
[
'
F77
'
]
=
join_path
(
spack
.
build_env_path
,
'
f77
'
)
config
[
'
SRC_MPI
'
]
=
'
mpi_stub.f90
'
# OpenMP support
if
'
+openmp
'
in
spec
:
config
.
pop
(
'
SRC_OMP
'
)
config
[
'
F90_OPTS
'
]
+=
'
'
+
self
.
compiler
.
openmp_flag
config
[
'
F77_OPTS
'
]
+=
'
'
+
self
.
compiler
.
openmp_flag
else
:
config
[
'
SRC_OMP
'
]
=
'
omp_stub.f90
'
# Libxc support
if
'
+libxc
'
in
spec
:
...
...
@@ -120,13 +132,14 @@ def configure(self, spec):
'
libxc.f90
'
,
'
libxcifc.f90
'
])
else
:
config
[
'
SRC_libxc
'
]
=
'
libxcifc_stub.f90
'
# Write configuration options to include file
with
open
(
'
make.inc
'
,
'
w
'
)
as
inc
:
for
key
in
config
:
inc
.
write
(
'
{0} = {1}
\n
'
.
format
(
key
,
config
[
key
]))
def
install
(
self
,
spec
,
prefix
):
# Elk only provides an interactive setup script
self
.
configure
(
spec
)
...
...
@@ -143,4 +156,3 @@ def install(self, spec, prefix):
install_tree
(
'
examples
'
,
join_path
(
prefix
,
'
examples
'
))
install_tree
(
'
species
'
,
join_path
(
prefix
,
'
species
'
))
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