diff --git a/Grid/Makefile.am b/Grid/Makefile.am index 8c7cb5c525..68d92f3134 100644 --- a/Grid/Makefile.am +++ b/Grid/Makefile.am @@ -54,23 +54,25 @@ Version.h: version-cache include Make.inc include Eigen.inc -extra_sources+=$(WILS_FERMION_FILES) -extra_sources+=$(STAG_FERMION_FILES) -if BUILD_ZMOBIUS - extra_sources+=$(ZWILS_FERMION_FILES) -endif -if BUILD_GPARITY - extra_sources+=$(GP_FERMION_FILES) -endif -if BUILD_FERMION_REPS - extra_sources+=$(ADJ_FERMION_FILES) - extra_sources+=$(TWOIND_FERMION_FILES) -endif -if BUILD_SP +if BUILD_FERMION_INSTANTIATIONS + extra_sources+=$(WILS_FERMION_FILES) + extra_sources+=$(STAG_FERMION_FILES) + if BUILD_ZMOBIUS + extra_sources+=$(ZWILS_FERMION_FILES) + endif + if BUILD_GPARITY + extra_sources+=$(GP_FERMION_FILES) + endif + if BUILD_FERMION_REPS + extra_sources+=$(ADJ_FERMION_FILES) + extra_sources+=$(TWOIND_FERMION_FILES) + endif + if BUILD_SP extra_sources+=$(SP_FERMION_FILES) -if BUILD_FERMION_REPS - extra_sources+=$(SP_TWOIND_FERMION_FILES) -endif + if BUILD_FERMION_REPS + extra_sources+=$(SP_TWOIND_FERMION_FILES) + endif + endif endif lib_LIBRARIES = libGrid.a diff --git a/HMC/FTHMC2p1f.cc b/HMC/FTHMC2p1f.cc index 1e914e872f..6a18466ea9 100644 --- a/HMC/FTHMC2p1f.cc +++ b/HMC/FTHMC2p1f.cc @@ -24,7 +24,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include #if Nc == 3 #include @@ -230,3 +234,4 @@ int main(int argc, char **argv) #endif } // main +#endif diff --git a/HMC/FTHMC2p1f_3GeV.cc b/HMC/FTHMC2p1f_3GeV.cc index 36d5caa3b5..db2b937b2c 100644 --- a/HMC/FTHMC2p1f_3GeV.cc +++ b/HMC/FTHMC2p1f_3GeV.cc @@ -25,7 +25,11 @@ directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include #if Nc == 3 #include @@ -231,5 +235,4 @@ int main(int argc, char **argv) #endif } // main - - +#endif diff --git a/HMC/HMC2p1f_3GeV.cc b/HMC/HMC2p1f_3GeV.cc index 199d4be818..d97b03c660 100644 --- a/HMC/HMC2p1f_3GeV.cc +++ b/HMC/HMC2p1f_3GeV.cc @@ -24,7 +24,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include #if Nc == 3 #include @@ -230,5 +234,4 @@ int main(int argc, char **argv) #endif } // main - - +#endif diff --git a/HMC/Mobius2p1f.cc b/HMC/Mobius2p1f.cc index 8042d6e6b2..b6b9da0653 100644 --- a/HMC/Mobius2p1f.cc +++ b/HMC/Mobius2p1f.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include int main(int argc, char **argv) { using namespace Grid; @@ -195,5 +199,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1fEOFA.cc b/HMC/Mobius2p1fEOFA.cc index e7b0e473be..ce7518d9c4 100644 --- a/HMC/Mobius2p1fEOFA.cc +++ b/HMC/Mobius2p1fEOFA.cc @@ -28,7 +28,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include #ifdef GRID_DEFAULT_PRECISION_DOUBLE #define MIXED_PRECISION @@ -449,5 +453,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1fEOFA_F1.cc b/HMC/Mobius2p1fEOFA_F1.cc index d9fec4fa7a..e9f2bb3bcc 100644 --- a/HMC/Mobius2p1fEOFA_F1.cc +++ b/HMC/Mobius2p1fEOFA_F1.cc @@ -28,7 +28,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include #ifdef GRID_DEFAULT_PRECISION_DOUBLE #define MIXED_PRECISION @@ -442,5 +446,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1fIDSDRGparityEOFA_40ID.cc b/HMC/Mobius2p1fIDSDRGparityEOFA_40ID.cc index 2825d403e9..3fe94313f3 100644 --- a/HMC/Mobius2p1fIDSDRGparityEOFA_40ID.cc +++ b/HMC/Mobius2p1fIDSDRGparityEOFA_40ID.cc @@ -28,7 +28,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include using namespace Grid; @@ -918,3 +922,5 @@ int main(int argc, char **argv) { return 0; #endif } // main + +#endif diff --git a/HMC/Mobius2p1fIDSDRGparityEOFA_48ID.cc b/HMC/Mobius2p1fIDSDRGparityEOFA_48ID.cc index 4c1b5856c7..d8a50f6b07 100644 --- a/HMC/Mobius2p1fIDSDRGparityEOFA_48ID.cc +++ b/HMC/Mobius2p1fIDSDRGparityEOFA_48ID.cc @@ -28,7 +28,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include using namespace Grid; @@ -873,3 +877,5 @@ int main(int argc, char **argv) { return 0; #endif } // main + +#endif diff --git a/HMC/Mobius2p1fRHMC.cc b/HMC/Mobius2p1fRHMC.cc index 288a6c5476..c49995b88f 100644 --- a/HMC/Mobius2p1fRHMC.cc +++ b/HMC/Mobius2p1fRHMC.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include int main(int argc, char **argv) { using namespace Grid; @@ -193,5 +197,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_EOFA_96I_3level.cc b/HMC/Mobius2p1f_DD_EOFA_96I_3level.cc index c0b5ced1c3..1aa2233269 100644 --- a/HMC/Mobius2p1f_DD_EOFA_96I_3level.cc +++ b/HMC/Mobius2p1f_DD_EOFA_96I_3level.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include NAMESPACE_BEGIN(Grid); @@ -512,5 +516,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_EOFA_96I_double.cc b/HMC/Mobius2p1f_DD_EOFA_96I_double.cc index 678df9810d..1c477cb20a 100644 --- a/HMC/Mobius2p1f_DD_EOFA_96I_double.cc +++ b/HMC/Mobius2p1f_DD_EOFA_96I_double.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include int main(int argc, char **argv) { using namespace Grid; @@ -345,5 +349,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_EOFA_96I_mixed.cc b/HMC/Mobius2p1f_DD_EOFA_96I_mixed.cc index becfac530d..44a153d2f4 100644 --- a/HMC/Mobius2p1f_DD_EOFA_96I_mixed.cc +++ b/HMC/Mobius2p1f_DD_EOFA_96I_mixed.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include NAMESPACE_BEGIN(Grid); @@ -516,5 +520,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_EOFA_96I_mshift.cc b/HMC/Mobius2p1f_DD_EOFA_96I_mshift.cc index 7ae96dcd35..d2dd3b9eb7 100644 --- a/HMC/Mobius2p1f_DD_EOFA_96I_mshift.cc +++ b/HMC/Mobius2p1f_DD_EOFA_96I_mshift.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include NAMESPACE_BEGIN(Grid); @@ -567,5 +571,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_RHMC.cc b/HMC/Mobius2p1f_DD_RHMC.cc index 39b4c1dd50..a95b5b2e0a 100644 --- a/HMC/Mobius2p1f_DD_RHMC.cc +++ b/HMC/Mobius2p1f_DD_RHMC.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include int main(int argc, char **argv) { using namespace Grid; @@ -263,5 +267,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_RHMC_96I.cc b/HMC/Mobius2p1f_DD_RHMC_96I.cc index c28296a330..d2d10d2d80 100644 --- a/HMC/Mobius2p1f_DD_RHMC_96I.cc +++ b/HMC/Mobius2p1f_DD_RHMC_96I.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include int main(int argc, char **argv) { using namespace Grid; @@ -417,5 +421,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_DD_RHMC_96I_mixed.cc b/HMC/Mobius2p1f_DD_RHMC_96I_mixed.cc index 864cefcc1d..5a1bdb1581 100644 --- a/HMC/Mobius2p1f_DD_RHMC_96I_mixed.cc +++ b/HMC/Mobius2p1f_DD_RHMC_96I_mixed.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include NAMESPACE_BEGIN(Grid); @@ -452,5 +456,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_EOFA_96I_hmc.cc b/HMC/Mobius2p1f_EOFA_96I_hmc.cc index d967d55a8c..b4999fc331 100644 --- a/HMC/Mobius2p1f_EOFA_96I_hmc.cc +++ b/HMC/Mobius2p1f_EOFA_96I_hmc.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include NAMESPACE_BEGIN(Grid); @@ -462,5 +466,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/Mobius2p1f_EOFA_96I_hmc_double.cc b/HMC/Mobius2p1f_EOFA_96I_hmc_double.cc index 61b32b5ce0..201866a00e 100644 --- a/HMC/Mobius2p1f_EOFA_96I_hmc_double.cc +++ b/HMC/Mobius2p1f_EOFA_96I_hmc_double.cc @@ -27,7 +27,11 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ -#include + +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + +#include @@ -264,5 +268,4 @@ int main(int argc, char **argv) { Grid_finalize(); } // main - - +#endif diff --git a/HMC/disable_examples_without_instantiations.h b/HMC/disable_examples_without_instantiations.h new file mode 100644 index 0000000000..79dbe9c6fc --- /dev/null +++ b/HMC/disable_examples_without_instantiations.h @@ -0,0 +1,14 @@ +#pragma once + +#ifndef BUILD_FERMION_INSTANTIATIONS +#include + +int main(void) { + std::cout << "This build of Grid was configured to exclude fermion instantiations, " + << "which this example relies on. " + << "Please reconfigure and rebuild Grid with --enable-fermion-instantiations" + << "to run this example." + << std::endl; + return 1; +} +#endif diff --git a/benchmarks/Benchmark_ITT.cc b/benchmarks/Benchmark_ITT.cc index 48980b2ce4..64255b9953 100644 --- a/benchmarks/Benchmark_ITT.cc +++ b/benchmarks/Benchmark_ITT.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace Grid; @@ -731,3 +734,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/benchmarks/Benchmark_dwf.cc b/benchmarks/Benchmark_dwf.cc index d74037054d..c28b2686a0 100644 --- a/benchmarks/Benchmark_dwf.cc +++ b/benchmarks/Benchmark_dwf.cc @@ -20,6 +20,9 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include #ifdef GRID_CUDA #define CUDA_PROFILE @@ -439,3 +442,4 @@ void Benchmark(int Ls, Coordinate Dirichlet,bool sloppy) GRID_ASSERT(norm2(src_e)<1.0e-4); GRID_ASSERT(norm2(src_o)<1.0e-4); } +#endif diff --git a/benchmarks/Benchmark_dwf_fp32.cc b/benchmarks/Benchmark_dwf_fp32.cc index 03dce1df95..20a695f5fb 100644 --- a/benchmarks/Benchmark_dwf_fp32.cc +++ b/benchmarks/Benchmark_dwf_fp32.cc @@ -20,6 +20,9 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include #ifdef GRID_CUDA #define CUDA_PROFILE @@ -439,3 +442,5 @@ void Benchmark(int Ls, Coordinate Dirichlet,bool sloppy) GRID_ASSERT(norm2(src_e)<1.0e-4); GRID_ASSERT(norm2(src_o)<1.0e-4); } + +#endif diff --git a/benchmarks/Benchmark_dwf_fp32_paranoid.cc b/benchmarks/Benchmark_dwf_fp32_paranoid.cc index e00901285f..67317313a2 100644 --- a/benchmarks/Benchmark_dwf_fp32_paranoid.cc +++ b/benchmarks/Benchmark_dwf_fp32_paranoid.cc @@ -20,6 +20,9 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include #ifdef GRID_CUDA #define CUDA_PROFILE @@ -385,3 +388,5 @@ int main (int argc, char ** argv) Grid_finalize(); exit(0); } + +#endif diff --git a/benchmarks/Benchmark_dwf_sweep.cc b/benchmarks/Benchmark_dwf_sweep.cc index 2f11eb22e4..a3ccc9e3bf 100644 --- a/benchmarks/Benchmark_dwf_sweep.cc +++ b/benchmarks/Benchmark_dwf_sweep.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -238,5 +241,4 @@ void benchDw(std::vector & latt4, int Ls, int threads,int report ) } } - - +#endif diff --git a/benchmarks/Benchmark_gparity.cc b/benchmarks/Benchmark_gparity.cc index 421dd3cd8a..1cfa2127b6 100644 --- a/benchmarks/Benchmark_gparity.cc +++ b/benchmarks/Benchmark_gparity.cc @@ -1,3 +1,7 @@ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + + #include #include using namespace std; @@ -155,3 +159,4 @@ int main (int argc, char ** argv) Grid_finalize(); } +#endif diff --git a/benchmarks/Benchmark_halo.cc b/benchmarks/Benchmark_halo.cc index 43138e67ab..f95c29adc6 100644 --- a/benchmarks/Benchmark_halo.cc +++ b/benchmarks/Benchmark_halo.cc @@ -20,6 +20,9 @@ See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include #ifdef GRID_CUDA #define CUDA_PROFILE @@ -129,3 +132,5 @@ int main (int argc, char ** argv) Grid_finalize(); exit(0); } + +#endif diff --git a/benchmarks/Benchmark_mooee.cc b/benchmarks/Benchmark_mooee.cc index 54235752f3..d3d39126fe 100644 --- a/benchmarks/Benchmark_mooee.cc +++ b/benchmarks/Benchmark_mooee.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -149,3 +152,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/benchmarks/Benchmark_schur.cc b/benchmarks/Benchmark_schur.cc index 8171998a86..644a158ca8 100644 --- a/benchmarks/Benchmark_schur.cc +++ b/benchmarks/Benchmark_schur.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -172,5 +175,4 @@ void benchDw(std::vector & latt4, int Ls) // Dw.Report(); } - - +#endif diff --git a/benchmarks/Benchmark_staggered.cc b/benchmarks/Benchmark_staggered.cc index a2be7f624a..65e04f2753 100644 --- a/benchmarks/Benchmark_staggered.cc +++ b/benchmarks/Benchmark_staggered.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -110,3 +113,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/benchmarks/Benchmark_staggeredF.cc b/benchmarks/Benchmark_staggeredF.cc index f7beed2df7..e0f4331f5a 100644 --- a/benchmarks/Benchmark_staggeredF.cc +++ b/benchmarks/Benchmark_staggeredF.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -112,3 +115,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/benchmarks/Benchmark_usqcd.cc b/benchmarks/Benchmark_usqcd.cc index 7048941988..34a0d6ecd2 100644 --- a/benchmarks/Benchmark_usqcd.cc +++ b/benchmarks/Benchmark_usqcd.cc @@ -26,6 +26,10 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + + #include #include @@ -978,3 +982,5 @@ int main (int argc, char ** argv) Grid_finalize(); fclose(FP); } + +#endif diff --git a/benchmarks/Benchmark_wilson.cc b/benchmarks/Benchmark_wilson.cc index 3572f6b175..ac2b8ebdb8 100644 --- a/benchmarks/Benchmark_wilson.cc +++ b/benchmarks/Benchmark_wilson.cc @@ -26,6 +26,9 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -258,3 +261,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/benchmarks/Benchmark_wilson_sweep.cc b/benchmarks/Benchmark_wilson_sweep.cc index 45a10b250e..6f840d56a9 100644 --- a/benchmarks/Benchmark_wilson_sweep.cc +++ b/benchmarks/Benchmark_wilson_sweep.cc @@ -19,6 +19,9 @@ Author: Richard Rollins See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_benchmarks_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -161,3 +164,5 @@ void bench_wilson_eo ( double flops = (single_site_flops * volume * ncall)/2.0; std::cout << flops/(t1-t0) << "\t\t"; } + +#endif diff --git a/benchmarks/disable_benchmarks_without_instantiations.h b/benchmarks/disable_benchmarks_without_instantiations.h new file mode 100644 index 0000000000..c93fd0a982 --- /dev/null +++ b/benchmarks/disable_benchmarks_without_instantiations.h @@ -0,0 +1,14 @@ +#pragma once + +#ifndef BUILD_FERMION_INSTANTIATIONS +#include + +int main(void) { + std::cout << "This build of Grid was configured to exclude fermion instantiations, " + << "which this benchmark relies on. " + << "Please reconfigure and rebuild Grid with --enable-fermion-instantiations" + << "to run this benchmark." + << std::endl; + return 1; +} +#endif diff --git a/configure.ac b/configure.ac index 55ceed3ba4..dce70db192 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,12 @@ case ${ac_TRACING} in esac ############### fermions +AC_ARG_ENABLE([fermion-instantiations], + [AS_HELP_STRING([--enable-fermion-instantiations=yes|no],[enable fermion instantiations])], + [ac_FERMION_REPS=${enable_fermion_instantiations}], [ac_FERMION_INSTANTIATIONS=yes]) + +AM_CONDITIONAL(BUILD_FERMION_INSTANTIATIONS, [ test "${ac_FERMION_INSTANTIATIONS}X" == "yesX" ]) + AC_ARG_ENABLE([fermion-reps], [AS_HELP_STRING([--enable-fermion-reps=yes|no],[enable extra fermion representation support])], [ac_FERMION_REPS=${enable_fermion_reps}], [ac_FERMION_REPS=yes]) diff --git a/examples/Example_Mobius_spectrum.cc b/examples/Example_Mobius_spectrum.cc index 65b7b7dee6..51609c69c2 100644 --- a/examples/Example_Mobius_spectrum.cc +++ b/examples/Example_Mobius_spectrum.cc @@ -3,6 +3,9 @@ * without regression / tests being applied */ +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -310,5 +313,4 @@ int main (int argc, char ** argv) Grid_finalize(); } - - +#endif diff --git a/examples/Example_christoph.cc b/examples/Example_christoph.cc index 140491db9c..eb9a90410e 100644 --- a/examples/Example_christoph.cc +++ b/examples/Example_christoph.cc @@ -3,6 +3,9 @@ * without regression / tests being applied */ +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -432,5 +435,4 @@ int main (int argc, char ** argv) Grid_finalize(); } - - +#endif diff --git a/examples/Example_wall_wall_3pt.cc b/examples/Example_wall_wall_3pt.cc index 52f9cf42e8..c60ed02b2f 100644 --- a/examples/Example_wall_wall_3pt.cc +++ b/examples/Example_wall_wall_3pt.cc @@ -3,6 +3,9 @@ * without regression / tests being applied */ +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -535,5 +538,4 @@ int main (int argc, char ** argv) Grid_finalize(); } - - +#endif diff --git a/examples/Example_wall_wall_spectrum.cc b/examples/Example_wall_wall_spectrum.cc index 97ae1e06ed..b8b1a0d79e 100644 --- a/examples/Example_wall_wall_spectrum.cc +++ b/examples/Example_wall_wall_spectrum.cc @@ -3,6 +3,9 @@ * without regression / tests being applied */ +#include "disable_examples_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -429,5 +432,4 @@ int main (int argc, char ** argv) Grid_finalize(); } - - +#endif diff --git a/examples/disable_examples_without_instantiations.h b/examples/disable_examples_without_instantiations.h new file mode 100644 index 0000000000..79dbe9c6fc --- /dev/null +++ b/examples/disable_examples_without_instantiations.h @@ -0,0 +1,14 @@ +#pragma once + +#ifndef BUILD_FERMION_INSTANTIATIONS +#include + +int main(void) { + std::cout << "This build of Grid was configured to exclude fermion instantiations, " + << "which this example relies on. " + << "Please reconfigure and rebuild Grid with --enable-fermion-instantiations" + << "to run this example." + << std::endl; + return 1; +} +#endif diff --git a/tests/Test_cayley_even_odd_vec.cc b/tests/Test_cayley_even_odd_vec.cc index 243d1f72e6..f0e1b4de7d 100644 --- a/tests/Test_cayley_even_odd_vec.cc +++ b/tests/Test_cayley_even_odd_vec.cc @@ -25,6 +25,9 @@ Author: Peter Boyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_tests_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -273,8 +276,6 @@ void TestWhat(What & Ddwf, err = phi-chi; std::cout< * Reimplement the badly named "multigrid" lanczos as compressed Lanczos using the features * in Grid that were intended to be used to support blocked Aggregates, from */ +#include "disable_tests_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include #include #include @@ -256,3 +259,4 @@ int main (int argc, char ** argv) { Grid_finalize(); } +#endif diff --git a/tests/Test_dwf_dslash_repro.cc b/tests/Test_dwf_dslash_repro.cc index b0eac64b89..57a18b000a 100644 --- a/tests/Test_dwf_dslash_repro.cc +++ b/tests/Test_dwf_dslash_repro.cc @@ -25,6 +25,9 @@ Author: Peter Boyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_tests_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -237,3 +240,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/tests/Test_dwf_mixedcg_prec.cc b/tests/Test_dwf_mixedcg_prec.cc index c87908a3a2..e5771adcad 100644 --- a/tests/Test_dwf_mixedcg_prec.cc +++ b/tests/Test_dwf_mixedcg_prec.cc @@ -25,6 +25,9 @@ Author: Peter Boyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_tests_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -222,3 +225,5 @@ int main (int argc, char ** argv) Grid_finalize(); } + +#endif diff --git a/tests/Test_dwf_mixedcg_prec_halfcomms.cc b/tests/Test_dwf_mixedcg_prec_halfcomms.cc index ff52b0d170..7a59f77df7 100644 --- a/tests/Test_dwf_mixedcg_prec_halfcomms.cc +++ b/tests/Test_dwf_mixedcg_prec_halfcomms.cc @@ -25,6 +25,9 @@ Author: Peter Boyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ +#include "disable_tests_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS + #include using namespace std; @@ -118,3 +121,4 @@ int main (int argc, char ** argv) Grid_finalize(); } #endif +#endif diff --git a/tests/Test_meson_field.cc b/tests/Test_meson_field.cc index fa428d6a2c..5f85047fa7 100644 --- a/tests/Test_meson_field.cc +++ b/tests/Test_meson_field.cc @@ -24,6 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc., See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ +#include "disable_tests_without_instantiations.h" +#ifdef ENABLE_FERMION_INSTANTIATIONS #include #include @@ -157,3 +159,5 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } + +#endif diff --git a/tests/disable_tests_without_instantiations.h b/tests/disable_tests_without_instantiations.h new file mode 100644 index 0000000000..dbc50d5bc5 --- /dev/null +++ b/tests/disable_tests_without_instantiations.h @@ -0,0 +1,14 @@ +#pragma once + +#ifndef BUILD_FERMION_INSTANTIATIONS +#include + +int main(void) { + std::cout << "This build of Grid was configured to exclude fermion instantiations, " + << "which this test relies on. " + << "Please reconfigure and rebuild Grid with --enable-fermion-instantiations" + << "to run this test." + << std::endl; + return 1; +} +#endif