mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-09 23:45:36 +00:00
Updating build system
This commit is contained in:
parent
74f28edbe5
commit
c80c881db0
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@
|
||||
*.o
|
||||
*.obj
|
||||
*~
|
||||
errs
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
|
12
Grid_main.cc
12
Grid_main.cc
@ -27,23 +27,31 @@ int main (int argc, char ** argv)
|
||||
std::vector<int> latt_size(4);
|
||||
std::vector<int> simd_layout(4);
|
||||
|
||||
for(int omp=32;omp<237;omp*=2){
|
||||
for(int omp=1;omp<2;omp*=2){
|
||||
|
||||
#ifdef OMP
|
||||
omp_set_num_threads(omp);
|
||||
#endif
|
||||
|
||||
for(int lat=16;lat<=32;lat+=8){
|
||||
for(int lat=8;lat<=12;lat+=2){
|
||||
latt_size[0] = lat;
|
||||
latt_size[1] = lat;
|
||||
latt_size[2] = lat;
|
||||
latt_size[3] = lat;
|
||||
double volume = latt_size[0]*latt_size[1]*latt_size[2]*latt_size[3];
|
||||
|
||||
#ifdef AVX512
|
||||
simd_layout[0] = 1;
|
||||
simd_layout[1] = 2;
|
||||
simd_layout[2] = 2;
|
||||
simd_layout[3] = 2;
|
||||
#endif
|
||||
#ifdef AVX1
|
||||
simd_layout[0] = 1;
|
||||
simd_layout[1] = 1;
|
||||
simd_layout[2] = 2;
|
||||
simd_layout[3] = 2;
|
||||
#endif
|
||||
|
||||
GridCartesian Fine(latt_size,simd_layout);
|
||||
GridRedBlackCartesian rbFine(latt_size,simd_layout);
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "Grid.h"
|
||||
|
||||
#define __X86_64
|
||||
#undef __X86_64
|
||||
namespace dpo {
|
||||
|
||||
void Grid_sa_signal_handler(int sig,siginfo_t *si,void * ptr);
|
||||
@ -27,15 +27,15 @@ namespace dpo {
|
||||
void Grid_sa_signal_handler(int sig,siginfo_t *si,void * ptr)
|
||||
{
|
||||
ucontext_t * uc= (ucontext_t *)ptr;
|
||||
struct sigcontext *sc = (struct sigcontext *)&uc->uc_mcontext;
|
||||
|
||||
printf("Caught signal %d\n",si->si_signo);
|
||||
printf(" mem address %lx\n",si->si_addr);
|
||||
printf(" mem address %llx\n",(uint64_t)si->si_addr);
|
||||
printf(" code %d\n",si->si_code);
|
||||
|
||||
printf(" instruction %lx\n",sc->rip);
|
||||
|
||||
#ifdef __X86_64
|
||||
struct sigcontext *sc = (struct sigcontext *)&uc->uc_mcontext;
|
||||
printf(" instruction %llx\n",(uint64_t)sc->rip);
|
||||
|
||||
#define REG(A) printf(" %s %lx\n",#A, sc-> A);
|
||||
REG(rdi);
|
||||
REG(rsi);
|
||||
|
27
Makefile.am
Normal file
27
Makefile.am
Normal file
@ -0,0 +1,27 @@
|
||||
# additional include paths necessary to compile the C++ library
|
||||
AM_CXXFLAGS = -I$(top_srcdir)/
|
||||
|
||||
#
|
||||
# Libraries
|
||||
#
|
||||
lib_LIBRARIES = libGrid.a
|
||||
libGrid_a_SOURCES = Grid_signal.cc
|
||||
|
||||
#
|
||||
# Include files
|
||||
#
|
||||
include_HEADERS = Grid.h\
|
||||
Grid_vComplexD.h\
|
||||
Grid_vComplexF.h\
|
||||
Grid_vRealD.h\
|
||||
Grid_vRealF.h\
|
||||
Grid_Cartesian.h\
|
||||
Grid_Lattice.h\
|
||||
Grid_config.h
|
||||
|
||||
#
|
||||
# Test code
|
||||
#
|
||||
bin_PROGRAMS = Grid_main
|
||||
Grid_main_SOURCES = Grid_main.cc
|
||||
Grid_main_LDADD = libGrid.a
|
11
configure.ac
11
configure.ac
@ -1,6 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([Grid], [1.0], [paboyle@ph.ed.ac.uk])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_SRCDIR([Grid.h])
|
||||
AC_CONFIG_HEADERS([Grid_config.h])
|
||||
@ -8,6 +9,7 @@ AC_CONFIG_HEADERS([Grid_config.h])
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_OPENMP
|
||||
AC_PROG_RANLIB
|
||||
|
||||
# Checks for libraries.
|
||||
AX_GCC_VAR_ATTRIBUTE(aligned)
|
||||
@ -25,20 +27,16 @@ AC_TYPE_UINT64_T
|
||||
# Checks for library functions.
|
||||
AC_CHECK_FUNCS([gettimeofday])
|
||||
|
||||
AC_ARG_ENABLE([simd],[AC_HELP_STRING([--enable-simd=AVX|AVX2|SSE|SSE2|AVX512],[Select instructions])],[ac_SIMD=${enable_simd}],[ac_SIMD=AVX2])
|
||||
AC_ARG_ENABLE([simd],[AC_HELP_STRING([--enable-simd=SSE|AVX|AVX2|AVX512],[Select instructions])],[ac_SIMD=${enable_simd}],[ac_SIMD=AVX2])
|
||||
|
||||
case ${ac_SIMD} in
|
||||
SSE)
|
||||
echo Configuring for SSE1
|
||||
AC_DEFINE([SSE],[1],[SSE] )
|
||||
;;
|
||||
SSE2)
|
||||
echo Configuring for SSE2
|
||||
AC_DEFINE([SSE2],[1],[SSE2] )
|
||||
;;
|
||||
AVX)
|
||||
echo Configuring for AVX
|
||||
AC_DEFINE([AVX],[1],[AVX] )
|
||||
AC_DEFINE([AVX1],[1],[AVX] )
|
||||
;;
|
||||
AVX2)
|
||||
echo Configuring for AVX2
|
||||
@ -53,4 +51,5 @@ case ${ac_SIMD} in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CONFIG_FILES(Makefile)
|
||||
AC_OUTPUT
|
||||
|
Loading…
Reference in New Issue
Block a user