Skip to content

initial package#796

Closed
lee218llnl wants to merge 387 commits intodevelopfrom
features/intel
Closed

initial package#796
lee218llnl wants to merge 387 commits intodevelopfrom
features/intel

Conversation

@lee218llnl
Copy link
Copy Markdown
Contributor

All,

Here is my initial implementation of the Intel compiler package, addressing #761. It currently distinguishes between the "cluster", "professional", and "composer" editions. This whole thing is admittedly a bit of a mess, so feedback is much appreciated, particularly w.r.t. how versions and variants are being handled. A lot of the mess is due to flexibility I tried adding and we can certainly clean things up by just setting components to "ALL" and not allow the removal of the libraries. I know here at LLNL, we don't care much about daal and ipp, and both take up a lot of disk space.

The package will need to be updated to use the license features of #553 and in the meantime you will have to set your license_path appropriately.

variant('tools', default=True, description="Install the Intel Advisor, VTune Amplifier, and Inspector tools")

provides('mpi', when='@cluster:+mpi')
provides('mkl', when='+mkl')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to provide blas, lapack, and a new virtual package called fft. The atlas package similarly provides blas and lapack.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that sounds reasonable, but how well would that work since the library names are different? I suppose we could create symlinks with the standard libblas and liblapack names pointing to the appropriate mkl libraries. We would also have to create some symlinks to the have {prefix}/lib directory point to MKL's lib directory. The Intel package is a big mess, eh?!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a mess. But yeah, we should probably create symlinks for libblas/liblapack. Otherwise, every package that depends on blas/lapack will need a big if-statement for linking to various providers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus, you can't have a package depend on blas or mkl. Providing blas/lapack/fft gives us the maximum flexibility.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be trickier than just providing a symlink, as other MKL libraries will need to be lined in (refer to https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor). There are additional complexities w.r.t compiler vendor, sequential vs openmp, etc. Suffice it to say, I don't think we can easily just provide blas and lapack.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I wonder if it's possible to expand depends_on to allow something like depends_on('blas', 'mkl') so it can depend on one or the other. Would this solve the problem?

install_script('--silent', 'install.ini')

absbindir = os.path.split(os.path.realpath(os.path.join(self.prefix.bin, "icc")))[0]
abslibdir = os.path.split(os.path.realpath(os.path.join(self.prefix.lib, "intel64", "libimf.a")))[0]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use os.path.split and os.path.realpath? I guess it doesn't matter too much since they will be replaced once #558 is merged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license file must exist in the absolute path of compiler binaries. Since prefix.bin is an actual directory and not a symlink, I use realpath. The split is to get the directory path of the icc binary.

@lee218llnl
Copy link
Copy Markdown
Contributor Author

the latest commit uses searches a pset file for possible components and then uses a regex to specify features to install. This should be more portable across versions than manually specifying all components.


components_string = ''
for component in components:
components_string += component + ';'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

components_string = ';'.join(components)

@adamjstewart
Copy link
Copy Markdown
Member

I know we discussed this in #761, but are there still plans to make separate intel (compilers only), mkl, daal, etc packages? If so, we might want to rename this package intel-suite.

version('11.3.2.181', '536dbd82896d6facc16de8f961d17d65',
url="file://%s/l_mkl_11.3.2.181.tgz" % os.getcwd())

#provides('mkl')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be provides('blas') + provides('lapack') ? together with something like

def setup_dependent_package(self, module, dspec):
       libdir = find_library_path('libmkl_rt.%s' % dso_suffix, self.prefix.lib64, self.prefix.lib)
       # TODO: what to do with static libs?
       # self.spec.blas_static_lib   = join_path(libdir, 'libopenblas.a')
       # self.spec.lapack_static_lib = self.spec.blas_static_lib

       # For now to make life easier stick with run-time MKL library. 
       # Otherwise we would need the whole list of libraries... :-(
        if '+shared' in self.spec:
            self.spec.blas_shared_lib   = join_path(libdir, 'libmkl_rt.%s' % dso_suffix)
            self.spec.lapack_shared_lib = self.spec.blas_shared_lib

@lee218llnl
Copy link
Copy Markdown
Contributor Author

I moved the IntelInstaller helper base class to packages/intel.py. The other packages, like MKL can get to it via:
from spack.pkg.builtin.intel import IntelInstaller
Thanks to @tgamblin for the pointer on how to do this. Let me know if this seems like a reasonable setup.

spack.repo.get(self.extendee_spec)._check_extendable()

@property
def global_license_dir(self):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamjstewart @tgamblin I added this new global_license_dir property so the Intel base package can overload the global_license_file property and have some assurances it's using the correct directory by referencing global_license_dir.

@lee218llnl
Copy link
Copy Markdown
Contributor Author

@tgamblin I hope rebasing develop to pick up #558 was OK.

@adamjstewart
Copy link
Copy Markdown
Member

Haha, it looks like you messed up your rebase somehow. You definitely didn't affect 644 files.

@lee218llnl
Copy link
Copy Markdown
Contributor Author

@adamjstewart yeah, clearly my GIT-fu is not very good... any guidance on how to fix this?

@davydden
Copy link
Copy Markdown
Member

davydden commented May 12, 2016

i would say first of all have a back-up git checkout -b features/intel_backup. Then go back to your current branch git checkout features/intel.

(1)
It looks like you have a mixture of your commits (like the first one) and everything else that happened on develop branch. My guess is that if you go to develop, pull, then go back to your branch and do git rebase develop, then all the repetitions should go away and you will be left only with your stuff you are adding in this PR.

(2)
Another way is to merge and reset, but loose the history (effectively stash things or re-create commits). Along the lines of

# starting from your current messed-up branch
git remote update # update remotes
git merge origin/develop  # merge the current develop to your branch to make sure they are in sync

git checkout -b temporary # go to temp branch
git reset origin/develop # reset all commits to the HEAD of develop, that does NOT delete changes as this is a soft reset.

# at this point you will have un-commited changes
# so you can examine them, add changed files and commit as usual
git status
git diff
git add
git commit 

# if all is good, go back to the messed up branch
git checkout features/intel
# hard reset it to the one you cleaned up.
git reset --hard temporary 
# now repush
git push [...] --force

But don't rush it out, i would wait until someone else suggest a way to clean it up or comment on what i suggest.

@lee218llnl
Copy link
Copy Markdown
Contributor Author

wow, I don't think I helped my cause any more... There are only a few files for me to add/modify, so I may just close this PR without merging and open a new one.

@lee218llnl
Copy link
Copy Markdown
Contributor Author

Due to my ugly rebase attempt and inability to fix, this is being closed in favour of #946.

@lee218llnl lee218llnl closed this May 13, 2016
@tgamblin tgamblin deleted the features/intel branch August 29, 2016 16:58
olupton pushed a commit to olupton/spack that referenced this pull request Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.