Missing symbols on Windows when using queue properties

Hi,

there seems to be symbols (yet again) missing from the ComputeCpp libraries on Windows using ComputeCpp-CE 1.1.1 and 1.1.2. The following simple program results in linker errors, but compiles fine on Linux.

#include <CL/sycl.hpp>
int main()
{
    cl::sycl::queue q{ cl::sycl::device{}, cl::sycl::property::queue::enable_profiling {} };
}

Results in

>------ Build All started: Project: Test-Applications, Configuration: MSVC-Release-dynamic ------
  [1/3] Building ComputeCpp integration header file C:/Users/mnagy/CMakeBuilds/9d9bac51-f361-4537-921d-1e5e7aee3b63/build/MSVC-Release-dynamic/Main.cpp.sycl
  [2/3] Building CXX object CMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj
  [3/3] Linking CXX executable SYCL-SAXPY.exe
  FAILED: SYCL-SAXPY.exe 
  cmd.exe /C "cd . && "C:\Kellekek\Microsoft\Visual Studio\16\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\SYCL-SAXPY.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x64\mt.exe --manifests  -- C:\Kellekek\MICROS~1\VISUAL~1\16\VC\Tools\MSVC\1421~1.276\bin\Hostx64\x64\link.exe /nologo CMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj CMakeFiles\SYCL-SAXPY.dir\Options.cpp.obj  /out:SYCL-SAXPY.exe /implib:SYCL-SAXPY.lib /pdb:SYCL-SAXPY.pdb /version:0.0  /machine:x64 /INCREMENTAL:NO /subsystem:console  C:\Kellekek\Codeplay\ComputeCpp\1.1.0\lib\ComputeCpp_vs2015.lib C:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\lib\OpenCL.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\Users\mnagy\CMakeBuilds\9d9bac51-f361-4537-921d-1e5e7aee3b63\build\MSVC-Release-dynamic && powershell -noprofile -executionpolicy Bypass -file C:/Users/mnagy/Source/Repos/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/mnagy/CMakeBuilds/9d9bac51-f361-4537-921d-1e5e7aee3b63/build/MSVC-Release-dynamic/SYCL-SAXPY.exe -installedDir C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/bin -OutVariable out""
  LINK: command "C:\Kellekek\MICROS~1\VISUAL~1\16\VC\Tools\MSVC\1421~1.276\bin\Hostx64\x64\link.exe /nologo CMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj CMakeFiles\SYCL-SAXPY.dir\Options.cpp.obj /out:SYCL-SAXPY.exe /implib:SYCL-SAXPY.lib /pdb:SYCL-SAXPY.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console C:\Kellekek\Codeplay\ComputeCpp\1.1.0\lib\ComputeCpp_vs2015.lib C:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\lib\OpenCL.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:SYCL-SAXPY.exe.manifest" failed (exit code 1120) with the following output:
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: class std::shared_ptr<class cl::sycl::detail::property_base> * __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Umove(class std::shared_ptr<class cl::sycl::detail::property_base> *,class std::shared_ptr<class cl::sycl::detail::property_base> *,class std::shared_ptr<class cl::sycl::detail::property_base> *)" (__imp_?_Umove@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@AEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@2@PEAV32@00@Z) referenced in function "public: class std::shared_ptr<class cl::sycl::detail::property_base> * __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Emplace_reallocate<class cl::sycl::property::queue::enable_profiling *,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> >(class std::shared_ptr<class cl::sycl::detail::property_base> * const,class cl::sycl::property::queue::enable_profiling * &&,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> &&)" (??$_Emplace_reallocate@PEAVenable_profiling@queue@property@sycl@cl@@U?$default_delete@Venable_profiling@queue@property@sycl@cl@@@std@@@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@QEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@1@QEAV21@$$QEAPEAVenable_profiling@queue@property@sycl@cl@@$$QEAU?$default_delete@Venable_profiling@queue@property@sycl@cl@@@1@@Z)
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Umove_if_noexcept(class std::shared_ptr<class cl::sycl::detail::property_base> *,class std::shared_ptr<class cl::sycl::detail::property_base> *,class std::shared_ptr<class cl::sycl::detail::property_base> *)" (__imp_?_Umove_if_noexcept@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@AEAAXPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@2@00@Z) referenced in function "public: class std::shared_ptr<class cl::sycl::detail::property_base> * __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Emplace_reallocate<class cl::sycl::property::queue::enable_profiling *,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> >(class std::shared_ptr<class cl::sycl::detail::property_base> * const,class cl::sycl::property::queue::enable_profiling * &&,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> &&)" (??$_Emplace_reallocate@PEAVenable_profiling@queue@property@sycl@cl@@U?$default_delete@Venable_profiling@queue@property@sycl@cl@@@std@@@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@QEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@1@QEAV21@$$QEAPEAVenable_profiling@queue@property@sycl@cl@@$$QEAU?$default_delete@Venable_profiling@queue@property@sycl@cl@@@1@@Z)
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Destroy(class std::shared_ptr<class cl::sycl::detail::property_base> *,class std::shared_ptr<class cl::sycl::detail::property_base> *)" (__imp_?_Destroy@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@AEAAXPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@2@0@Z) referenced in function __catch$??$_Emplace_reallocate@PEAVenable_profiling@queue@property@sycl@cl@@U?$default_delete@Venable_profiling@queue@property@sycl@cl@@@std@@@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@QEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@1@QEAV21@$$QEAPEAVenable_profiling@queue@property@sycl@cl@@$$QEAU?$default_delete@Venable_profiling@queue@property@sycl@cl@@@1@@Z$0
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: unsigned __int64 __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Calculate_growth(unsigned __int64)const " (__imp_?_Calculate_growth@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@AEBA_K_K@Z) referenced in function "public: class std::shared_ptr<class cl::sycl::detail::property_base> * __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Emplace_reallocate<class cl::sycl::property::queue::enable_profiling *,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> >(class std::shared_ptr<class cl::sycl::detail::property_base> * const,class cl::sycl::property::queue::enable_profiling * &&,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> &&)" (??$_Emplace_reallocate@PEAVenable_profiling@queue@property@sycl@cl@@U?$default_delete@Venable_profiling@queue@property@sycl@cl@@@std@@@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@QEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@1@QEAV21@$$QEAPEAVenable_profiling@queue@property@sycl@cl@@$$QEAU?$default_delete@Venable_profiling@queue@property@sycl@cl@@@1@@Z)
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Change_array(class std::shared_ptr<class cl::sycl::detail::property_base> * const,unsigned __int64,unsigned __int64)" (__imp_?_Change_array@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@AEAAXQEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@2@_K1@Z) referenced in function "public: class std::shared_ptr<class cl::sycl::detail::property_base> * __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Emplace_reallocate<class cl::sycl::property::queue::enable_profiling *,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> >(class std::shared_ptr<class cl::sycl::detail::property_base> * const,class cl::sycl::property::queue::enable_profiling * &&,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> &&)" (??$_Emplace_reallocate@PEAVenable_profiling@queue@property@sycl@cl@@U?$default_delete@Venable_profiling@queue@property@sycl@cl@@@std@@@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@QEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@1@QEAV21@$$QEAPEAVenable_profiling@queue@property@sycl@cl@@$$QEAU?$default_delete@Venable_profiling@queue@property@sycl@cl@@@1@@Z)
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static void __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Xlength(void)" (__imp_?_Xlength@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@CAXXZ) referenced in function "public: class std::shared_ptr<class cl::sycl::detail::property_base> * __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Emplace_reallocate<class cl::sycl::property::queue::enable_profiling *,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> >(class std::shared_ptr<class cl::sycl::detail::property_base> * const,class cl::sycl::property::queue::enable_profiling * &&,struct std::default_delete<class cl::sycl::property::queue::enable_profiling> &&)" (??$_Emplace_reallocate@PEAVenable_profiling@queue@property@sycl@cl@@U?$default_delete@Venable_profiling@queue@property@sycl@cl@@@std@@@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@QEAAPEAV?$shared_ptr@Vproperty_base@detail@sycl@cl@@@1@QEAV21@$$QEAPEAVenable_profiling@queue@property@sycl@cl@@$$QEAU?$default_delete@Venable_profiling@queue@property@sycl@cl@@@1@@Z)
C:\Users\mnagy\Source\Repos\Main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > & __cdecl std::vector<class std::shared_ptr<class cl::sycl::detail::property_base>,class std::allocator<class std::shared_ptr<class cl::sycl::detail::property_base> > >::_Getal(void)" (__imp_?_Getal@?$vector@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@V?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@@std@@AEAAAEAV?$allocator@V?$shared_ptr@Vproperty_base@detail@sycl@cl@@@std@@@2@XZ) referenced in function "public: __cdecl cl::sycl::property_list::property_list<class cl::sycl::property::queue::enable_profiling,void,void>(class cl::sycl::property::queue::enable_profiling &&)" (??$?0Venable_profiling@queue@property@sycl@cl@@XX@property_list@sycl@cl@@QEAA@$$QEAVenable_profiling@queue@property@12@@Z)
C:\Users\mnagy\Source\Repos\SYCL-SAXPY.exe : fatal error LNK1120: 7 unresolved externals
  ninja: build stopped: subcommand failed.

