Clang MSYS2 environment
Clang, LLVM Flang Fortran compiler, GCC, Boost and many more packages are easily available on Windows via MSYS2. Clang is also available via direct download.
it’s often useful to have separate development environments for each compiler. The Powershell script “clang.ps1” creates a Clang LLVM environment. We don’t permanently put Clang on the user or system PATH to avoid DLL conflicts. Sourcing
. clang_arm.ps1in Powershell enables Clang until that Powershell window is closed.
For MSYS2 Clang and LLVM Flang Fortran compiler, create clang_arm.ps1
For standalone (non-MSYS2) Clang make “clang_arm_llvm.ps1” like:
$Env:CC="clang.exe"
$Env:CXX="clang++.exe"
$Env:Path = "$Env:ProgramFiles/LLVM/bin;$Env:Path"If you need to use the MSVC CL-like clang driver clang-cl, create “clang-cl.ps1” and run it when desired.
$Env:CC="clang-cl.exe"
$Env:CXX="clang-cl.exe"
$Env:Path = "$Env:ProgramFiles/LLVM/bin;$Env:Path"