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

[Libxc] update to version 7.0.0 #9910

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

abussy
Copy link
Contributor

@abussy abussy commented Dec 2, 2024

Straight forward version update. No need for patches anymore, because of upstream fixes. Note that I gave up on a previous approach to add aarch64 CPU + CUDA binaries (#9676).


mkdir libxc_build
cd libxc_build
cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \

mv ${WORKSPACE}/destdir/cuda/lib ${WORKSPACE}/destdir/cuda/lib64
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this leave leftovers in the final tarballs? Why do you need to move it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CMake looks for the cuda installation in cuda/lib64 rather than cuda/lib. Other CUDA packages either do this, or they create a symlink. I'm happy to change for the latter, if it is indeed cleaner.

Copy link
Member

Choose a reason for hiding this comment

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

The point is that the tarball has a cuda directory full of empty subdirectories. That shouldn't exist at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned-up. It looks like the offending line was skip_audit=true, dont_dlopen=true in the arguments of the build_tarball() function. I am not sure what it did, but it does not seem necessary. I successfully tested the new build as well.

-DCMAKE_BUILD_TYPE=Release -DENABLE_XHOST=OFF -DBUILD_SHARED_LIBS=ON \
-DENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc -DBUILD_TESTING=OFF \
-DENABLE_FORTRAN=OFF -DDISABLE_KXC=ON ..
-DENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc \
Copy link
Contributor

Choose a reason for hiding this comment

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

libxc is using enable_language(CUDA), i.e. the FindCUDAToolkit CMake module, so it should be sufficient (and a bit more proper) to specify the CUDA toolkit root, i.e. CUDAToolkit_ROOT=$prefix/cuda - instead of specifying the path to nvcc.

... but for unknown reasons, it seems CUDA_TOOLKIT_ROOT_DIR=$prefix/cuda is usually what actually works - though that is the variable specified for the deprecated FindCUDA

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of the CUDA_TOOLKIT_ROOT_DIR or CUDAToolkit_ROOT option works out of the box in this build, without exporting the location of the nvcc compiler. I left the DCMAKE_CUDA_COMPILER as it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you try setting CUDA_PATH?

Comment on lines 24 to 26
-DENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc \
-DBUILD_TESTING=OFF -DENABLE_FORTRAN=OFF \
-DDISABLE_KXC=ON ..
Copy link
Contributor

Choose a reason for hiding this comment

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

Breaking lists into separate parts and sorting them is good practice (helps shorten future diffs etc.):

Suggested change
-DENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc \
-DBUILD_TESTING=OFF -DENABLE_FORTRAN=OFF \
-DDISABLE_KXC=ON ..
-DBUILD_TESTING=OFF \
-DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc \
-DENABLE_CUDA=ON \
-DENABLE_FORTRAN=OFF \
-DDISABLE_KXC=ON ..

This should of course be extended for the entire cmake "configure" call, but GitHub prevents making a suggestion for the entire cmake configure call (due to some deleted lines, apparently).


build_tarballs(ARGS, name, version, sources, script, [platform],
products, [dependencies; cuda_deps]; lazy_artifacts=true,
julia_compat="1.7", augment_platform_block,
skip_audit=true, dont_dlopen=true)
julia_compat="1.8", augment_platform_block=CUDA.augment, preferred_gcc_version=v"8")
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider sorting keyword args (also lazy_artifacts) and putting each on a separate line.

@abussy
Copy link
Contributor Author

abussy commented Dec 4, 2024

Applied cosmetic changes suggested by @stemann

# The products that we will ensure are always built
products = [
LibraryProduct("libxc", :libxc)
]

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"))
Copy link
Member

Choose a reason for hiding this comment

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

Please don't make unrelated unneeded and undesired cosmetic changes such as removing trailing commas that are there for a very good reason (i.e. not to break git blame when adding new lines)

Suggested change
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"))
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),

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.

4 participants