Skip to content

Commit 81b62a8

Browse files
committed
first commit
0 parents  commit 81b62a8

File tree

8 files changed

+100
-0
lines changed

8 files changed

+100
-0
lines changed

.formatter.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/_build
2+
/cover
3+
/deps
4+
/doc
5+
/.fetch
6+
erl_crash.dump
7+
*.ez
8+
*.beam
9+
/config/*.secret.exs
10+
.elixir_ls/
11+
.tool-versions

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Exgboost
2+
3+
Elixir bindings to the XGBoost C API (https://xgboost.readthedocs.io/en/stable/c.html) using Native Implemented Functions (NIFs)
4+
5+
## Installation
6+
7+
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
8+
by adding `exgboost` to your list of dependencies in `mix.exs`:
9+
10+
```elixir
11+
def deps do
12+
[
13+
{:exgboost, "~> 0.1.0"}
14+
]
15+
end
16+
```
17+
18+
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
19+
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
20+
be found at <https://hexdocs.pm/exgboost>.
21+

lib/exgboost.ex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
defmodule Exgboost do
2+
@moduledoc """
3+
Documentation for `Exgboost`.
4+
"""
5+
6+
@doc """
7+
Hello world.
8+
9+
## Examples
10+
11+
iex> Exgboost.hello()
12+
:world
13+
14+
"""
15+
def hello do
16+
:world
17+
end
18+
end

mix.exs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
defmodule Exgboost.MixProject do
2+
use Mix.Project
3+
4+
def project do
5+
[
6+
app: :exgboost,
7+
version: "0.1.0",
8+
elixir: "~> 1.14",
9+
start_permanent: Mix.env() == :prod,
10+
deps: deps()
11+
]
12+
end
13+
14+
# Run "mix help compile.app" to learn about applications.
15+
def application do
16+
[
17+
extra_applications: [:logger]
18+
]
19+
end
20+
21+
# Run "mix help deps" to learn about dependencies.
22+
defp deps do
23+
[
24+
{:xgboost,
25+
git: "https://github.com/dmlc/xgboost.git",
26+
submodules: true,
27+
compile: "mkdir build && cmake -B build && make -C build install"}
28+
]
29+
end
30+
end
31+
32+
# For CUDA toolkit >= 11.4, `BUILD_WITH_CUDA_CUB` is required.
33+
# cmake .. -DUSE_CUDA=ON -DBUILD_WITH_CUDA_CUB=ON

mix.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
%{
2+
"elixir_cmake": {:hex, :elixir_cmake, "0.8.0", "675a8d0b401096dee01dd5b1108e86e5f399db01c3e34edc0f92034bf38d8764", [:mix], [], "hexpm", "afd87e2ed89dc02eb3efc4e9025a0b79c8322bea8a5f6d9abc6063ca696a67f8"},
3+
"xgboost": {:git, "https://github.com/dmlc/xgboost.git", "191d0aa5cfac87cfc122ebbe8b14da4177309d13", [submodules: true]},
4+
}

test/exgboost_test.exs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
defmodule ExgboostTest do
2+
use ExUnit.Case
3+
doctest Exgboost
4+
5+
test "greets the world" do
6+
assert Exgboost.hello() == :world
7+
end
8+
end

test/test_helper.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ExUnit.start()

0 commit comments

Comments
 (0)