forked from portelli/lattice-benchmarks
		
	Grid benchmark build system fix
This commit is contained in:
		@@ -3,10 +3,10 @@ ACLOCAL_AMFLAGS = -I .buildutils/m4
 | 
			
		||||
bin_PROGRAMS =                \
 | 
			
		||||
  Benchmark_comms_host_device \
 | 
			
		||||
  Benchmark_dwf_fp32          \
 | 
			
		||||
  Benchmark_ITT               \
 | 
			
		||||
  Benchmark_Grid              \
 | 
			
		||||
  Benchmark_IO
 | 
			
		||||
  
 | 
			
		||||
Benchmark_comms_host_device_SOURCES = Benchmark_comms_host_device.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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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_HOST
 | 
			
		||||
AC_CANONICAL_TARGET
 | 
			
		||||
AC_CONFIG_SRCDIR([Benchmark_ITT.cpp])
 | 
			
		||||
AC_CONFIG_SRCDIR([Benchmark_Grid.cpp])
 | 
			
		||||
AC_CONFIG_MACRO_DIR([.buildutils/m4])
 | 
			
		||||
AC_CONFIG_HEADERS([config.h])
 | 
			
		||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 | 
			
		||||
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],
 | 
			
		||||
    [AS_HELP_STRING([--with-grid=<prefix>],
 | 
			
		||||
    [try this for a non-standard install prefix of Grid])],
 | 
			
		||||
    [PATH="$with_grid/bin$PATH_SEPARATOR$PATH"]
 | 
			
		||||
    [CXXFLAGS="$CXXFLAGS -I$with_grid/include"]
 | 
			
		||||
    [LDFLAGS="$LDFLAGS -L$with_grid/lib"])
 | 
			
		||||
 | 
			
		||||
AC_CHECK_PROG([GRIDCONF],[grid-config],[yes])
 | 
			
		||||
if test x"$GRIDCONF" != x"yes" ; then
 | 
			
		||||
    AC_MSG_ERROR([grid-config not found])
 | 
			
		||||
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`"
 | 
			
		||||
LDFLAGS="$LDFLAGS `grid-config --ldflags`"
 | 
			
		||||
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
 | 
			
		||||
 | 
			
		||||
AC_PROG_CC
 | 
			
		||||
AM_PROG_CC_C_O
 | 
			
		||||
AC_PROG_CXX
 | 
			
		||||
 | 
			
		||||
LDFLAGS="$LDFLAGS `grid-config --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_LINK_IFELSE(
 | 
			
		||||
        [AC_LANG_SOURCE([[
 | 
			
		||||
	[AC_LANG_SOURCE([[
 | 
			
		||||
    #include <Grid/Grid.h>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    using namespace Grid;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    int main(int argc, char *argv[])
 | 
			
		||||
    {
 | 
			
		||||
        Grid_init(&argc, &argv);
 | 
			
		||||
        Grid_finalize();
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    ]])],
 | 
			
		||||
        [AC_MSG_RESULT([yes])],
 | 
			
		||||
	[AC_MSG_RESULT([yes])],
 | 
			
		||||
    [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_LDFLAGS])
 | 
			
		||||
AC_CONFIG_FILES([Makefile])
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user