# How to build a package?

**URL:** <https://discourse.julialang.org/t/how-to-build-a-package/54755>\
**Category:** General Usage\
**Created:** [February 6, 2021, 9:17pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755 "2021-02-06T21:17:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nova](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nova](https://discourse.julialang.org/u/Nova)\
**Post date:** [February 6, 2021, 9:17pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/1 "2021-02-06T21:17:07Z")

</div>

I need to use the following package:  
[https://github.com/kahypar/KaHyPar.jl](https://github.com/kahypar/KaHyPar.jl)

However, it is not compatible with macOS and it requires building it before the installation. Can you please help me to do that?  
I already downloaded the code but I couldn’t figure out how to build the package.

---

<div class="post-metadata">

**Author:** ![logankilpatrick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/logankilpatrick/32/38123_2.png) [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Post date:** [February 6, 2021, 9:24pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/2 "2021-02-06T21:24:03Z")

</div>

I am pretty sure you need to build as in follow these instructions: [GitHub - kahypar/kahypar: KaHyPar (Karlsruhe Hypergraph Partitioning) is a multilevel hypergraph partitioning framework providing direct k-way and recursive bisection based partitioning algorithms that compute solutions of very high quality.](https://github.com/kahypar/kahypar#building-kahypar)

---

<div class="post-metadata">

**Author:** ![Nova](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nova](https://discourse.julialang.org/u/Nova)\
**Post date:** [February 6, 2021, 10:17pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/3 "2021-02-06T22:17:57Z")

</div>

The problem is that I get an error when I type the firs line in terminal:

```julia
git clone --depth=1 --recursive git@github.com:SebastianSchlag/kahypar.git

Cloning into 'kahypar'...

git@github.com: Permission denied (publickey).

fatal: Could not read from remote repository.

```

---

<div class="post-metadata">

**Author:** ![macd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/macd/32/3257_2.png) [@macd](https://discourse.julialang.org/u/macd)\
**Post date:** [February 6, 2021, 10:30pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/4 "2021-02-06T22:30:30Z")

</div>

Try `git clone --depth=1 --recursive https://github.com/SebastianSchlag/kahypar` instead

---

<div class="post-metadata">

**Author:** ![Nova](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nova](https://discourse.julialang.org/u/Nova)\
**Post date:** [February 6, 2021, 11:22pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/5 "2021-02-06T23:22:56Z")

</div>

> [@macd](#):
>
> [GitHub - kahypar/kahypar: KaHyPar (Karlsruhe Hypergraph Partitioning) is a multilevel hypergraph partitioning framework providing direct k-way and recursive bisection based partitioning algorithms that compute solutions of very high quality.](https://github.com/SebastianSchlag/kahypar)

After building the package, when I try to set the environment variable as it is mentioned, I get the following error:

```julia
julia> ENV["JULIA_KAHYPAR_LIBRARY_PATH"] = /Desktop/kahypar/build/lib

ERROR: syntax: "/" is not a unary operator

```

Also when I try this, I get this error:

```julia
(@v1.5) pkg> ENV["JULIA_KAHYPAR_LIBRARY_PATH"] = /Desktop/kahypar/build/lib

ERROR: Could not determine command

```

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [February 6, 2021, 11:43pm UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/6 "2021-02-06T23:43:46Z")

</div>

> [@Nova](#):
>
> After building the package, when I try to set the environment variable as it is mentioned, I get the following error:
> 
> ```julia
> julia> ENV["JULIA_KAHYPAR_LIBRARY_PATH"] = /Desktop/kahypar/build/lib
> 
> ERROR: syntax: "/" is not a unary operator
> 
> ```

The right hand side still needs to be a valid Julia string, i.e.:

```julia
ENV["JULIA_KAHYPAR_LIBRARY_PATH"] = "/Desktop/kahypar/build/lib"

```

Of course the most elegant solution here would probably be to try to get KaHyPar into Yggdrasil, so this would just work on all platforms automatically.

---

<div class="post-metadata">

**Author:** ![Nova](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@Nova](https://discourse.julialang.org/u/Nova)\
**Post date:** [February 7, 2021, 12:18am UTC](https://discourse.julialang.org/t/how-to-build-a-package/54755/7 "2021-02-07T00:18:28Z")

</div>

> [@simeonschaub](#):
>
> Yggdrasil

I would rather install it on my computer since I have to do the run-time comparison between several methods.

So far, everything is installed and I successfully complete all the steps. However, when I run Pkg.test(“KaHyPar”) it returns me an error and asks me to re-run Pkg.build(“KaHyPar”).

By running Pkg.build(“KaHyPar”), I get the following error:

```julia
julia> Pkg.build("KaHyPar")
   Building KaHyPar → `~/.julia/packages/KaHyPar/x8xg0/deps/build.log`
┌ Error: Error building `KaHyPar`: 
│ ERROR: LoadError: Could not find the libboost_program_options library

```

I think that this is related to  
The [Boost.Program\_options](http://www.boost.org/doc/libs/1_58_0/doc/html/program_options.html) library and the boost header files  
mentioned in the requirements but I don’t know what it is exactly and how I should deal with that.