Build All failed.

Am I doing domething wrong?

How are you creating the project? If we use the templates to generate a project, copy in the source and build it works fine, but maybe you are creating it on the command line?

I am using FindComputeCpp.cmake and it happens with both the cutting edge VS 16 2019 (MSVC 19.20) and with the supported VS 15 2017 (MSVC 19.16). For the sake of simplicity and pedantry, this is how it plays out on the command line with MSVC 19.16:

PS C:\Users\mnagy\CMakeBuilds\SYCL-SAXPY> cmake -G Ninja -D CMAKE_TOOLCHAIN_FILE=C:\Users\mnagy\Source\Repos\vcpkg\scripts\buildsystems\vcpkg.cmake -D CMAKE_VERBOSE_MAKEFILE=ON -D CMAKE_BUILD_TYPE=Release C:\Users\mnagy\Source\Repos\Test-Applications\SYCL-SAXPY\
-- The CXX compiler identification is MSVC 19.16.27030.1
-- Check for working CXX compiler: C:/Kellekek/Microsoft/Visual Studio/15/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Kellekek/Microsoft/Visual Studio/15/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found TCLAP: C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/include
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/lib/OpenCL.lib (found version "2.2")
-- platform - your system can support ComputeCpp
-- Device compiler does not meet certain STL version requirements. Disabling version checks and hoping for the best.
-- Found ComputeCpp: C:/Kellekek/Codeplay/ComputeCpp/1.1.2 (found version "CE 1.1.2")
-- compute++ flags - -O2;-mllvm;-inline-threshold=1000;-sycl;-sycl-target;spir64;-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH;-sycl-target;spir64
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/mnagy/CMakeBuilds/SYCL-SAXPY
PS C:\Users\mnagy\CMakeBuilds\SYCL-SAXPY> cmake --build .[1/4] cmd.exe /C "cd /D C:\Users\mnagy\CMakeBuilds\SYCL-SAXPY && C:\Kellekek\Codeplay\ComputeCpp\1.1.2\bin\compute++.exe -O2 -mllvm -inline-threshold=1000 -sycl -sycl-target spir64 -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -sycl-target spir64 -std=c++14 -I"C:/Users/mnagy/Source/Repos/Test-Applications/SYCL-SAXPY"        -I"C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/include"     -I"C:/Kellekek/Codeplay/ComputeCpp/1.1.2/include"       -I"C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/include"  -o C:/Users/mnagy/CMakeBuilds/SYCL-SAXPY/Main.cpp.sycl -c C:/Users/mnagy/Source/Repos/Test-Applications/SYCL-SAXPY/Main.cpp -MMD -MF C:/Users/mnagy/CMakeBuilds/SYCL-SAXPY/Main.cpp.sycl.d -MT Main.cpp.sycl"
remark: [Computecpp:CC0027]: Some memcpy/memset intrinsics added by the llvm optimizer were replaced by serial functions. This is a workaround for OpenCL drivers that do not support those intrinsics. This may impact performance, consider using -no-serial-memop. [-Rsycl-serial-memop]
[2/4] C:\Kellekek\MICROS~1\VISUAL~1\15\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe   /TP  -IC:\Users\mnagy\Source\Repos\Test-Applications\SYCL-SAXPY -IC:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\include -IC:\Kellekek\Codeplay\ComputeCpp\1.1.2\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG   -std:c++14 /FI C:/Users/mnagy/CMakeBuilds/SYCL-SAXPY/Main.cpp.sycl /TP /showIncludes /FoCMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj /FdCMakeFiles\SYCL-SAXPY.dir\ /FS -c C:\Users\mnagy\Source\Repos\Test-Applications\SYCL-SAXPY\Main.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27030.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

