Convert elk to MakefilePackage (#4477)

This commit is contained in:
Adam J. Stewart 2017-06-11 11:47:40 -05:00 committed by Massimiliano Culpo
parent a5c6f0412b
commit 4db107353e

View File

@ -22,11 +22,10 @@
# License along with this program; if not, write to the Free Software # License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
import spack
from spack import * from spack import *
class Elk(Package): class Elk(MakefilePackage):
'''An all-electron full-potential linearised augmented-plane wave '''An all-electron full-potential linearised augmented-plane wave
(FP-LAPW) code with many advanced features.''' (FP-LAPW) code with many advanced features.'''
@ -60,7 +59,7 @@ class Elk(Package):
# Cannot be built in parallel # Cannot be built in parallel
parallel = False parallel = False
def configure(self, spec): def edit(self, spec, prefix):
# Dictionary of configuration options # Dictionary of configuration options
config = { config = {
'MAKE': 'make', 'MAKE': 'make',
@ -110,8 +109,8 @@ def configure(self, spec):
config['F90'] = spec['mpi'].mpifc config['F90'] = spec['mpi'].mpifc
config['F77'] = spec['mpi'].mpif77 config['F77'] = spec['mpi'].mpif77
else: else:
config['F90'] = join_path(spack.build_env_path, 'f90') config['F90'] = spack_fc
config['F77'] = join_path(spack.build_env_path, 'f77') config['F77'] = spack_f77
config['SRC_MPI'] = 'mpi_stub.f90' config['SRC_MPI'] = 'mpi_stub.f90'
# OpenMP support # OpenMP support
@ -141,14 +140,8 @@ def configure(self, spec):
inc.write('{0} = {1}\n'.format(key, config[key])) inc.write('{0} = {1}\n'.format(key, config[key]))
def install(self, spec, prefix): def install(self, spec, prefix):
# Elk only provides an interactive setup script
self.configure(spec)
make()
make('test')
# The Elk Makefile does not provide an install target # The Elk Makefile does not provide an install target
mkdirp(prefix.bin) mkdir(prefix.bin)
install('src/elk', prefix.bin) install('src/elk', prefix.bin)
install('src/eos/eos', prefix.bin) install('src/eos/eos', prefix.bin)