Unverified Commit 6cb968af authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] remove unused Eigen files, compile with EIGEN_MPL2_ONLY (fixes #3684) (#3685)



* [python-package] remove unused Eigen files (fixes #3684)

* more changes

* add EIGEN_MPL2_ONLY in VS solution file

* fix VS project

* remove EIGEN_MPL2_ONLY define in linear_tree_learner
Co-authored-by: default avatarNikita Titov <nekit94-12@hotmail.com>
parent 68a40c79
...@@ -93,6 +93,9 @@ endif(USE_SWIG) ...@@ -93,6 +93,9 @@ endif(USE_SWIG)
SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/eigen") SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/eigen")
include_directories(${EIGEN_DIR}) include_directories(${EIGEN_DIR})
# See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
if(__BUILD_FOR_R) if(__BUILD_FOR_R)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
find_package(LibR REQUIRED) find_package(LibR REQUIRED)
......
...@@ -10,7 +10,29 @@ include compile/compute/CMakeLists.txt ...@@ -10,7 +10,29 @@ include compile/compute/CMakeLists.txt
recursive-include compile/compute/cmake * recursive-include compile/compute/cmake *
recursive-include compile/compute/include * recursive-include compile/compute/include *
recursive-include compile/compute/meta * recursive-include compile/compute/meta *
recursive-include compile/eigen * include compile/eigen/CMakeLists.txt
include compile/eigen/Eigen/CMakeLists.txt
include compile/eigen/Eigen/Cholesky
include compile/eigen/Eigen/Core
include compile/eigen/Eigen/Dense
include compile/eigen/Eigen/Eigenvalues
include compile/eigen/Eigen/Geometry
include compile/eigen/Eigen/Householder
include compile/eigen/Eigen/Jacobi
include compile/eigen/Eigen/LU
include compile/eigen/Eigen/QR
include compile/eigen/Eigen/SVD
recursive-include compile/eigen/Eigen/src/Cholesky *
recursive-include compile/eigen/Eigen/src/Core *
recursive-include compile/eigen/Eigen/src/Eigenvalues *
recursive-include compile/eigen/Eigen/src/Geometry *
recursive-include compile/eigen/Eigen/src/Householder *
recursive-include compile/eigen/Eigen/src/Jacobi *
recursive-include compile/eigen/Eigen/src/LU *
recursive-include compile/eigen/Eigen/src/misc *
recursive-include compile/eigen/Eigen/src/plugins *
recursive-include compile/eigen/Eigen/src/QR *
recursive-include compile/eigen/Eigen/src/SVD *
include compile/external_libs/fast_double_parser/CMakeLists.txt include compile/external_libs/fast_double_parser/CMakeLists.txt
include compile/external_libs/fast_double_parser/LICENSE include compile/external_libs/fast_double_parser/LICENSE
include compile/external_libs/fast_double_parser/LICENSE.BSL include compile/external_libs/fast_double_parser/LICENSE.BSL
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <algorithm> #include <algorithm>
#ifndef LGB_R_BUILD #ifndef LGB_R_BUILD
// preprocessor definition ensures we use only MPL2-licensed code
#define EIGEN_MPL2_ONLY
#include <Eigen/Dense> #include <Eigen/Dense>
#endif // !LGB_R_BUILD #endif // !LGB_R_BUILD
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="Projectconfigurations"> <ItemGroup Label="Projectconfigurations">
<ProjectConfiguration Include="Debug_DLL|x64"> <ProjectConfiguration Include="Debug_DLL|x64">
...@@ -99,9 +99,14 @@ ...@@ -99,9 +99,14 @@
<IncludePath>..\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath> <IncludePath>..\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<TargetName>lib_lightgbm</TargetName> <TargetName>lib_lightgbm</TargetName>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>EIGEN_MPL2_ONLY</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_mpi|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_mpi|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>USE_MPI</PreprocessorDefinitions> <PreprocessorDefinitions>USE_MPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
...@@ -124,7 +129,7 @@ ...@@ -124,7 +129,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>USE_SOCKET</PreprocessorDefinitions> <PreprocessorDefinitions>USE_SOCKET;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
...@@ -144,7 +149,7 @@ ...@@ -144,7 +149,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>USE_SOCKET</PreprocessorDefinitions> <PreprocessorDefinitions>USE_SOCKET;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<OpenMPSupport>true</OpenMPSupport> <OpenMPSupport>true</OpenMPSupport>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed> <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="src"> <Filter Include="src">
...@@ -225,6 +225,9 @@ ...@@ -225,6 +225,9 @@
<ClInclude Include="..\src\treelearner\monotone_constraints.hpp"> <ClInclude Include="..\src\treelearner\monotone_constraints.hpp">
<Filter>src\treelearner</Filter> <Filter>src\treelearner</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\treelearner\linear_tree_learner.h">
<Filter>src\treelearner</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\src\application\application.cpp"> <ClCompile Include="..\src\application\application.cpp">
...@@ -320,5 +323,8 @@ ...@@ -320,5 +323,8 @@
<ClCompile Include="..\src\io\train_share_states.cpp"> <ClCompile Include="..\src\io\train_share_states.cpp">
<Filter>src\io</Filter> <Filter>src\io</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\treelearner\linear_tree_learner.cpp">
<Filter>src\treelearner</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment