JeffersonLab / qphix

QCD for Intel Xeon Phi and Xeon processors
http://jeffersonlab.github.io/qphix/
Other
13 stars 11 forks source link

QPhiX cannot be build without QDP++ #33

Closed martin-ueding closed 7 years ago

martin-ueding commented 7 years ago

QPhiX currently needs QDP++ to build its tests. These tests are not needed for production use, so that should be an optional dependency.

In order to use QPhiX in tmLQCD, this dependency should be configurable during configuration time. Otherwise the users of tmLQCD would have to install QDP++ which needs QMP and libxml2.

martin-ueding commented 7 years ago

This is my test, I run configure with --without-qdp. I expect that the M4 (or whatever tool from Autohell that actually is) variable QDPXX_GIVEN is set to no:

AC_ARG_WITH(qdp,
  AC_HELP_STRING(
     [--with-qdp=DIR],
     [ Build Assembler with QDP++, where QDP++ is installed in DIR. ]
  ),
  [ QDPXX_HOME="${with_qdp}"
    QDPXX_GIVEN="yes"
  ],
  [ QDPXX_GIVEN="no" ]
)

That does not work, though:

+ mkdir -p qphix-without-qdpxx
+ pushd qphix-without-qdpxx
~/Build/qphix-without-qdpxx ~/Build
+ /home/mu/Projekte/qphix/configure --enable-parallel-arch=scalar --enable-soalen=4 --enable-clover --enable-twisted-mass --enable-tm-clover --enable-openmp --enable-proc=AVX --without-qdp 'CXXFLAGS=-O2 --std=c++11 -fopenmp -g -fPIC -mavx'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/mu/Projekte/qphix/config/missing: Unknown `--is-lightweight' option
Try `/home/mu/Projekte/qphix/config/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking dependency style of g++... gcc3
checking for qdp++-config... no
configure: error: QDP++ configuration program qdp++-config not found.

That error messages comes from further down in the configure.ac:

if test "X${QDPXX_GIVEN}X" = "XyesX"; then 

     dnl Find the QDP++ config program 

     if test "X${QDPXX_HOME}X" = "XX" ; 
     then
    AC_PATH_PROG(QDPXX_CONFIG, [qdp++-config], [])
     else
    AC_PATH_PROG(QDPXX_CONFIG, [qdp++-config], [], [${QDPXX_HOME}/bin:${PATH}])
     fi

     if test "X${QDPXX_CONFIG}X" = "XX" ; then
    AC_MSG_ERROR([QDP++ configuration program qdp++-config not found.])
     fi

Since I have not supplied the --with-qdp option, I should never enter that section. Now it has to be figured out why this happens and how to fix that.

martin-ueding commented 7 years ago

The answer to this problem is rather simple: If one gives --without-qdp or -with-qdp=no, then AC_ARG_WITH will execute the first case. It will then set QDPXX_HOME="no" and QDPXX_GIVEN="yes". So the text further down should actually test QDPXX_HOME = no and not check whether the option was given. The value of the option might be “no”, and that is interpreted as a “yes”.

The simple workaround for now is just not supplying the --with-qdp option. I'll need to fix the configure.ac, though.

Another issue are that there are compiler errors because stuff gets compiled which depends on QDP++:

In file included from /home/mu/Projekte/qphix/tests/dslashm_w.cc:6:0:
/home/mu/Projekte/qphix/tests/dslashm_w.h:5:17: schwerwiegender Fehler: qdp.h: No such file or directory
 #include "qdp.h"
                 ^

So those `Makefile.am` also needs to be updated.