0

I have openblas.targets file which has the following content:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemDefinitionGroup>
    <ClCompile>
      <PreprocessorDefinitions>HAS_OPENBLAS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)..\..\lib\native\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
    <Link>
      <AdditionalDependencies>$(MSBuildThisFileDirectory)..\..\lib\native\lib\win32\libopenblas.dll.a;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
    <Link>
      <AdditionalDependencies>$(MSBuildThisFileDirectory)..\..\lib\native\lib\x64\libopenblas.dll.a;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup Condition="'$(Platform)'=='Win32'">
    <CopyToOutput Include="$(MSBuildThisFileDirectory)..\..\lib\native\bin\win32\*.dll" />
  </ItemGroup>
  <ItemGroup Condition="'$(Platform)'=='x64'">
    <CopyToOutput Include="$(MSBuildThisFileDirectory)..\..\lib\native\bin\x64\*.dll" />
  </ItemGroup>
  <Target Name="OpenBLAS_AfterBuild" AfterTargets="AfterBuild">
    <Copy 
      SkipUnchangedFiles="true" 
      UseHardlinksIfPossible="true"
      SourceFiles="@(CopyToOutput)"  
      DestinationFolder="$(TargetDir)" />
  </Target>

</Project>

And while building a project that uses it as a dependency causes this error:

E:\msCaffe\NugetPackages\OpenBLAS.0.2.14.1\build\native\openblas.targets(26,5): error MSB3030: Could not copy the file "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" because it was not found.
E:\msCaffe\NugetPackages\OpenBLAS.0.2.14.1\build\native\openblas.targets(26,5): error MSB3030: Could not copy the file "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC120.DebugCRT\msvcr120d.dll" because it was not found.

which is right as the files are in

E:\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT
E:\Microsoft Visual Studio 12.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC120.DebugCRT

My VS installation in E:\Microsoft Visual Studio 12.0 I don't know why is it taking it as C:\Program Files (x86)\Microsoft Visual Studio 12.0?

How to correct this issue?

Animesh Pandey
  • 5,900
  • 13
  • 64
  • 130
  • Seems you're not showing all related code. The error is about copying msvcr120 dlls but nowhere in the code you show these files are declared.. (well, unless the idea is that $(MSBuildThisFileDirectory)..\..\lib\native\bin\win32\ is hardcoded as a symbolic link to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT which would be an almost ridiculous way to achieve this particular functionality). In any case, I'd file a bug report for OpenBlas as it's likely their bug. – stijn Mar 06 '16 at 09:26

1 Answers1

0

check the path for the variable

SourceFiles="@(CopyToOutput)"
Cazzador
  • 33
  • 2
  • 9