Skip to content

Commit 29ea0e6

Browse files
committed
build: Various fixes to VMD build scripts
1 parent 7509961 commit 29ea0e6

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

devel-tools/compile-vmd.sh

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,38 @@ fix_vmd_configure() {
7272

7373
# Also use this to append the flag to nvcc
7474
sed -i 's/$arch_opt_flag .= " -std=c++11"/$arch_opt_flag .= " -std=c++17"; $arch_nvccflags .= " -std=c++17"/' ${configure}
75+
76+
# We shouldn't have to install tcsh just for this
77+
sed -i -e 's/if \[ ! -x "\/bin\/csh/if \[ ! -x "\/bin\/csh-skip-it/' ${configure}
78+
79+
# VMD2 fixes
80+
sed -i 's/lfltk_jpeg/ljpeg/' ${configure}
81+
sed -i 's/lfltk_png/lpng/' ${configure}
82+
sed -i 's/lfltk_z/lz/' ${configure}
83+
84+
# Remove ancient CUDA architectures
85+
sed -i 's/"-gencode arch=compute_30,code=compute_30 "/""/' ${configure}
86+
sed -i 's/"-gencode arch=compute_30,code=sm_35 "/""/' ${configure}
87+
sed -i 's/"-gencode arch=compute_30,code=sm_37 "/""/' ${configure}
7588
}
7689

7790

7891
compile_vmd_target() {
7992

8093
check_vmd_dependencies
8194

95+
local VMD2PROTOTYPE="no"
96+
8297
local VMDSRCDIR="${PWD}"
8398
if [ -f "${1}/src/VMDApp.h" ] ; then
8499
VMDSRCDIR=$(realpath "${1}")
85100
shift
86101
fi
102+
if [ -f "${1}/vmd/src/VMDApp.h" ] ; then
103+
VMD2PROTOTYPE="yes"
104+
VMDSRCDIR=$(realpath "${1}/vmd")
105+
shift
106+
fi
87107
pushd "${VMDSRCDIR}"
88108

89109
fix_vmd_configure configure
@@ -95,7 +115,11 @@ compile_vmd_target() {
95115

96116
export VMDINSTALLBINDIR=${1}
97117
if [ -z "${VMDINSTALLBINDIR}" ] ; then
98-
export VMDINSTALLBINDIR="${VMDSRCDIR}/install"
118+
if [ "${VMD2PROTOTYPE}" == "yes" ] ; then
119+
export VMDINSTALLBINDIR="${VMDSRCDIR%/vmd}/install"
120+
else
121+
export VMDINSTALLBINDIR="${VMDSRCDIR}/install"
122+
fi
99123
fi
100124

101125
mkdir -p "${VMDINSTALLBINDIR}"
@@ -179,16 +203,11 @@ compile_vmd_target() {
179203
return 1
180204
fi
181205

182-
if { ! grep -q csh-skip-it configure ; } ; then
183-
# We should't have to install tcsh just for this
184-
sed -i -e 's/if \[ ! -x "\/bin\/csh/if \[ ! -x "\/bin\/csh-skip-it/' configure
185-
fi
186-
187206
if [ -n "${CUDA_HOME}" ] && [ -d ${CUDA_HOME} ] ; then
188-
sed -i -e "s/\/usr\/local\/cuda-10.2/${CUDA_HOME////\/}/" configure
207+
sed -i 's/\/usr\/local\/cuda-10.2/$ENV{CUDA_HOME}/' configure
189208
VMD_OPTS+=(CUDA)
190-
if [ -n "${CUDA_HOME}" ] && [ -d ${CUDA_HOME} ] ; then
191-
sed -i -e "s/\/usr\/local\/encap\/NVIDIA-OptiX/${OPTIX_HOME////\/}/" configure
209+
if [ -n "${OPTIX_HOME}" ] && [ -d ${OPTIX_HOME} ] ; then
210+
sed -i 's/"\/usr\/local\/encap\/NVIDIA-OptiX-SDK-6.5.0-linux64"/$ENV{OPTIX_HOME}/' configure
192211
VMD_OPTS+=(LIBOPTIX)
193212
fi
194213
fi

0 commit comments

Comments
 (0)