[3/4] C:\Kellekek\MICROS~1\VISUAL~1\15\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe   /TP  -IC:\Users\mnagy\Source\Repos\Test-Applications\SYCL-SAXPY -IC:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\include -IC:\Kellekek\Codeplay\ComputeCpp\1.1.2\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG   -std:c++14 /showIncludes /FoCMakeFiles\SYCL-SAXPY.dir\Options.cpp.obj /FdCMakeFiles\SYCL-SAXPY.dir\ /FS -c C:\Users\mnagy\Source\Repos\Test-Applications\SYCL-SAXPY\Options.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27030.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

[4/4] cmd.exe /C "cd . && C:\Kellekek\Chocolatey\lib\cmake.portable\tools\cmake-3.11.2-win64-x64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\SYCL-SAXPY.dir --manifests  -- C:\Kellekek\MICROS~1\VISUAL~1\15\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe  CMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj CMakeFiles\SYCL-SAXPY.dir\Options.cpp.obj  /out:SYCL-SAXPY.exe /implib:SYCL-SAXPY.lib /pdb:SYCL-SAXPY.pdb /version:0.0  /machine:x64 /INCREMENTAL:NO /subsystem:console  C:\Kellekek\Codeplay\ComputeCpp\1.1.2\lib\ComputeCpp_vs2015.lib C:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\lib\OpenCL.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\Users\mnagy\CMakeBuilds\SYCL-SAXPY && powershell -noprofile -executionpolicy Bypass -file C:/Users/mnagy/Source/Repos/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/mnagy/CMakeBuilds/SYCL-SAXPY/SYCL-SAXPY.exe -installedDir C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/bin -OutVariable out""
FAILED: SYCL-SAXPY.exe
cmd.exe /C "cd . && C:\Kellekek\Chocolatey\lib\cmake.portable\tools\cmake-3.11.2-win64-x64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\SYCL-SAXPY.dir --manifests  -- C:\Kellekek\MICROS~1\VISUAL~1\15\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe  CMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj CMakeFiles\SYCL-SAXPY.dir\Options.cpp.obj  /out:SYCL-SAXPY.exe /implib:SYCL-SAXPY.lib /pdb:SYCL-SAXPY.pdb /version:0.0  /machine:x64 /INCREMENTAL:NO /subsystem:console  C:\Kellekek\Codeplay\ComputeCpp\1.1.2\lib\ComputeCpp_vs2015.lib C:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\lib\OpenCL.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\Users\mnagy\CMakeBuilds\SYCL-SAXPY && powershell -noprofile -executionpolicy Bypass -file C:/Users/mnagy/Source/Repos/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/mnagy/CMakeBuilds/SYCL-SAXPY/SYCL-SAXPY.exe -installedDir C:/Users/mnagy/Source/Repos/vcpkg/installed/x64-windows/bin -OutVariable out""
LINK: command "C:\Kellekek\MICROS~1\VISUAL~1\15\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe CMakeFiles\SYCL-SAXPY.dir\Main.cpp.obj CMakeFiles\SYCL-SAXPY.dir\Options.cpp.obj /out:SYCL-SAXPY.exe /implib:SYCL-SAXPY.lib /pdb:SYCL-SAXPY.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console C:\Kellekek\Codeplay\ComputeCpp\1.1.2\lib\ComputeCpp_vs2015.lib C:\Users\mnagy\Source\Repos\vcpkg\installed\x64-windows\lib\OpenCL.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:SYCL-SAXPY.exe.manifest" failed (exit code 1120) with the following output:
Microsoft (R) Incremental Linker Version 14.16.27030.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Main.cpp.obj : error LNK2019: unresolved external symbol <console explodes with aforementioned temlpate symbol monsters>

