Grid benchmark build system fix
This commit is contained in:
parent
c6349bb93f
commit
4d881dcd54
@ -3,10 +3,10 @@ ACLOCAL_AMFLAGS = -I .buildutils/m4
|
|||||||
bin_PROGRAMS = \
|
bin_PROGRAMS = \
|
||||||
Benchmark_comms_host_device \
|
Benchmark_comms_host_device \
|
||||||
Benchmark_dwf_fp32 \
|
Benchmark_dwf_fp32 \
|
||||||
Benchmark_ITT \
|
Benchmark_Grid \
|
||||||
Benchmark_IO
|
Benchmark_IO
|
||||||
|
|
||||||
Benchmark_comms_host_device_SOURCES = Benchmark_comms_host_device.cpp
|
Benchmark_comms_host_device_SOURCES = Benchmark_comms_host_device.cpp
|
||||||
Benchmark_dwf_fp32_SOURCES = Benchmark_dwf_fp32.cpp
|
Benchmark_dwf_fp32_SOURCES = Benchmark_dwf_fp32.cpp
|
||||||
Benchmark_ITT_SOURCES = Benchmark_ITT.cpp
|
Benchmark_Grid_SOURCES = Benchmark_Grid.cpp
|
||||||
Benchmark_IO_SOURCES = Benchmark_IO.cpp
|
Benchmark_IO_SOURCES = Benchmark_IO.cpp
|
||||||
|
33
Grid/build-benchmark.sh
Executable file
33
Grid/build-benchmark.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if (( $# != 2 )); then
|
||||||
|
echo "usage: $(basename "$0") <environment directory> <config>" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
env_dir=$1
|
||||||
|
cfg=$2
|
||||||
|
|
||||||
|
call_dir=$(pwd -P)
|
||||||
|
script_dir="$(dirname "$(readlink -f "${BASH_SOURCE:-$0}")")"
|
||||||
|
cd "${env_dir}"
|
||||||
|
env_dir=$(pwd -P)
|
||||||
|
cd "${call_dir}"
|
||||||
|
build_dir="${env_dir}/build/Grid-benchmarks/${cfg}"
|
||||||
|
if [ -d "${build_dir}" ]; then
|
||||||
|
echo "error: directory '${build_dir}' exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
mkdir -p "${build_dir}"
|
||||||
|
source "${env_dir}/env.sh"
|
||||||
|
entry=$(jq ".configs[]|select(.name==\"${cfg}\")" "${env_dir}"/grid-config.json)
|
||||||
|
env_script=$(echo "${entry}" | jq -r ".\"env-script\"")
|
||||||
|
cd "${build_dir}" || return
|
||||||
|
source "${env_dir}/${env_script}"
|
||||||
|
"${script_dir}/configure" --with-grid="${env_dir}/prefix/grid_${cfg}" \
|
||||||
|
--prefix="${env_dir}/prefix/gridbench_${cfg}"
|
||||||
|
make -j 128
|
||||||
|
make install
|
||||||
|
cd "${call_dir}"
|
@ -3,55 +3,69 @@ AC_INIT([lattice-bench], [0.1], [antonin.portelli@me.com])
|
|||||||
AC_CANONICAL_BUILD
|
AC_CANONICAL_BUILD
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
AC_CANONICAL_TARGET
|
AC_CANONICAL_TARGET
|
||||||
AC_CONFIG_SRCDIR([Benchmark_ITT.cpp])
|
AC_CONFIG_SRCDIR([Benchmark_Grid.cpp])
|
||||||
AC_CONFIG_MACRO_DIR([.buildutils/m4])
|
AC_CONFIG_MACRO_DIR([.buildutils/m4])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
||||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||||
|
|
||||||
# Checks for programs.
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_PROG_RANLIB
|
|
||||||
AM_PROG_AR
|
|
||||||
AC_LANG([C++])
|
|
||||||
|
|
||||||
AC_ARG_WITH([grid],
|
AC_ARG_WITH([grid],
|
||||||
[AS_HELP_STRING([--with-grid=<prefix>],
|
[AS_HELP_STRING([--with-grid=<prefix>],
|
||||||
[try this for a non-standard install prefix of Grid])],
|
[try this for a non-standard install prefix of Grid])],
|
||||||
[PATH="$with_grid/bin$PATH_SEPARATOR$PATH"]
|
[PATH="$with_grid/bin$PATH_SEPARATOR$PATH"]
|
||||||
[CXXFLAGS="$CXXFLAGS -I$with_grid/include"]
|
[CXXFLAGS="$CXXFLAGS -I$with_grid/include"]
|
||||||
[LDFLAGS="$LDFLAGS -L$with_grid/lib"])
|
[LDFLAGS="$LDFLAGS -L$with_grid/lib"])
|
||||||
|
|
||||||
AC_CHECK_PROG([GRIDCONF],[grid-config],[yes])
|
AC_CHECK_PROG([GRIDCONF],[grid-config],[yes])
|
||||||
if test x"$GRIDCONF" != x"yes" ; then
|
if test x"$GRIDCONF" != x"yes" ; then
|
||||||
AC_MSG_ERROR([grid-config not found])
|
AC_MSG_ERROR([grid-config not found])
|
||||||
fi
|
fi
|
||||||
|
if test x"$CXX" == x ; then
|
||||||
|
CXX="`grid-config --cxx`"
|
||||||
|
elif test "$CXX" != "`grid-config --cxx`" ; then
|
||||||
|
AC_MSG_WARN([CXX differs from that reported by grid-config])
|
||||||
|
fi
|
||||||
|
if test x"$CXXLD" == x ; then
|
||||||
|
CXXLD="`grid-config --cxxld`"
|
||||||
|
elif test "$CXXLD" != "`grid-config --cxxld`" ; then
|
||||||
|
AC_MSG_WARN([CXXLD differs from that reported by grid-config])
|
||||||
|
fi
|
||||||
CXXFLAGS="$CXXFLAGS `grid-config --cxxflags`"
|
CXXFLAGS="$CXXFLAGS `grid-config --cxxflags`"
|
||||||
LDFLAGS="$LDFLAGS `grid-config --ldflags`"
|
|
||||||
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
||||||
|
|
||||||
|
AC_PROG_CC
|
||||||
|
AM_PROG_CC_C_O
|
||||||
|
AC_PROG_CXX
|
||||||
|
|
||||||
|
LDFLAGS="$LDFLAGS `grid-config --ldflags`"
|
||||||
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
||||||
LIBS=" -lGrid $LIBS `grid-config --libs`"
|
LIBS=" -ldl -lGrid $LIBS `grid-config --libs`"
|
||||||
|
|
||||||
|
AC_PROG_RANLIB
|
||||||
|
AM_PROG_AR
|
||||||
|
AC_LANG([C++])
|
||||||
|
|
||||||
AC_MSG_CHECKING([that a minimal Grid program compiles]);
|
AC_MSG_CHECKING([that a minimal Grid program compiles]);
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
[AC_LANG_SOURCE([[
|
[AC_LANG_SOURCE([[
|
||||||
#include <Grid/Grid.h>
|
#include <Grid/Grid.h>
|
||||||
|
|
||||||
using namespace Grid;
|
using namespace Grid;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Grid_init(&argc, &argv);
|
Grid_init(&argc, &argv);
|
||||||
Grid_finalize();
|
Grid_finalize();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
]])],
|
]])],
|
||||||
[AC_MSG_RESULT([yes])],
|
[AC_MSG_RESULT([yes])],
|
||||||
[AC_MSG_RESULT([no])]
|
[AC_MSG_RESULT([no])]
|
||||||
[AC_MSG_ERROR([Could not compile a minimal Grid program])])
|
[AC_MSG_ERROR([impossible to compile a minimal Grid program])])
|
||||||
|
|
||||||
|
AC_SUBST([CXXLD])
|
||||||
AC_SUBST([AM_CXXFLAGS])
|
AC_SUBST([AM_CXXFLAGS])
|
||||||
AC_SUBST([AM_LDFLAGS])
|
AC_SUBST([AM_LDFLAGS])
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
|
Loading…
Reference in New Issue
Block a user