diff --git a/Makefile.am b/Makefile.am index fd9671cc..d3401c48 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # additional include paths necessary to compile the C++ library -SUBDIRS = lib benchmarks tests programs +SUBDIRS = lib benchmarks tests extras include $(top_srcdir)/doxygen.inc diff --git a/configure.ac b/configure.ac index 00ef6fdc..19e3f105 100644 --- a/configure.ac +++ b/configure.ac @@ -381,12 +381,13 @@ AC_CONFIG_FILES(tests/IO/Makefile) AC_CONFIG_FILES(tests/core/Makefile) AC_CONFIG_FILES(tests/debug/Makefile) AC_CONFIG_FILES(tests/forces/Makefile) +AC_CONFIG_FILES(tests/hadrons/Makefile) AC_CONFIG_FILES(tests/hmc/Makefile) AC_CONFIG_FILES(tests/solver/Makefile) AC_CONFIG_FILES(tests/qdpxx/Makefile) AC_CONFIG_FILES(benchmarks/Makefile) -AC_CONFIG_FILES(programs/Makefile) -AC_CONFIG_FILES(programs/Hadrons/Makefile) +AC_CONFIG_FILES(extras/Makefile) +AC_CONFIG_FILES(extras/hadrons/Makefile) AC_OUTPUT echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/programs/Hadrons/Application.cc b/extras/Hadrons/Application.cc similarity index 100% rename from programs/Hadrons/Application.cc rename to extras/Hadrons/Application.cc diff --git a/programs/Hadrons/Application.hpp b/extras/Hadrons/Application.hpp similarity index 100% rename from programs/Hadrons/Application.hpp rename to extras/Hadrons/Application.hpp diff --git a/programs/Hadrons/Environment.cc b/extras/Hadrons/Environment.cc similarity index 100% rename from programs/Hadrons/Environment.cc rename to extras/Hadrons/Environment.cc diff --git a/programs/Hadrons/Environment.hpp b/extras/Hadrons/Environment.hpp similarity index 100% rename from programs/Hadrons/Environment.hpp rename to extras/Hadrons/Environment.hpp diff --git a/programs/Hadrons/Factory.hpp b/extras/Hadrons/Factory.hpp similarity index 100% rename from programs/Hadrons/Factory.hpp rename to extras/Hadrons/Factory.hpp diff --git a/programs/Hadrons/GeneticScheduler.hpp b/extras/Hadrons/GeneticScheduler.hpp similarity index 100% rename from programs/Hadrons/GeneticScheduler.hpp rename to extras/Hadrons/GeneticScheduler.hpp diff --git a/programs/Hadrons/Global.cc b/extras/Hadrons/Global.cc similarity index 100% rename from programs/Hadrons/Global.cc rename to extras/Hadrons/Global.cc diff --git a/programs/Hadrons/Global.hpp b/extras/Hadrons/Global.hpp similarity index 100% rename from programs/Hadrons/Global.hpp rename to extras/Hadrons/Global.hpp diff --git a/programs/Hadrons/Graph.hpp b/extras/Hadrons/Graph.hpp similarity index 100% rename from programs/Hadrons/Graph.hpp rename to extras/Hadrons/Graph.hpp diff --git a/programs/Hadrons/Hadrons.cc b/extras/Hadrons/Hadrons.cc similarity index 100% rename from programs/Hadrons/Hadrons.cc rename to extras/Hadrons/Hadrons.cc diff --git a/extras/Hadrons/Makefile.am b/extras/Hadrons/Makefile.am new file mode 100644 index 00000000..6fd459dc --- /dev/null +++ b/extras/Hadrons/Makefile.am @@ -0,0 +1,22 @@ +lib_LIBRARIES = libHadrons.a + +include modules.inc + +libHadrons_a_SOURCES = \ + $(modules_cc) \ + Application.cc \ + Environment.cc \ + Global.cc \ + Module.cc +libHadrons_adir = $(pkgincludedir)/Hadrons +nobase_libHadrons_a_HEADERS = \ + $(modules_hpp) \ + Application.hpp \ + Environment.hpp \ + Factory.hpp \ + GeneticScheduler.hpp \ + Global.hpp \ + Graph.hpp \ + Module.hpp \ + Modules.hpp \ + ModuleFactory.hpp diff --git a/programs/Hadrons/Module.cc b/extras/Hadrons/Module.cc similarity index 100% rename from programs/Hadrons/Module.cc rename to extras/Hadrons/Module.cc diff --git a/programs/Hadrons/Module.cc.template b/extras/Hadrons/Module.cc.template similarity index 100% rename from programs/Hadrons/Module.cc.template rename to extras/Hadrons/Module.cc.template diff --git a/programs/Hadrons/Module.hpp b/extras/Hadrons/Module.hpp similarity index 100% rename from programs/Hadrons/Module.hpp rename to extras/Hadrons/Module.hpp diff --git a/programs/Hadrons/Module.hpp.template b/extras/Hadrons/Module.hpp.template similarity index 100% rename from programs/Hadrons/Module.hpp.template rename to extras/Hadrons/Module.hpp.template diff --git a/programs/Hadrons/ModuleFactory.hpp b/extras/Hadrons/ModuleFactory.hpp similarity index 100% rename from programs/Hadrons/ModuleFactory.hpp rename to extras/Hadrons/ModuleFactory.hpp diff --git a/programs/Hadrons/Modules.hpp b/extras/Hadrons/Modules.hpp similarity index 100% rename from programs/Hadrons/Modules.hpp rename to extras/Hadrons/Modules.hpp diff --git a/programs/Hadrons/Modules/ADWF.cc b/extras/Hadrons/Modules/ADWF.cc similarity index 100% rename from programs/Hadrons/Modules/ADWF.cc rename to extras/Hadrons/Modules/ADWF.cc diff --git a/programs/Hadrons/Modules/ADWF.hpp b/extras/Hadrons/Modules/ADWF.hpp similarity index 100% rename from programs/Hadrons/Modules/ADWF.hpp rename to extras/Hadrons/Modules/ADWF.hpp diff --git a/programs/Hadrons/Modules/AWilson.cc b/extras/Hadrons/Modules/AWilson.cc similarity index 100% rename from programs/Hadrons/Modules/AWilson.cc rename to extras/Hadrons/Modules/AWilson.cc diff --git a/programs/Hadrons/Modules/AWilson.hpp b/extras/Hadrons/Modules/AWilson.hpp similarity index 100% rename from programs/Hadrons/Modules/AWilson.hpp rename to extras/Hadrons/Modules/AWilson.hpp diff --git a/programs/Hadrons/Modules/CMeson.cc b/extras/Hadrons/Modules/CMeson.cc similarity index 100% rename from programs/Hadrons/Modules/CMeson.cc rename to extras/Hadrons/Modules/CMeson.cc diff --git a/programs/Hadrons/Modules/CMeson.hpp b/extras/Hadrons/Modules/CMeson.hpp similarity index 100% rename from programs/Hadrons/Modules/CMeson.hpp rename to extras/Hadrons/Modules/CMeson.hpp diff --git a/programs/Hadrons/Modules/GLoad.cc b/extras/Hadrons/Modules/GLoad.cc similarity index 100% rename from programs/Hadrons/Modules/GLoad.cc rename to extras/Hadrons/Modules/GLoad.cc diff --git a/programs/Hadrons/Modules/GLoad.hpp b/extras/Hadrons/Modules/GLoad.hpp similarity index 100% rename from programs/Hadrons/Modules/GLoad.hpp rename to extras/Hadrons/Modules/GLoad.hpp diff --git a/programs/Hadrons/Modules/GRandom.cc b/extras/Hadrons/Modules/GRandom.cc similarity index 100% rename from programs/Hadrons/Modules/GRandom.cc rename to extras/Hadrons/Modules/GRandom.cc diff --git a/programs/Hadrons/Modules/GRandom.hpp b/extras/Hadrons/Modules/GRandom.hpp similarity index 100% rename from programs/Hadrons/Modules/GRandom.hpp rename to extras/Hadrons/Modules/GRandom.hpp diff --git a/programs/Hadrons/Modules/GUnit.cc b/extras/Hadrons/Modules/GUnit.cc similarity index 100% rename from programs/Hadrons/Modules/GUnit.cc rename to extras/Hadrons/Modules/GUnit.cc diff --git a/programs/Hadrons/Modules/GUnit.hpp b/extras/Hadrons/Modules/GUnit.hpp similarity index 100% rename from programs/Hadrons/Modules/GUnit.hpp rename to extras/Hadrons/Modules/GUnit.hpp diff --git a/programs/Hadrons/Modules/MQuark.cc b/extras/Hadrons/Modules/MQuark.cc similarity index 100% rename from programs/Hadrons/Modules/MQuark.cc rename to extras/Hadrons/Modules/MQuark.cc diff --git a/programs/Hadrons/Modules/MQuark.hpp b/extras/Hadrons/Modules/MQuark.hpp similarity index 100% rename from programs/Hadrons/Modules/MQuark.hpp rename to extras/Hadrons/Modules/MQuark.hpp diff --git a/programs/Hadrons/Modules/SolRBPrecCG.cc b/extras/Hadrons/Modules/SolRBPrecCG.cc similarity index 100% rename from programs/Hadrons/Modules/SolRBPrecCG.cc rename to extras/Hadrons/Modules/SolRBPrecCG.cc diff --git a/programs/Hadrons/Modules/SolRBPrecCG.hpp b/extras/Hadrons/Modules/SolRBPrecCG.hpp similarity index 100% rename from programs/Hadrons/Modules/SolRBPrecCG.hpp rename to extras/Hadrons/Modules/SolRBPrecCG.hpp diff --git a/programs/Hadrons/Modules/SrcPoint.cc b/extras/Hadrons/Modules/SrcPoint.cc similarity index 100% rename from programs/Hadrons/Modules/SrcPoint.cc rename to extras/Hadrons/Modules/SrcPoint.cc diff --git a/programs/Hadrons/Modules/SrcPoint.hpp b/extras/Hadrons/Modules/SrcPoint.hpp similarity index 100% rename from programs/Hadrons/Modules/SrcPoint.hpp rename to extras/Hadrons/Modules/SrcPoint.hpp diff --git a/programs/Hadrons/Modules/SrcZ2.cc b/extras/Hadrons/Modules/SrcZ2.cc similarity index 100% rename from programs/Hadrons/Modules/SrcZ2.cc rename to extras/Hadrons/Modules/SrcZ2.cc diff --git a/programs/Hadrons/Modules/SrcZ2.hpp b/extras/Hadrons/Modules/SrcZ2.hpp similarity index 100% rename from programs/Hadrons/Modules/SrcZ2.hpp rename to extras/Hadrons/Modules/SrcZ2.hpp diff --git a/programs/Hadrons/add_module.sh b/extras/Hadrons/add_module.sh similarity index 100% rename from programs/Hadrons/add_module.sh rename to extras/Hadrons/add_module.sh diff --git a/programs/Hadrons/make_module_list.sh b/extras/Hadrons/make_module_list.sh similarity index 100% rename from programs/Hadrons/make_module_list.sh rename to extras/Hadrons/make_module_list.sh diff --git a/programs/Hadrons/modules.inc b/extras/Hadrons/modules.inc similarity index 100% rename from programs/Hadrons/modules.inc rename to extras/Hadrons/modules.inc diff --git a/programs/Makefile.am b/extras/Makefile.am similarity index 100% rename from programs/Makefile.am rename to extras/Makefile.am diff --git a/lib/Hadrons b/lib/Hadrons index 5343d55a..1f422592 120000 --- a/lib/Hadrons +++ b/lib/Hadrons @@ -1 +1 @@ -../programs/Hadrons \ No newline at end of file +../extras/Hadrons \ No newline at end of file diff --git a/programs/Hadrons/Make.inc b/programs/Hadrons/Make.inc deleted file mode 100644 index 13c13c4e..00000000 --- a/programs/Hadrons/Make.inc +++ /dev/null @@ -1,4 +0,0 @@ -bin_PROGRAMS = Hadrons - -Hadrons_SOURCES = Hadrons.cc -Hadrons_LDADD = -lGrid diff --git a/programs/Hadrons/Makefile.am b/programs/Hadrons/Makefile.am deleted file mode 100644 index cdf7a166..00000000 --- a/programs/Hadrons/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -lib_LIBRARIES = libHadrons.a - -bin_PROGRAMS = Hadrons - -include modules.inc - -libHadrons_a_SOURCES = \ - $(modules_cc) \ - Application.cc \ - Environment.cc \ - Global.cc \ - Module.cc -libHadrons_adir = $(pkgincludedir)/Hadrons -nobase_libHadrons_a_HEADERS = \ - $(modules_hpp) \ - Application.hpp \ - Environment.hpp \ - Factory.hpp \ - GeneticScheduler.hpp \ - Global.hpp \ - Graph.hpp \ - Module.hpp \ - ModuleFactory.hpp - -Hadrons_SOURCES = Hadrons.cc -Hadrons_LDADD = libHadrons.a -lGrid diff --git a/scripts/filelist b/scripts/filelist index dddb605b..ca7425c0 100755 --- a/scripts/filelist +++ b/scripts/filelist @@ -24,10 +24,11 @@ for subdir in $dirs; do echo "tests: ${TESTLIST} ${SUB}" > Make.inc echo ${PREF}_PROGRAMS = ${TESTLIST} >> Make.inc echo >> Make.inc + HADLINK=`[ $subdir = './hadrons' ] && echo '-lHadrons'` for f in $TESTS; do BNAME=`basename $f .cc` - echo ${BNAME}_SOURCES=$f >> Make.inc - echo ${BNAME}_LDADD=-lGrid>> Make.inc + echo ${BNAME}_SOURCES=$f >> Make.inc + echo ${BNAME}_LDADD=-lGrid ${HADLINK} >> Make.inc echo >> Make.inc done if [ $subdir != '.' ]; then diff --git a/tests/hadrons/Makefile.am b/tests/hadrons/Makefile.am new file mode 100644 index 00000000..fae0d212 --- /dev/null +++ b/tests/hadrons/Makefile.am @@ -0,0 +1,3 @@ +AM_LDFLAGS += -L../../extras/hadrons + +include Make.inc diff --git a/tests/hadrons/Test_hadrons_xmldriven.cc b/tests/hadrons/Test_hadrons_xmldriven.cc new file mode 100644 index 00000000..ad43b6cc --- /dev/null +++ b/tests/hadrons/Test_hadrons_xmldriven.cc @@ -0,0 +1,66 @@ +/******************************************************************************* +Grid physics library, www.github.com/paboyle/Grid + +Source file: programs/Hadrons/Hadrons.cc + +Copyright (C) 2015 + +Author: Antonin Portelli + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +See the full license in the file "LICENSE" in the top level distribution +directory. +*******************************************************************************/ + +#include + +using namespace Grid; +using namespace QCD; +using namespace Hadrons; + +int main(int argc, char *argv[]) +{ + // parse command line + std::string parameterFileName; + + if (argc < 2) + { + std::cerr << "usage: " << argv[0] << " [Grid options]"; + std::cerr << std::endl; + std::exit(EXIT_FAILURE); + } + parameterFileName = argv[1]; + + // initialization + Grid_init(&argc, &argv); + HadronsLogError.Active(GridLogError.isActive()); + HadronsLogWarning.Active(GridLogWarning.isActive()); + HadronsLogMessage.Active(GridLogMessage.isActive()); + HadronsLogIterative.Active(GridLogIterative.isActive()); + HadronsLogDebug.Active(GridLogDebug.isActive()); + LOG(Message) << "Grid initialized" << std::endl; + + // execution + Application application(parameterFileName); + + application.run(); + + // epilogue + LOG(Message) << "Grid is finalizing now" << std::endl; + Grid_finalize(); + + return EXIT_SUCCESS; +}