Skip to content

VMD: 1.9.4a57 (GH200) #192

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,10 @@ uenvs:
todi: [gh200]
daint: [gh200]
develop: False
vmd:
"1.9.4a57":
recipes:
gh200: 1.9.4a57/gh200
deploy:
daint: [gh200]
develop: False
5 changes: 5 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/compilers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bootstrap:
spec: gcc@13
gcc:
specs:
- gcc@13
7 changes: 7 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: vmd
description: VMD Visual Molecular Dynamics 1.9.4 alpha 57
store: /user-environment
spack:
repo: https://github.com/spack/spack.git
commit: v0.23.1
modules: false
29 changes: 29 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/environments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
vmd-env:
compiler:
- toolchain: gcc
spec: gcc@13
unify: true
specs:
- [email protected] ~xss
- [email protected]
- fltk
- libpng
- zlib
- [email protected]
- vmd
variants:
- +cuda
- cuda_arch=90a
views:
default:
link: roots
uenv:
add_compilers: false
LD_LIBRARY_PATH: [lib, lib64]
develop:
link: roots
exclude: ["vmd"]
uenv:
prefix_paths:
CPATH: [include]
LIBRARY_PATH: [lib, lib64]
11 changes: 11 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/pre-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -u

vmd_version="1.9.4a57"
vmd_tarball="vmd-${vmd_version}.src.tar.gz"
vmd_tarball_filepath={{ env.build }}/environments/${vmd_tarball}

curl --user $CSCS_REGISTRY_USERNAME:$CSCS_REGISTRY_PASSWORD https://jfrog.svc.cscs.ch/artifactory/uenv-sources/vmd/${vmd_tarball} --output ${vmd_tarball_filepath}

tar xf ${vmd_tarball_filepath}
15 changes: 15 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/repo/packages/vmd/configure-cuda.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- spack.src/configure 2025-02-21 12:14:19.000000000 +0100
+++ spack.src.patched/configure 2025-02-21 12:15:38.000000000 +0100
@@ -2629,10 +2629,9 @@
if ($config_tk) { $tcl_libs = "-ltk8.5 -lX11 " . $tcl_libs; }
$vmd_libs = "$tcl_libs -lz";

- $arch_nvcc = "/usr/local/cuda/bin/nvcc";
+ $arch_nvcc = "nvcc";
$arch_nvccflags = "--ptxas-options=-v " .
- "-gencode arch=compute_30,code=compute_30 " .
- "-gencode arch=compute_70,code=compute_70 " .
+ "-gencode arch=compute_90,code=compute_90 " .
"--ftz=true ";
$cuda_library = "-L/usr/local/cuda/lib64";
$arch_cc = "cc";
121 changes: 121 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/repo/packages/vmd/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import os

from spack.package import *


class Vmd(MakefilePackage, CudaPackage):
"""VMD provides user-editable materials which can be applied
to molecular geometry.

These material properties control the details of how VMD shades
the molecular geometry, and how transparent or opaque the displayed
molecular geometry is. With this feature, one can easily create nice
looking transparent surfaces which allow inner structural details to
be seen within a large molecular structure. The material controls can
be particularly helpful when rendering molecular scenes using external
ray tracers, each of which typically differ slightly.
"""

homepage = "https://www.ks.uiuc.edu/Research/vmd/"
version(
"1.9.4a57",
sha256="de278d0c5d969336d89068e0806fb50aaa0cb0f546ba985d840b279357860679",
)

url = "file://{0}/vmd-1.9.4a57.src.tar.gz".format(os.getcwd())
manual_download = True
redistribute(source=False, binary=False)

requires("%gcc", msg="Currently GCC is hard-coded.")
requires("target=aarch64", msg="Currently LINUXARM64 is hard-coded.")

depends_on("[email protected]")
depends_on("[email protected]")
depends_on("fltk")

depends_on("libx11", type=("run", "link"))
depends_on("gl@3:", type=("run", "link"))

depends_on("patchelf", type="build")
depends_on("gmake", type="build")

patch(
"configure-cuda.patch",
sha256="a1954e289c80f520aaf9086b6fa41de64d78cc8d895ef7c54fb3e8c509da7fdf",
working_dir="vmd-1.9.4a57",
)

def setup_build_environment(self, env):
env.set("VMDINSTALLBINDIR", self.prefix.bin)
env.set("VMDINSTALLLIBRARYDIR", self.prefix.lib64)
env.set("PLUGINDIR", self.prefix.lib64.plugins)

def build(self, spec, prefix):
with working_dir(join_path(self.stage.source_path, "plugins")):
gmake = Executable("gmake")
gmake("LINUXARM64")
gmake("distrib")

VMD_SOURCE_DIR = join_path(self.stage.source_path, "vmd-1.9.4a57")
with working_dir(VMD_SOURCE_DIR):
os.symlink(join_path(self.prefix.lib64, "plugins"), "plugins")

configure_opts = [
"LINUXARM64",
"GCC",
"TCL",
"FLTK",
"FLTKOPENGL",
"EGLPBUFFER",
"PTHREADS",
"SHARED",
"NOSTATICPLUGINS",
"LIBPNG",
"ZLIB",
]

if "+cuda" in spec:
configure_opts.append("CUDA")

configure(*configure_opts)

with working_dir(join_path(VMD_SOURCE_DIR, "src")):
make()

def install(self, spec, prefix):
with working_dir(join_path(self.stage.source_path, "vmd-1.9.4a57/src")):
make("install")
os.symlink(
join_path(prefix.lib64, "vmd.so"),
join_path(prefix.lib64, "vmd_LINUXARM64"),
)

# @run_after("install")
# def ensure_rpaths(self):
# # make sure the executable finds and uses the Spack-provided
# # libraries, otherwise the executable may or may not run depending
# # on what is installed on the host
# patchelf = which("patchelf")
# rpath = ":".join(
# self.spec[dep].libs.directories[0]
# for dep in [
# "libx11",
# "libxi",
# "libxinerama",
# "gl",
# "fltk",
# "tcl",
# "tk",
# "cuda",
# ]
# )
# patchelf(
# "--set-rpath", rpath, join_path(self.prefix, "lib64", "vmd_LINUXAMD64")
# )

def setup_run_environment(self, env):
env.set("PLUGINDIR", self.spec.prefix.lib64.plugins)
2 changes: 2 additions & 0 deletions recipes/vmd/1.9.4a57/gh200/repo/repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo:
namespace: 'spack-repo'