Coder Social home page Coder Social logo

Comments (11)

mspraggs avatar mspraggs commented on July 18, 2024

Something worth mentioning RE Eigen and existing aligned data: there is a Map class template that can be used to interface with existing strided data buffers. This way you may get some performance gains by avoiding memory copies (thinking back to what you were describing on the call last Monday).

from grid.

paboyle avatar paboyle commented on July 18, 2024

pushed this into develop. The mobius with dense matrix inverse for the MooInv is tested and working.

from grid.

aportelli avatar aportelli commented on July 18, 2024

There are various issues with the new setup. I am trying to compile Grid since two hours without success. Here is what I found:

  • the prerequisite build is not compatible with parallel build
  • the prerequisite build is based on non-portable script (use of GNU make filter-out in Makefile.am)
  • the prerequisite build does not allow to configure for external FFTW without forcing the flags
  • the prerequisite build cannot be cleaned without removing files by hand
  • I have some missing header errors for includes with "" (we should really use "<>" includes everywhere)

The Travis build pass so it is really portability issues. Anyway I always found our autotool setup quite messy (and I had quite some feedback that it is cryptic). I am going to review and clean the build system and at the same time fix the issues mentioned above.

I don't think including the prerequisite build in the build system is a good idea after all. These package have their own build system and the user might want to use system-wide libraries or compile them by using flags different from the one used in Grid. I think it would be best to just have a script (independent of the build system) to take care of the prerequisites.

from grid.

coppolachan avatar coppolachan commented on July 18, 2024

I agree with the last part. Having in the prerequisites some complex libraries like Eigen is breaking compilation in my pc too. I could workaround only deactivating the openmp flags once using my clang.
If we need them we should leave the user to install then look for them at configure time.

Could you explain better the "messiness" of the autotools and the feedbacks you got?

from grid.

aportelli avatar aportelli commented on July 18, 2024

First, about the problems.

Autotools gives me:

prerequisites/Makefile.am:1: warning: filter-out -std=c++11, $(CXXFLAGS: non-POSIX variable name
prerequisites/Makefile.am:1: (probably a GNU make extension)
tests/debug/Make.inc:33: warning: variable 'Test_zmm_SOURCES' is defined but no program or
tests/debug/Make.inc:33: library has 'Test_zmm' as canonical name (possible typo)
tests/debug/Makefile.am:19:   'tests/debug/Make.inc' included from here
tests/debug/Make.inc:34: warning: variable 'Test_zmm_LDADD' is defined but no program or
tests/debug/Make.inc:34: library has 'Test_zmm' as canonical name (possible typo)
tests/debug/Makefile.am:19:   'tests/debug/Make.inc' included from here
autoreconf: Leaving directory `.'

I also have the following error at compile time:

../../include/Grid/algorithms/approx/Remez.h:24:10: fatal error: 'algorithms/approx/bigfloat_double.h' file not found
#include "algorithms/approx/bigfloat_double.h"

all that on my MacBook with ../configure --enable-precision=single --enable-simd=AVX --enable-comms=mpi --prefix=/Users/antonin/local CXX=mpicxx CXXFLAGS='-mfma -mavx -O3 -std=c++11'

from grid.

aportelli avatar aportelli commented on July 18, 2024

About our configure script. The difficult thing here is that the philosophy of autotools is to set the build up for you, but in the case of Grid the user actually has a fair amount of manual setup to do. Here are the points that I would like to improve:

  • the configure script detects the architecture but the user still has to provide the CXXFLAGS for it
  • the configure script can detect C++11 but the user has to provide -std=c++11 manually
  • the configure script expects the user to setup everything for MPI compilation
  • the setup of MPFR and MPC libraries has to be done manually
  • the "generic" architecture is still called "empty"
  • it is still not clear to me that one can install Grid to use it as a library

from grid.

coppolachan avatar coppolachan commented on July 18, 2024

First one is just a warning. I am not getting it, this is my configure
CXX=clang++ ./configure --enable-precision=single --enable-simd=AVX2 CXXFLAGS="-mavx2 -mfma -O3 -std=c++11" LDFLAGS="" LIBS="-lgmp -lmpfr" --enable-comms=none
Agree that it should not happen.

Totally agree on the improvements on the automatic detections for configure.
the first has some portability issues that must be taken into account. Also we would still like to steer the compilation to a custom target independent on the machine.

from grid.

aportelli avatar aportelli commented on July 18, 2024

The Test_zmm one is very annoying because I corrected it two times already...

from grid.

aportelli avatar aportelli commented on July 18, 2024

I am rewriting the configure.ac. Is it really necessary to detect the present and test the selected SIMD against it? I guess lattice people know well which instruction set they are working with. Moreover it does not make sense for cross-compilation (e.g. will KN* systems have KN* frontends?)

from grid.

aportelli avatar aportelli commented on July 18, 2024

I thing I have finished redesigning the build system. Please give me some feedback so that I can consider merging it into develop before it starts conflicting with other branches.

You can try it by checking out the feature/new-build branch. The list of changes is quite long, but from the user point of view most of them are quite invisible. I have modified and extended the Readme.md accordingly (see https://github.com/paboyle/Grid/tree/feature/new-build). Please find below some of the main points:

  • all the pre-configure operations are centralised in a bootstrap.sh script
  • the Make.inc files are not part of the git repository anymore, they are automatically generated by bootstrap.sh
  • the Eigen source is extracted and listed in Grid sources by bootstrap.sh
  • the Make.inc files generation was modified such that all the headers can be properly installed with make install keeping Grid directory structure
  • the Make.inc files generation was modified such that tests programs are not installed by make install
  • the Make.inc files generation was modified such that only test programs at the root of tests are compiled by default. Other tests can be compiled using make tests. This reduces a lot the compile time and allow us to still fit in the Travis allowed build time
  • the Grid library is now compiled using libtool, this is a more portable way of doing things and gives better dependency management. Libtool is configured to only build a static library
  • the configure script do not check anymore the CPUID
  • the configure determines and saves the compiler vendor and version
  • the --with-simd option now sets the proper compiler flags automatically. This is of course dependent on the compiler vendor, gcc/clang/icpc are supported, it is easy to add more
  • the configure script figure out by itself how to link to MPI if --enable-comms=mpi was used, there is no need to specify CXX to be a wrapper like mpicxx
  • the configure script has two --with-<lib>= options with <lib>=gmp,mpfr to specify prefixes for GMP and MPFR libraries, this will set compilation flags accordingly
  • MPFR is needed only if GMP is used, if GMP is detected but MPFR cannot be found configure now issues an error (the compilation would inevitably fail)
  • the FFTW dependency was removed, it was confusing as by now Grid does not depend on it. I am happy to do something about it as soon as it becomes a real dependency
  • the summary outputted at the end of configure is much more verbose, in particular you can make a fine check of compilation flags
  • because we have a lot of Makefile.am files, I reduced most of them to very short scripts and moved global settings to configure.ac to avoid tricky code duplication

from grid.

aportelli avatar aportelli commented on July 18, 2024

Ok this is now on develop, I am closing the issue.

from grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.