Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default value of libsc preference #75

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ julia> using Preferences, UUIDs
julia> set_preferences!(
UUID("7d669430-f675-4ae7-b43e-fab78ec5a902"), # UUID of P4est.jl
"libp4est" => "/path/to/your/libp4est.so", force = true)

```
On Windows you also need to set the path to the local build of the shared library
of [`libsc`](https://github.com/cburstedde/libsc/tree/master), which is a subpackage
of `p4est`. On other systems, this is not necessary as the library is already linked
by `libp4est.so`, but it can be used to employ also a custom build of `libsc`.
```julia
julia> set_preferences!(
UUID("7d669430-f675-4ae7-b43e-fab78ec5a902"), # UUID of P4est.jl
"libsc" => "/path/to/your/libsc.so", force = true)
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ makedocs(
pages = [
"Home" => "index.md",
"Introduction" => "introduction.md",
"Troubleshooting and FAQ" => "troubleshooting.md",
"API reference" => "reference.md",
"Authors" => "authors.md",
"Contributing" => "contributing.md",
Expand Down
5 changes: 5 additions & 0 deletions docs/src/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Troubleshooting and FAQ

## [`using P4est` gives `UndefVarError: libp4est not defined`](@id undef-var-error)

If you get the error message `UndefVarError: libp4est not defined` when `using P4est` the error is likely to be caused by the fact that P4est.jl uses a system provided MPI library, but no system provided `p4est` version. Therefore, check in your active project that the `LocalPreferences.toml` has a section `[MPIPreferencs]` as well as a section `[P4est]` with valid entry for `libp4est`. If you don't have any `LocalPreferences.toml` in your active project also check your default environment under `~/.julia/environments/vx.y/`, where `vx.y` is the julia version you're using.
2 changes: 1 addition & 1 deletion src/P4est.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Reexport: @reexport
# load all preferences here and access them from the `module LibP4est`.
using Preferences: @load_preference
const _PREFERENCE_LIBP4EST = @load_preference("libp4est", "P4est_jll")
const _PREFERENCE_LIBSC = @load_preference("libsc", "P4est_jll")
const _PREFERENCE_LIBSC = @load_preference("libsc", _PREFERENCE_LIBP4EST)


# Include p4est bindings
Expand Down