build on windows with csharp interface failed
cmake -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DBUILD_META_EXAMPLES=OFF -DENABLE_TESTING=OFF -DINTERFACE_CSHARP=ON ..
the cmake out is ,don't know why it Could NOT find CSharp
-- Found the following C# .NET versions: v4.0.30319, v3.5, v2.0.50727
CMake Error at D:/soft/cmake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find CSharp (missing: CSHARP_INTERPRETER) (found version
"v2.0.50727")
Call Stack (most recent call first):
D:/soft/cmake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindCSharp.cmake:66 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/interfaces/csharp/CMakeLists.txt:1 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
See also "D:/source/shogun/build/CMakeFiles/CMakeOutput.log".
See also "D:/source/shogun/build/CMakeFiles/CMakeError.log".
oh we never tried C# on windows. would be great to get it working. as far as i can see our .NET cmake script is waaaaay too old. lemme look into it a bit.
I make a manual build C# on windows ,but the procedure is ugly mod ,comment out a few line code in cmake script. it will be great if you can modify the .NET cmake script .
this is my mod ,
diff --git a/cmake/FindCSharp.cmake b/cmake/FindCSharp.cmake
index 10b7fd55b..3579719d4 100644
--- a/cmake/FindCSharp.cmake
+++ b/cmake/FindCSharp.cmake
@@ -64,12 +64,12 @@ endif( )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CSharp FOUND_VAR CSHARP_FOUND
- REQUIRED_VARS CSHARP_TYPE CSHARP_COMPILER CSHARP_INTERPRETER
+ REQUIRED_VARS CSHARP_TYPE CSHARP_COMPILER
VERSION_VAR CSHARP_VERSION)
-mark_as_advanced( CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER CSHARP_INTERPRETER CSHARP_PLATFORM CSHARP_SDK )
+mark_as_advanced( CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER CSHARP_PLATFORM CSHARP_SDK )
# Set the USE_FILE path
# http://public.kitware.com/Bug/view.php?id=7757
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
-set( CSHARP_USE_FILE ${current_list_path}/UseCSharp.cmake )
\ No newline at end of file
+set( CSHARP_USE_FILE ${current_list_path}/UseCSharp.cmake )
diff --git a/cmake/FindDotNetFrameworkSdk.cmake b/cmake/FindDotNetFrameworkSdk.cmake
index 0b321b411..35e2c59e9 100644
--- a/cmake/FindDotNetFrameworkSdk.cmake
+++ b/cmake/FindDotNetFrameworkSdk.cmake
@@ -77,15 +77,16 @@ if( CSHARP_DOTNET_FOUND )
# Do not force, so that the user can manually select their own version if they wish
if ( DEFINED CSHARP_DOTNET_COMPILER_v2.0.50727 )
# If available, select .NET v2.0.50727 (this is the minimal version as it supports generics, and allows use of VS2008)
- set( CSHARP_DOTNET_VERSION "v2.0.50727" CACHE STRING "C# .NET compiler version" )
+ set( CSHARP_DOTNET_VERSION "v4.0.30319" CACHE STRING "C# .NET compiler version" )
else( )
# Select the highest version (first in reverse sorted list)
- list( GET CSHARP_DOTNET_VERSIONS 0 csharp_dotnet_version_temp )
- set( CSHARP_DOTNET_VERSION ${csharp_dotnet_version_temp} CACHE STRING "C# .NET compiler version" )
+ #list( GET CSHARP_DOTNET_VERSIONS 0 csharp_dotnet_version_temp )
+ #set( CSHARP_DOTNET_VERSION ${csharp_dotnet_version_temp} CACHE STRING "C# .NET compiler version" )
+ set( CSHARP_DOTNET_VERSION "v4.0.30319" CACHE STRING "C# .NET compiler version" )
endif( )
mark_as_advanced( CSHARP_DOTNET_VERSION )
endif( )
# Set USE_FILE
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
-set( DotNetFrameworkSdk_USE_FILE ${current_list_path}/UseDotNetFrameworkSdk.cmake )
\ No newline at end of file
+set( DotNetFrameworkSdk_USE_FILE ${current_list_path}/UseDotNetFrameworkSdk.cmake )
diff --git a/data b/data
index d62d2a31f..7fecaa29f 160000
--- a/data
+++ b/data
@@ -1 +1 @@
-Subproject commit d62d2a31ffdcabaf86c6b58d4559a8af48fefa41
+Subproject commit 7fecaa29f5a2eb34191b05613e7f7ce717e64d0b
diff --git a/src/gpl b/src/gpl
index 31b7d62ee..0b5c4f4c6 160000
--- a/src/gpl
+++ b/src/gpl
@@ -1 +1 @@
-Subproject commit 31b7d62eed794f82f45f6aacc1443819e2c9a48e
+Subproject commit 0b5c4f4c616205c8765163c2dc03474656f0f7b6
after these mod ,run
cmake -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DBUILD_META_EXAMPLES=ON -DENABLE_TESTING=OFF -DINTERFACE_CSHARP=ON -DCSHARP_DOTNET_VERSION="v4.0.30319" ..
it will generated makefile successfully ,but still can't build the .net dll , need manually execute:
setlocal
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:library /out:shogun.net.dll *.cs
@armgong thnx for the report and sorry for the late reply... i'm currently getting this sorted. note that no need to replace the SDK version as you can just specify via '-DCSHARP_DOTNET_VERSION=
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.