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)
SET(EIGEN_DIR "${PROJECT_SOURCE_DIR}/eigen")
include_directories(${EIGEN_DIR})
# See https://gitlab.com/libeigen/eigen/-/blob/master/COPYING.README
ADD_DEFINITIONS(-DEIGEN_MPL2_ONLY)
if(__BUILD_FOR_R)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
find_package(LibR REQUIRED)
......
......@@ -10,7 +10,29 @@ include compile/compute/CMakeLists.txt
recursive-include compile/compute/cmake *
recursive-include compile/compute/include *
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/LICENSE
include compile/external_libs/fast_double_parser/LICENSE.BSL
......
......@@ -7,8 +7,6 @@
#include <algorithm>
#ifndef LGB_R_BUILD
// preprocessor definition ensures we use only MPL2-licensed code
#define EIGEN_MPL2_ONLY
#include <Eigen/Dense>
#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">
<ItemGroup Label="Projectconfigurations">
<ProjectConfiguration Include="Debug_DLL|x64">
......@@ -99,9 +99,14 @@
<IncludePath>..\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<TargetName>lib_lightgbm</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>EIGEN_MPL2_ONLY</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_mpi|x64'">
<ClCompile>
<PreprocessorDefinitions>USE_MPI</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_MPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<OpenMPSupport>true</OpenMPSupport>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
......@@ -124,7 +129,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>USE_SOCKET</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_SOCKET;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<OpenMPSupport>true</OpenMPSupport>
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
......@@ -144,7 +149,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_DLL|x64'">
<ClCompile>
<PreprocessorDefinitions>USE_SOCKET</PreprocessorDefinitions>
<PreprocessorDefinitions>USE_SOCKET;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<OpenMPSupport>true</OpenMPSupport>
<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">
<ItemGroup>
<Filter Include="src">
......@@ -225,6 +225,9 @@
<ClInclude Include="..\src\treelearner\monotone_constraints.hpp">
<Filter>src\treelearner</Filter>
</ClInclude>
<ClInclude Include="..\src\treelearner\linear_tree_learner.h">
<Filter>src\treelearner</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\application\application.cpp">
......@@ -320,5 +323,8 @@
<ClCompile Include="..\src\io\train_share_states.cpp">
<Filter>src\io</Filter>
</ClCompile>
<ClCompile Include="..\src\treelearner\linear_tree_learner.cpp">
<Filter>src\treelearner</Filter>
</ClCompile>
</ItemGroup>
</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