1

I am using VS 2017 Community edition, Intel Compiler 17.00 update 6 and and boost 1.66, trying to learn my way around boost::multiprecision::float128. Literally taking the example code from here and putting it in a new project for VS.

Compiling gives multiple errors, in roughly two categories/files:

  1. In float128.hpp:

    • three errors of "error : identifier "xxx" is undefined" for fmaq, remquoq and remainderq. Indeed I am not able to find definitions for them - a missing include?

    • the global scope has no "signbitq" - this again looks like missing definition (i.e. the same as above)

For GCC the above functions are found within quadmath.h, however, the boost header doesn't seem to include it when using ICC (i.e BOOST_MP_USE_QUAD is set).

  1. In C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility: an explicit template argument list is not allowed on this declaration. There are three counts

I assume that i need to remove something that has been put in by default from the VS, but I am at a loss what exactly.

Thank you for your help

EDIT: Errors #2 above are actually not against boost at all (should I move this to a separate question?). The following code copied from here! is not being compiled in my setup:

#include <iostream>
#include <string>
int main() {
std::string str("Test string");
for (std::string::iterator it = str.begin(); it != str.end(); ++it)
    std::cout << *it;
std::cout << '\n';
return 0;

}

The exact error (one of them) is:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\xutility(680): error : an explicit template argument list is not allowed on this declaration
1>      _INLINE_VAR constexpr bool _Is_iterator_v<_Ty, void_t<_Iter_cat_t<_Ty>>> = true;
1>                                 ^
1>          detected during:
1>            instantiation of "const bool std::_Is_iterator_v [with _Ty=char *, <unnamed>=void]" at line 520 of "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\string"
1>            instantiation of "std::basic_string<_Elem, std::char_traits<_Elem>, std::allocator<_Elem>> std::_Integral_to_string<_Elem,_Ty>(_Ty) [with _Elem=char, _Ty=int]" at line 554 of "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\string"

I found this which indicates that there could be a problem with the particular versions used (ICC- 17.0 Up6 and VS 15.6), however i cannot really move to new intel compiler and i cannot test VS 15.4

Starlin
  • 21
  • 4
  • Do any other boost functions work for you? – ack Mar 07 '18 at 15:47
  • The errors in xutility are happening with other boost functions (tried some from special_functions) - thanks for pointing this – Starlin Mar 07 '18 at 15:57
  • Would like to extend the above a bit - the code from the [getting started page](http://www.boost.org/doc/libs/1_66_0/more/getting_started/windows.html#build-a-simple-program-using-boost) compiles and works. When i try to use other functions i.e `#include int main() { boost::math::detail::bessel_k1(1.0f); return 0; }` it doesn't compile with the second error from the question. – Starlin Mar 07 '18 at 16:41
  • Looks like the standard library used in your Visual Studio version is simply not compatible with the Intel compiler version. That's a show-stopper. If that's the case, you need to change one. – sehe Mar 08 '18 at 07:40
  • Re: float128, did you read _"When the underlying type is Intel's _Quad type, the code must be compiled with the compiler option -Qoption,cpp,--extended_float_type."?_ ([here](http://www.boost.org/doc/libs/1_66_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/float128.html)) – sehe Mar 08 '18 at 07:43
  • 1
    @sehe, you seem to be right Re: VS, I have posted a even more basic failing code to intel's forums, we shall see what the guys think. Re: float128, yes, the code is being compiled with that option. – Starlin Mar 09 '18 at 07:41
  • When you find a verdict/solution from the Intel guys, consider posting that as an answer. That would be helpful for anyone else walking into this barrier! – sehe Mar 09 '18 at 07:46

2 Answers2

0

I would like to write down how I managed to deal with error #2 from the original question, as it might be useful to someone.

Just as a reminder, the second errors I was seeing were in xutility. With the help of everyone that provided suggestions, it turned out that icc was in fact failing on very simple code - the following is enough to "break" it

int main() { std::string str("Test string"); }

I have posted the question to intel's forums, however so far I have not received answers (for the 17.0 version of the compiler). Link here if anyone is interested.

That said, I came upon this blog post from the VC++ team, showing that the base toolset shown as v141 in VC2017 actually has had several minor revisions. It is possible to change the version of the MSVC toolchain but this needs to happen via editing of project files (rather than UI parameter changes).

My testing shows that version 14.11 (which is part of VS2017 15.3 and 15.4) works for Intel 17.0 while versions 14.12 and 14.13 (the last one is the current default for VS2017 15.6.4) do not. This has been done for Update 6 of the compiler. So in order to use the intel compiler on windows with visual studio, one needs to use particular MSVC toolchain versions.

Side note: I also installed icc version 18.0 update 1 for testing -- it too was giving compiler errors (and not just for me this time). The reason there though can be linked to some internal issue for icc, per this forum post. I can confirm that removing the compiler option /permissive- from the compiler fixes the errors irrespective of the base toolchain. Using v14.11 as base toolchain also fixes this particular problem for me with or without the option. /permissive- is a new option for icc (it is not part of 17.0).

The above solves more or less the second part of my problem with the icc. The rest of the question (boost's float128) though still remains. I will add more if i hear from boost's guys.

EDIT: the errors coming from boost turned out to be an issue there -- it was fixed by the maintainers in development branch, so this is resolved as well.

Starlin
  • 21
  • 4
0

For Error #1, I got the same thing. However, after commenting the code blocks in boost float128.hpp where those four functions invoked, the float128 example code can be compiled with success. The side effect is unknown. I'm looking forward a revision on boost::multiprecision::float128.

S. Nie
  • 21
  • 3