Using Clang instead of VS19 to build HDF5 1.12.0 on W10


#1

Trying to build HDF5 1.12.0 on Windows 10 with both Clang and Visual Studio 19 installed. Whenever I run Cmake it defaults to the VS19 build. How can I make it build with Clang instead? Thanks.


#2

Use the clang toolchain file:
-DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/clang.cmake

Allen


#3

On Windows 10 it’s still creating VS 2019 build files when I add that to the command line.

On Linux (Ubuntu) I get the following when I run cmake with the toolchain option added (I have clang 6.0.0 installed):

CMake Error at /usr/local/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake:53 (message):
The C++ compiler

"/usr/bin/clang++"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/shellmsd/hdf5-1.12.0/build/CMakeFiles/CMakeTmp