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

features to enable #19

Open
3 of 8 tasks
ltalirz opened this issue Apr 8, 2021 · 9 comments
Open
3 of 8 tasks

features to enable #19

ltalirz opened this issue Apr 8, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@ltalirz
Copy link
Member

ltalirz commented Apr 8, 2021

from installation instructions

@ltalirz ltalirz added the enhancement New feature or request label Apr 9, 2021
@ltalirz
Copy link
Member Author

ltalirz commented May 5, 2022

Hey @dev-zero, @annahehn reached out with regards to adding libint to the cp2k version built on conda-forge.

As you pointed out in #12 (comment) , cp2k needs a specially configured libint so I guess we can't use the one from the libint feedstock (?).

However, I guess it may be relatively straightforward to build this specific libint during the cp2k build process (?).
Could you perhaps provide the rough instructions we would need to add to the build.sh in order to do this?

P.S. I guess it would increase the build time significantly but looking at the libint feedstock their build takes of the order of 44 minutes so perhaps it's still doable.

@dev-zero
Copy link
Contributor

dev-zero commented May 6, 2022

Hey @dev-zero, @annahehn reached out with regards to adding libint to the cp2k version built on conda-forge.

As you pointed out in #12 (comment) , cp2k needs a specially configured libint so I guess we can't use the one from the libint feedstock (?).

No, you most likely can't unless it is configured exactly the same way as required (which is usually not the case).
Details on how we need libint to be built can be found here: https://github.com/cp2k/libint-cp2k/blob/master/Jenkinsfile

However, I guess it may be relatively straightforward to build this specific libint during the cp2k build process (?). Could you perhaps provide the rough instructions we would need to add to the build.sh in order to do this?

Sure, I somewhat assumed that this is a no-go (as it is for many Linux distros).

What you need is the 2.6.0 tarball from https://github.com/cp2k/libint-cp2k/releases (or the CP2K package mirror) which contains the libint source code with the first step (the generation of the code with the required configuration) already done. From there you can do a simple configure/make/make install with the only thing to remember is to pass --enable-fortran. The toolchain script can serve as a blueprint (and a reminder to ensure CC/CFLAGS are set):
https://github.com/cp2k/cp2k/blob/4eb5f9a884a8e3083aa1322b1d05a82a7f2f3db8/tools/toolchain/scripts/stage3/install_libint.sh#L81-L94
This is not an MPI-parallel package, so "normal" compilers can be used.
If I'm not mistaken you should end up with a static library, modify the arch files accordingly (the easiest is to do a cp2k build locally with the toolchain to get a template, otherwise @annahehn can provide an example arch file.

P.S. I guess it would increase the build time significantly but looking at the libint feedstock their build takes of the order of 44 minutes so perhaps it's still doable.

On fast machines it is doable, especially when using our pre-prepared tarball.

Wrt your list of dependencies: libxsmm (not libsmm) which is likely part of the conda would be very important for CP2K. The only requirement is that the Fortran bindings are enabled. libvori would also be a low-hanging fruit you could integrate in the same way as libint.

@dev-zero
Copy link
Contributor

dev-zero commented May 6, 2022

Expect the binary size to grow (+80M) as libint consists of a lot of templated unrolled code. If debug symbols -g are enabled within conda: disable it for libint to half the size (or call strip on libint2.a before linking it with cp2k).

@oschuett
Copy link

oschuett commented May 6, 2022

Maybe the build time and binary size could be reduced by lowering --with-opt-am?

@ltalirz
Copy link
Member Author

ltalirz commented May 15, 2022

Dear both, thanks a lot for the quick reply and for the thoughtful suggestions!

Just for reference, I haven't started adding libint since @annahehn mentioned a vistor in their group may have a stab at adding support here.

@dev-zero Concerning libsmm: I think in the list above I likely meant to write libxsmm rather than libsmm.
Is there even a way to turn off libsmm in cp2k?
libxsmm is on conda-forge and could be added.

@dev-zero
Copy link
Contributor

@ltalirz libsmm is/was optional before and required extra steps. The default is to use blas instead.

@ltalirz
Copy link
Member Author

ltalirz commented May 16, 2022

I see. I just searched for "smm" in the installation instructions and did not see any mention of a related configuration option. Am I overlooking something?

@oschuett
Copy link

oschuett commented May 16, 2022

I removed libsmm from the toolchain and the installation instructions (cp2k/cp2k@9d664f5), see also cp2k/cp2k#2044.

@ltalirz
Copy link
Member Author

ltalirz commented May 18, 2022

Thanks for the clarification - now that I look back into it, the feedstock already builds cp2k with libxsmm support. When I opened this issue, I probably only glanced over the installation instructions and failed to realize that libxsmm supersedes libsmm and that there is no point in adding both.

I've removed the corresponding bullet point from the to-do list.

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

No branches or pull requests

3 participants