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

Build script failes on Windows using P4est_jll artifact #22

Closed
zjwegert opened this issue May 8, 2024 · 4 comments
Closed

Build script failes on Windows using P4est_jll artifact #22

zjwegert opened this issue May 8, 2024 · 4 comments

Comments

@zjwegert
Copy link

zjwegert commented May 8, 2024

The build.jl currently fails to find the libp4est library on Windows. This appears to be because P4est_jll creates the .dll files in the artifact directory bin (with a different name from libp4st!) and creates a .dll.a in in lib. The .dll.a files are then not recognised by Libdl.find_library.

A workaround is to modify build.jl as

...
if (cmp(P4EST_LIB,"") == 0)
# Check P4EST_LIB (.../libp4est.so file) exists
    P4EST_LIB = string(Libdl.find_library(P4EST_LIB_NAME,[P4EST_LIB_DIR,P4EST_ROOT_DIR]),".",Libdl.dlext)
    if P4EST_ARTIFACT && (cmp(P4EST_LIB,string(".",Libdl.dlext)) == 0) # Fix for finding dll on Windows
        P4EST_LIB = P4est_jll.get_libp4est_path()
    end
end
...

instead of

...
if (cmp(P4EST_LIB,"") == 0)
# Check P4EST_LIB (.../libp4est.so file) exists
    P4EST_LIB = string(Libdl.find_library(P4EST_LIB_NAME,[P4EST_LIB_DIR,P4EST_ROOT_DIR]),".",Libdl.dlext)
end
...
@JordiManyer
Copy link
Member

JordiManyer commented May 9, 2024

Hi @zjwegert , thanks for the issue! Unfortunately I do not have access to a windows machine, so you'll have to walk me throught it.

My first impression is that if we are using an artifact, we probably always want to be using the function P4est_jll.get_libp4est_path() to find path. Unfortunately with P4est_jll on linux I cannot seem to have access to that function. Is it something that might be limited to some versions of the artifact?

EDIT: It is showing now, after updating. I can also seem to have access to that function for artifacts on linux for versions 2.2-2.8 (i.e all versions supported). I'm then for using this function whenever we have an artifact.

@JordiManyer
Copy link
Member

JordiManyer commented May 9, 2024

What do you think @amartinhuertas ?

@JordiManyer
Copy link
Member

@zjwegert can you check the PR branch works on windows?

@zjwegert
Copy link
Author

zjwegert commented May 9, 2024

@zjwegert can you check the PR branch works on windows?

Done! Works on my machine.

@zjwegert zjwegert closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants