Skip to content

Commit

Permalink
upgrade to 2024.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Apr 30, 2024
1 parent 53aa52f commit 35344c0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build/00-common.linq
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void DotNetRun(string args) => Run("dotnet", args.Dump(), Encoding.GetEnc
static void Run(string exe, string args, Encoding encoding) => Util.Cmd(exe, args, encoding);
static ProjectVersion[] Projects = new[]
{
new ProjectVersion("Sdcb.OpenVINO", "0.6.4"),
new ProjectVersion("Sdcb.OpenVINO", "0.6.5"),
new ProjectVersion("Sdcb.OpenVINO.Extensions.OpenCvSharp4", "0.6.1"),
new ProjectVersion("Sdcb.OpenVINO.PaddleOCR", "0.6.3"),
new ProjectVersion("Sdcb.OpenVINO.PaddleOCR.Models.Online", "0.6.2"),
Expand Down
2 changes: 1 addition & 1 deletion build/02-publish-proget-nuget.linq
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Refresh()
{
string dir = Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath)!, "nupkgs");
IEnumerable<string> pkgs = Directory.EnumerateFiles(dir, "*.nupkg")
.Where(x => !x.Contains("-preview.2"))
.Where(x => !x.Contains("-preview.1"))
;
dc.Content = new
{
Expand Down
4 changes: 2 additions & 2 deletions generator/Sdcb.OpenVINO.NuGetBuilder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static async Task Main(string[] args)
ArtifactDownloader w = sp.GetRequiredService<ArtifactDownloader>();
StorageNodeRoot root = sp.GetRequiredService<StorageNodeRoot>();
string purpose = args.Length > 0 ? args[0] : "win64";
string? versionSuffix = null; // null or "preview.1", can't be ""
string? versionSuffix = "preview.1"; // null or "preview.1", can't be ""
string dir = Path.Combine(DirectoryUtils.SearchFileInCurrentAndParentDirectories(new DirectoryInfo("."), "OpenVINO.NET.sln").DirectoryName!,
"build", "nupkgs");

Expand Down Expand Up @@ -85,7 +85,7 @@ private static async Task Build_Linuxs(ArtifactDownloader w, StorageNodeRoot roo
}
}

static IServiceProvider ConfigureServices()
static ServiceProvider ConfigureServices()
{
return new ServiceCollection()
.AddSingleton<ICachedHttpGetService>(_ => new CachedHttpGetService("cache"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.8.0.20230708" />
<PackageReference Include="Sdcb.OpenVINO.runtime.ubuntu.22.04-x64" Version="2023.2.0" />
<PackageReference Include="Sdcb.OpenVINO.runtime.win-x64" Version="2023.1.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0-release-24177-07" />
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.9.0.20240103" />
<PackageReference Include="Sdcb.OpenVINO.runtime.ubuntu.22.04-x64" Version="2024.1.0" />
<PackageReference Include="Sdcb.OpenVINO.runtime.win-x64" Version="2024.1.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="Sdcb.OpenVINO" Version="0.6.1" Condition="'$(Configuration)' != 'Debug'" />
<PackageReference Include="Sdcb.OpenVINO" Version="0.6.5" Condition="'$(Configuration)' != 'Debug'" />
<PackageReference Include="Sdcb.OpenVINO.Extensions.OpenCvSharp4" Version="0.6.1" Condition="'$(Configuration)' != 'Debug'" />

<ProjectReference Include="..\..\..\src\Sdcb.OpenVINO\Sdcb.OpenVINO.csproj" Condition="'$(Configuration)' == 'Debug'" />
Expand Down
14 changes: 11 additions & 3 deletions src/Sdcb.OpenVINO/Natives/OpenVINOLibraryLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,19 @@ static OpenVINOLibraryLoader()

#if LINQPad || NETCOREAPP3_1_OR_GREATER

public static List<string> SupportedVersionSuffixes { get; set; } = new()
{
"2410",
"2400",
"2330",
"2320",
"2310",
};

private static IntPtr OpenVINOImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
{
if (libraryName == Dll)
{
string[] allowedVersions = new[] { "2400", "2330", "2320", "2310" };
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return LoadWithDeps(assembly, searchPath, new LibDeps("openvino_c.dll", new string[]
Expand All @@ -71,7 +79,7 @@ private static IntPtr OpenVINOImportResolver(string libraryName, Assembly assemb
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return LoadWithDeps(assembly, searchPath, allowedVersions.Select(v => new LibDeps($"libopenvino_c.{v}.dylib", new string[]
return LoadWithDeps(assembly, searchPath, SupportedVersionSuffixes.Select(v => new LibDeps($"libopenvino_c.{v}.dylib", new string[]
{
$"libopenvino.{v}.dylib",
})).ToArray());
Expand All @@ -86,7 +94,7 @@ private static IntPtr OpenVINOImportResolver(string libraryName, Assembly assemb
else
{
/* linux or others */
return LoadWithDeps(assembly, searchPath, allowedVersions.Select(v => new LibDeps($"libopenvino_c.so.{v}", new string[]
return LoadWithDeps(assembly, searchPath, SupportedVersionSuffixes.Select(v => new LibDeps($"libopenvino_c.so.{v}", new string[]
{
$"libtbb.so.12",
$"libopenvino.so.{v}",
Expand Down

0 comments on commit 35344c0

Please sign in to comment.