How are the compilers not invoked the way they are intended? I’d be glad to patch FindComputeCpp.cmake and send a PR if need be.

1 Like

We think it’s something to do with this toolchain file that you are using and the way this is setting up the build arguments:

This is the standard build argument set

<CommandLineTemplate>"[ComputeCppRootDir]\bin\compute++.exe" -D_SIZE_T_DEFINED -Wno-ignored-attributes -fdiagnostics-format=msvc -sycl -O2 -nobuiltininc [DeviceAdditionalIncludeDirectories] [DeviceOutputFileName] -c [Inputs] [DeviceAdditionalOptions]</CommandLineTemplate>

I may be wrong here, but how are the arguments to compute++ relevant here? No code gen is supposed to happen inside compute++ in relation to the command queue construction, it is just a template machinery that forwards the properties after type check to the underlyling OpenCL runtime. Linker errors and symbols missing originating from cl::sycl::queue CTOR invocation should have nothing to do with compute++ flags.

Am I misunderstanding something from the compilation model?

The way I see from the linker error is that ComputeCpp is using a non-header-only implementation for the queue_properties class and would require STL internals to be instantiated. The ComputeCpp extension to Visual Studio would very much like to use the v140 toolset. (I just gave the code a spin on Dániels machine, who also doesn’t have v140 installed. After retartgeting the solution to v141, he gets the same linker errors.) My guess is that Codeplay only tests releases using v140 (in VS2015) which is becoming highly outdated. VS 2017 (v141) and VS 2019 (v142) are binary compatible with VS 2015 and most applications do work. However, in this case, something seems to have gone wrong, some internals of the queue_properties class is referring to implementation functions that no longer exist.

MSVC having just recently reached C++14 conformance, using libraries like Boost::Hana et al. require pretty much latest v142 toolset. v142 supposedly being link compatible with all the way back to v140, it would be nice if ComputeCpp could play along.

We’ve now been able to reproduce it and it is indeed to do with using v141. I’m just talking with the team to find out more.

In order to resolve this we will need to produce separate binaries for v141/142. I’ll update when we have information about this.

1 Like