Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Brent_C
Beginner
117 Views

Intel Compiler support for Boost Hana

Boost Hana is a popular C++14 template metaprogramming library. Currently, both clang and g++ are fully compatible and Microsoft has been hard at work getting MSVC to work with Hana.

My question is there any roadmap for getting the Intel Compiler to work with Hana (and other metaprogramming / C++14 tools)? I don't currently have access to the 2019 beta but the 2018 compiler fails right away when trying to compile Hana tests:

cmake --build . --target check
Scanning dependencies of target test.tuple.cnstr.variadic_copy
[  0%] Building CXX object test/CMakeFiles/test.tuple.cnstr.variadic_copy.dir/tuple/cnstr.variadic_copy.cpp.o
In file included from /home/build-test/git/hana/include/boost/hana/optional.hpp(13),
                 from /home/build-test/git/hana/include/boost/hana/detail/index_if.hpp(17),
                 from /home/build-test/git/hana/include/boost/hana/tuple.hpp(21),
                 from /home/build-test/git/hana/test/tuple/cnstr.variadic_copy.cpp(6):
/home/build-test/git/hana/include/boost/hana/fwd/optional.hpp(343): error: defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr
          constexpr optional() = default;
                    ^

compilation aborted for /home/build-test/git/hana/test/tuple/cnstr.variadic_copy.cpp (code 2)
test/CMakeFiles/test.tuple.cnstr.variadic_copy.dir/build.make:62: recipe for target 'test/CMakeFiles/test.tuple.cnstr.variadic_copy.dir/tuple/cnstr.variadic_copy.cpp.o' failed
make[3]: *** [test/CMakeFiles/test.tuple.cnstr.variadic_copy.dir/tuple/cnstr.variadic_copy.cpp.o] Error 2
CMakeFiles/Makefile2:38768: recipe for target 'test/CMakeFiles/test.tuple.cnstr.variadic_copy.dir/all' failed
make[2]: *** [test/CMakeFiles/test.tuple.cnstr.variadic_copy.dir/all] Error 2
CMakeFiles/Makefile2:332: recipe for target 'CMakeFiles/check.dir/rule' failed
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
Makefile:279: recipe for target 'check' failed
make: *** [check] Error 2

 

At our company, we use the Intel Compiler for highly performant mathematical computation that the Intel Compiler far outpaces all others with. This binds us to the Intel Compiler but without support for such rich libraries like Boost Hana, we are left missing some needed compile-time calculations.

Thanks.

0 Kudos
2 Replies
Viet_H_Intel
Moderator
117 Views

 

Can you provide us a cnstr.variadic_copy.i to investigate?

Thanks,

Viet 

Brent_C
Beginner
117 Views

 

Hi Viet,

 

The file can be viewed here: https://github.com/boostorg/hana/blob/master/test/tuple/cnstr.convert_copy.cpp

Boost Hana is a header-only library and I think that many parts of it have compatibility problems with the intel compiler. That was the first test in the test suite and it failed.

Here is a link to an open issue on the Boost Hana tracker that asks for the author to support ICPC: https://github.com/boostorg/hana/issues/371

I think that since Hana is fully C++14 standards compliant (AFAIK) it isn’t appropriate to ask the library author to make compiler-specific modifications to make it work and instead the issue should be posted to the compiler developers.

 

Brent