-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
lightgbm.rb
41 lines (36 loc) 路 1.37 KB
/
lightgbm.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Lightgbm < Formula
desc "Fast, distributed, high performance gradient boosting framework"
homepage "https://github.com/microsoft/LightGBM"
url "https://github.com/microsoft/LightGBM/archive/v2.2.3.tar.gz"
sha256 "4a6414e808b343a784f0ee805ac723c094488f9e9a951dd3f709dc31ffb4ea4c"
bottle do
cellar :any
sha256 "6b0e9080fcf9489c9163e793a03b0f9c26e9c4a6edea02170462ccff675a814b" => :mojave
sha256 "a7627eb122264e31f54b32d1fe29559ef77cd0a67e6c532ebda098cf6a477abc" => :high_sierra
sha256 "d8c8e257d9115cbfd61dd45f58faa72d98556367a9ae78f1562a729f35be3cee" => :sierra
end
depends_on "cmake" => :build
depends_on "libomp"
def install
mkdir "build" do
libomp = Formula["libomp"]
args = std_cmake_args
args << "-DOpenMP_C_FLAGS=\"-Xpreprocessor -fopenmp -I#{libomp.opt_include}\""
args << "-DOpenMP_C_LIB_NAMES=omp"
args << "-DOpenMP_CXX_FLAGS=\"-Xpreprocessor -fopenmp -I#{libomp.opt_include}\""
args << "-DOpenMP_CXX_LIB_NAMES=omp"
args << "-DOpenMP_omp_LIBRARY=#{libomp.opt_lib}/libomp.dylib"
args << "-DAPPLE_OUTPUT_DYLIB=ON"
system "cmake", *args, ".."
system "make"
system "make", "install"
end
pkgshare.install "examples"
end
test do
cp_r (pkgshare/"examples/regression"), testpath
cd "regression" do
system "#{bin}/lightgbm", "config=train.conf"
end
end
end