Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with buildininstalldir=True #135

Open
garvct opened this issue Jul 22, 2015 · 4 comments
Open

problems with buildininstalldir=True #135

garvct opened this issue Jul 22, 2015 · 4 comments
Labels

Comments

@garvct
Copy link

garvct commented Jul 22, 2015

I have found two cases in easybuild 2.2.0 in which setting buildininstalldir=True, causes an incorrect
software installation.

(1) FFTW 3.3.4 installation fails (When I attempt to install a single precision version and the default
double precision version, I only get the double precision version because easybuild deletes the
single precision installation before moving on to the default double precision version.

Here is my easyconfig file.

easyblock = 'ConfigureMake'

name = 'FFTW'
version = '3.3.4'

homepage = 'http://www.fftw.org'
description = """FFTW is a C subroutine library for computing the discrete Fourier transform (DFT)
in one or more dimensions, of arbitrary input size, and of both real and complex data."""

toolchain = {'name': 'gmvapich2', 'version': '5.5.7'}
toolchainopts = {'optarch': True, 'pic': True}

buildininstalldir = True

sources = ['%s-%s.tar.gz' % (name.lower(), version)]
source_urls = [homepage]

import socket
if socket.gethostname() == 'service2':
   common_configopts = "--enable-threads --enable-openmp --with-pic --enable-mpi --enable-fma --enable-avx"
else:
   common_configopts = "--enable-threads --enable-openmp --with-pic --enable-mpi --enable-sse2"

configopts = [
    common_configopts + " --enable-single",
    common_configopts,  # default as last
]

#configopts = "--enable-sse2 --enable-mpi"
#configopts = " --enable-single --enable-fma --enable-avx --enable-mpi"

#cleanupoldbuild = False

# the MPI opts from FFTW2 are valid options but unused until FFTW3.3
#configopts += " --enable-openmp --with-pic --enable-mpi"

parallel = 8

runtest = 'check'

#sanity_check_paths = {
#    'files': ['bin/fftw%s' % x for x in ['-wisdom', '-wisdom-to-conf']] +
#             ['include/fftw3%s' % x for x in ['-mpi.f03', '-mpi.h', '.f', '.f03']] +
#             ['lib/libfftw3%s.a' % x for x in ['', '_mpi', '_omp']],
#    'dirs': ['lib/pkgconfig'],
#}

sanity_check_paths = {
    'files': ['bin/fftw%s' % x for x in ['-wisdom', '-wisdom-to-conf', 'f-wisdom']] +
             ['include/fftw3%s' % x for x in ['-mpi.f03', '-mpi.h', '.f', '.f03',
                                              '.h', 'l-mpi.f03', 'l.f03', 'q.f03']] +
             ['lib/libfftw3%s%s.a' % (x, y) for x in ['', 'f'] for y in ['', '_mpi', '_omp', '_threads']],
    'dirs': ['lib/pkgconfig'],
}

moduleclass = 'numlib'

When I remove buildinstalldir, FFTW is installed correctly (both versions).

(2) Installation of mvapich2 2.1 also fails when buildininstalldir = True

 I get the following error
garvct@service2:/hpc-common/software/easybuild/inl-easybuild/easybuild/easyconfigs> eb -f MVAPICH2-2.1-GCC-4.9.3-inl.eb
== temporary log file in case of crash /tmp/eb-UzDaeA/easybuild-5JBfQm.log
== processing EasyBuild easyconfig /hpc-common/software/easybuild/inl-easybuild/easybuild/easyconfigs/MVAPICH2-2.1-GCC-4.9.3-inl.eb
== building and installing MVAPICH2/2.1-GCC-4.9.3...
== fetching files...
== creating build dir, resetting environment...
== unpacking...
== patching...
== preparing...
== configuring...
ERROR: Traceback (most recent call last):
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/main.py", line 112, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/framework/easyblock.py", line 1995, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/framework/easyblock.py", line 1935, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/framework/easyblock.py", line 1817, in run_step
    m(self)
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/framework/easyblock.py", line 1867, in <lambda>
    configure_step_spec = (CONFIGURE_STEP, 'configuring', [lambda x: x.configure_step()], True)
  File "/hpc-common/software/easybuild/inl-easybuild/easybuild/easyblocks/mvapich2.py", line 125, in configure_step
    super(EB_MVAPICH2, self).configure_step()
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/easyblocks/generic/configuremake.py", line 90, in configure_step
    (out, _) = run_cmd(cmd, log_all=True, simple=False)
  File "/hpc-common/software/easybuild/2.2.0/lib/python2.7/site-packages/easybuild/tools/run.py", line 75, in run_cmd
    cwd = os.getcwd()
OSError: [Errno 2] No such file or directory

Here is my easyconfig file.

name = 'MVAPICH2'
version = '2.1'

homepage = 'http://mvapich.cse.ohio-state.edu/overview/mvapich2/'
description = """This is an MPI-3 implementation which includes all MPI-1 and MPI-2 features.
It is based on MPICH3 and MVICH."""

toolchain = {'name': 'GCC', 'version': '4.9.3'}

buildininstalldir = True

sources = ['%s-%s.tar.gz' % (name.lower(), version)]
# note: this URL will only work for the most recent version (previous versions no longer available?)
source_urls = ['http://mvapich.cse.ohio-state.edu/download/mvapich/mv2']

import socket
if socket.gethostname() == 'fpbs' or socket.gethostname() == 'quark':
   configopts = '--enable-romio --with-ftb=no --with-blcr=no --disable-silent-rules --without-cma --with-pic'
else:
   configopts = '--enable-romio --with-ftb=no --with-blcr=no --disable-silent-rules --with-pic'

rdma_type = "gen2" # 'gen2' or 'udapl'

## enable building of MPE routines
#withmpe = True

## parallel build tends to fail
parallel = 8
#
moduleclass = 'mpi'

Note: installation works when buildininstalldir is not set (I needed to modify the sanity checks for mvapich2 2.1).

Thanks,
Cormac.

@boegel boegel modified the milestone: 2.2.1 Aug 13, 2015
@boegel
Copy link
Member

boegel commented Aug 17, 2015

@garvct: sorry for not getting back to you earlier; you submitted this issue while I was on holiday, and I'm still trying to work away the backlog that was built up...

(1)

In the FFTW easyconfig, you should not comment out the cleanupoldbuild = False if you have buildininstalldir = True; since the build directory and install directory are one and the same, cleaning up the (old) build directory effectively results in trashing the (partial) installation; good thing the sanity check is in place!

The cycle of steps that EasyBuild executes is such that buildininstalldir is indeed not necessary for FFTW; EasyBuild already makes sure that the install directory isn't trashed on a 2nd pass through the steps cycle. We should clean up the FFTW easyconfigs included in EasyBuild to simply stop defining buildininstalldir and cleanupoldbuild.

(2)

For some (probably very good) reason, the MVAPICH2 easyblock removes the install directory before running the ./configure command. With buildininstalldir = True being set, configure step is being run from the install directory (which is also the build directory), thus resulting in running ./configure from a non-existing directory.

It's probably possible to enhance the MVAPICH2 easyblock to make it aware of this and avoid the hard crash.

Why are enabling buildininstalldir for MVAPICH2 exactly, what are you trying to accomplish?

@boegel
Copy link
Member

boegel commented Aug 17, 2015

After checking, buildininstalldir isn't being used in the FFTW easyconfigs currently shipped by EasyBuild at all. What made you include in your FFTW easyconfig?

@boegel boegel removed this from the 2.2.1 milestone Aug 17, 2015
@garvct
Copy link
Author

garvct commented Aug 17, 2015

I think if is useful to have the complete build environment included in the
installation location, for debugging purposes. When there is an issue
identified with a particular build
I find if useful to have the complete build environment in addition to the
eb log files. (My preference would be this would be my site default.)

Thanks,
Cormac.

On Mon, Aug 17, 2015 at 12:58 PM, Kenneth Hoste notifications@github.com
wrote:

After checking, buildininstalldir isn't being used in the FFTW
easyconfigs currently shipped by EasyBuild at all. What made you include in
your FFTW easyconfig?


Reply to this email directly or view it on GitHub
#135 (comment).

Cormac Garvey
HPC Software Consultant
Scientific Computing
Idaho National Laboratory
Ph: 208-526-6294

@migueldiascosta
Copy link
Member

the installation failure was addressed in easybuilders/easybuild-framework#2724

w.r.t. to always having access to the builddir as a site default, I'd say one option would be to set EASYBUILD_BUILDPATH to a non-temporary location and set EASYBUILD_DISABLE_CLEANUP_BUILDDIR.

Since the builddir and installdir are still separate, it avoids the problems such as the one in MVAPICH2 above.

Still, in the case of multiple iterations such as in FFTW the builddir will still only include the last iteration, unless we make gen_builddir in easybuild/framework/easyblock.py aware of iterations, defining a subdir for each iteration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants