1
0
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:
Peter Boyle 2015-03-04 04:53:40 +00:00
parent 74f28edbe5
commit c80c881db0
11 changed files with 50 additions and 13 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
*.o *.o
*.obj *.obj
*~ *~
errs
# Precompiled Headers # Precompiled Headers
*.gch *.gch

0
AUTHORS Normal file
View File

1
COPYING Symbolic link
View File

@ -0,0 +1 @@
/opt/local/share/automake-1.15/COPYING

0
ChangeLog Normal file
View File

View File

@ -27,23 +27,31 @@ int main (int argc, char ** argv)
std::vector<int> latt_size(4); std::vector<int> latt_size(4);
std::vector<int> simd_layout(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 #ifdef OMP
omp_set_num_threads(omp); omp_set_num_threads(omp);
#endif #endif
for(int lat=16;lat<=32;lat+=8){ for(int lat=8;lat<=12;lat+=2){
latt_size[0] = lat; latt_size[0] = lat;
latt_size[1] = lat; latt_size[1] = lat;
latt_size[2] = lat; latt_size[2] = lat;
latt_size[3] = lat; latt_size[3] = lat;
double volume = latt_size[0]*latt_size[1]*latt_size[2]*latt_size[3]; double volume = latt_size[0]*latt_size[1]*latt_size[2]*latt_size[3];
#ifdef AVX512
simd_layout[0] = 1; simd_layout[0] = 1;
simd_layout[1] = 2; simd_layout[1] = 2;
simd_layout[2] = 2; simd_layout[2] = 2;
simd_layout[3] = 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); GridCartesian Fine(latt_size,simd_layout);
GridRedBlackCartesian rbFine(latt_size,simd_layout); GridRedBlackCartesian rbFine(latt_size,simd_layout);

View File

@ -13,7 +13,7 @@
#include "Grid.h" #include "Grid.h"
#define __X86_64 #undef __X86_64
namespace dpo { namespace dpo {
void Grid_sa_signal_handler(int sig,siginfo_t *si,void * ptr); 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) void Grid_sa_signal_handler(int sig,siginfo_t *si,void * ptr)
{ {
ucontext_t * uc= (ucontext_t *)ptr; ucontext_t * uc= (ucontext_t *)ptr;
struct sigcontext *sc = (struct sigcontext *)&uc->uc_mcontext;
printf("Caught signal %d\n",si->si_signo); 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(" code %d\n",si->si_code);
printf(" instruction %lx\n",sc->rip);
#ifdef __X86_64 #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); #define REG(A) printf(" %s %lx\n",#A, sc-> A);
REG(rdi); REG(rdi);
REG(rsi); REG(rsi);

1
INSTALL Symbolic link
View File

@ -0,0 +1 @@
/opt/local/share/automake-1.15/INSTALL

27
Makefile.am Normal file
View 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

0
NEWS Normal file
View File

0
README Normal file
View File

View File

@ -1,6 +1,7 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ([2.69])
AC_INIT([Grid], [1.0], [paboyle@ph.ed.ac.uk]) AC_INIT([Grid], [1.0], [paboyle@ph.ed.ac.uk])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([Grid.h]) AC_CONFIG_SRCDIR([Grid.h])
AC_CONFIG_HEADERS([Grid_config.h]) AC_CONFIG_HEADERS([Grid_config.h])
@ -8,6 +9,7 @@ AC_CONFIG_HEADERS([Grid_config.h])
# Checks for programs. # Checks for programs.
AC_PROG_CXX AC_PROG_CXX
AC_OPENMP AC_OPENMP
AC_PROG_RANLIB
# Checks for libraries. # Checks for libraries.
AX_GCC_VAR_ATTRIBUTE(aligned) AX_GCC_VAR_ATTRIBUTE(aligned)
@ -25,20 +27,16 @@ AC_TYPE_UINT64_T
# Checks for library functions. # Checks for library functions.
AC_CHECK_FUNCS([gettimeofday]) 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 case ${ac_SIMD} in
SSE)
echo Configuring for SSE1
AC_DEFINE([SSE],[1],[SSE] )
;;
SSE2) SSE2)
echo Configuring for SSE2 echo Configuring for SSE2
AC_DEFINE([SSE2],[1],[SSE2] ) AC_DEFINE([SSE2],[1],[SSE2] )
;; ;;
AVX) AVX)
echo Configuring for AVX echo Configuring for AVX
AC_DEFINE([AVX],[1],[AVX] ) AC_DEFINE([AVX1],[1],[AVX] )
;; ;;
AVX2) AVX2)
echo Configuring for AVX2 echo Configuring for AVX2
@ -53,4 +51,5 @@ case ${ac_SIMD} in
;; ;;
esac esac
AC_CONFIG_FILES(Makefile)
AC_OUTPUT AC_OUTPUT