Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libint2 warning on ubuntu:devel #1080

Closed
junghans opened this issue Jul 26, 2023 · 6 comments
Closed

libint2 warning on ubuntu:devel #1080

junghans opened this issue Jul 26, 2023 · 6 comments
Assignees

Comments

@junghans
Copy link
Member

[ 62%] Building CXX object xtp/src/libxtp/CMakeFiles/votca_xtp.dir/pmlocalization.cc.o
cd /__w/votca/votca/builddir/xtp/src/libxtp && ccache /usr/bin/g++ -DBOOST_ALL_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_TIMER_DYN_LINK -DUSING_Libxc -Dvotca_xtp_EXPORTS -I/__w/votca/votca/xtp/src/libxtp -I/__w/votca/votca/xtp/include -I/usr/include/hdf5/serial -I/__w/votca/votca/builddir/xtp/include -I/__w/votca/votca/builddir/xtp/include/votca/xtp -I/__w/votca/votca/csg/include -I/__w/votca/votca/tools/include -I/__w/votca/votca/builddir/tools/include/votca/tools -I/__w/votca/votca/builddir/tools/include -isystem /usr/include/eigen3 -isystem /usr/include/libecpint -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wno-deprecated-copy -Werror -O3 -DNDEBUG -fPIC -fopenmp -MD -MT xtp/src/libxtp/CMakeFiles/votca_xtp.dir/pmlocalization.cc.o -MF CMakeFiles/votca_xtp.dir/pmlocalization.cc.o.d -o CMakeFiles/votca_xtp.dir/pmlocalization.cc.o -c /__w/votca/votca/xtp/src/libxtp/pmlocalization.cc
In file included from /usr/include/libint2/initialize.h:36,
                 from /__w/votca/votca/xtp/src/libxtp/parallelxjobcalc.cc:25:
In static member function 'static size_t libint2::DerivMapGenerator::how_many_derivs(size_t, size_t)',
    inlined from 'static libint2::Tensor<long unsigned int> libint2::DerivMapGenerator::generate_deriv_index_map(size_t, libint2::BraKet)' at /usr/include/libint2/deriv_map.h:203:41:
/usr/include/libint2/deriv_map.h:126:25: error: 'ncenters' may be used uninitialized [-Werror=maybe-uninitialized]
  126 |               val *= (3 * k + i);
      |                       ~~^~~
/usr/include/libint2/deriv_map.h: In function 'static libint2::Tensor<long unsigned int> libint2::DerivMapGenerator::generate_deriv_index_map(size_t, libint2::BraKet)':
/usr/include/libint2/deriv_map.h:171:18: note: 'ncenters' was declared here
  171 |           size_t ncenters;
      |                  ^~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [xtp/src/libxtp/CMakeFiles/votca_xtp.dir/build.make:1339: xtp/src/libxtp/CMakeFiles/votca_xtp.dir/parallelxjobcalc.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/libint2/engine.impl.h:34,
                 from /usr/include/libint2/engine.h:1020,
                 from /usr/include/libint2/cxxapi.h:45,
                 from /usr/include/libint2.hpp:24,
                 from /__w/votca/votca/xtp/src/libxtp/libint2_calls.cc:30:
/usr/include/libint2/boys.h: In constructor 'libint2::TennoGmEval<Real>::TennoGmEval(unsigned int, Real)':
/usr/include/libint2/boys.h:875: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
  875 |         if (mmax > cheb_table_mmax)
      | 
/usr/include/libint2/boys.h:875: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
gmake[1]: *** [CMakeFiles/Makefile2:5116: xtp/src/libxtp/CMakeFiles/votca_xtp.dir/all] Error 2
gmake[2]: Leaving directory '/__w/votca/votca/builddir'
gmake[1]: Leaving directory '/__w/votca/votca/builddir'
gmake: *** [Makefile:149: all] Error 2
@baumeier
Copy link
Member

That is in libint, not sure what I could even do with that.

@junghans
Copy link
Member Author

I think we have two options:

  1. Disable the warning as part of the CI (user will still see it), like in
    # workaround for votca/votca#891
    if [[ ${INPUT_DISTRO} = ubuntu:* && ${INPUT_TOOLCHAIN} = "gnu" ]]; then
    cmake_args+=( -DVOTCA_EXTRA_WARNING_FLAGS="-Wno-deprecated-copy")
    fi
  2. Disable the warning when we include libint2.h (user won't see it anymore) like in
    #if (defined STRICT_GNUC) && GCC_VERSION > 70000
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wint-in-bool-context"
    #endif
    #include <Eigen/Eigen>
    #include <unsupported/Eigen/CXX11/Tensor>
    #include <unsupported/Eigen/FFT>
    #include <unsupported/Eigen/SparseExtra>
    #if (defined STRICT_GNUC) && GCC_VERSION > 70000
    #pragma GCC diagnostic pop
    #endif

Pick your poisson.

@baumeier
Copy link
Member

I understand it correctly, that in the first case, we disable all warnings like this, not only for libint, right?

Then, I'd probably prefer 2, though I am unsure where that is required.

@junghans junghans mentioned this issue Sep 19, 2023
3 tasks
@baumeier
Copy link
Member

@junghans any clue where one needs to do that for libint2.h?

@junghans
Copy link
Member Author

$ git grep libint2\.hpp
CMakeModules/Findlibint2.cmake:find_path(LIBINT2_INCLUDE_DIR libint2.hpp HINTS ${PC_LIBINT2_INCLUDE_DIRS})
xtp/src/libxtp/libint2_calls.cc:#include <libint2.hpp>

So I think we only have to wrap it in one place: ibint2_calls.cc!

@junghans
Copy link
Member Author

We went with option 1.) in #1088

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants