-
Notifications
You must be signed in to change notification settings - Fork 9
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
Windows and Mac OS extension #5
Comments
I have no experience with On windows, I get the following -- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.0.24215.1
...
-- CMAKE_C_FLAGS_DEBUG: /MDd /Zi /Ob0 /Od /RTC1
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
QHULL_qhull_r_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/Users/wueli/.julia/dev/MiniQhull/deps/MiniQhullWrapper
...
used as include directory in directory C:/Users/wueli/.julia/dev/MiniQhull/deps/MiniQhullWrapper/src/tests
QHULL_qhull_r_LIBRARY (ADVANCED)
linked by target "MiniQhullWrapper" in directory C:/Users/wueli/.julia/dev/MiniQhull/deps/MiniQhullWrapper/src/lib
-- Configuring incomplete, errors occurred!
See also "C:/Users/wueli/.julia/dev/MiniQhull/deps/MiniQhullWrapper/build/CMakeFiles/CMakeOutput.log".
[ Info: MiniQhullWrapper root directory at:
...
┌ Info: QHULL configuration:
│ ==============================================
│ - QHULL_WRAPPER_FOUND = false
│ - QHULL_WRAPPER_LIB_DIR =
│ - QHULL_WRAPPER_LIB_NAME =
└ - QHULL_WRAPPER_LIB_PATH = So apparently, the //Directory to search for Qhull
QHULL_ROOT_DIR:PATH=
//Path to a file.
QHULL_qhull_r_INCLUDE_DIR:PATH=QHULL_qhull_r_INCLUDE_DIR-NOTFOUND
... I think this variable should be set in set(QHULL_ROOT_DIR
"${QHULL_ROOT_DIR}"
CACHE PATH "Directory to search for Qhull") I assume that the #################################################################
# FIND QHULL
#################################################################
FIND_PACKAGE(Qhull REQUIRED)
INCLUDE_DIRECTORIES(${INCLUDE_PATH} ${QHULL_qhull_r_INCLUDE_DIR}) However, at this point, I don't know how to proceed and set |
Thanks @ueliwechsler for reporting. It is strange that
appears empty in your cache file even though you have set the corresponding environment variable. @victorsndvg any idea of what is going on? |
Dear @ueliwechsler , first of all, can you confirm that the environment variable is set within your Julia environment? I mean,
If true, please try to instantiate and build the MiniQhull project again;
is it still failing after these steps? |
Dear @ueliwechsler , the content of Maybe your Qhull library has been installed at Please, fix the Anyway, we have no tested it under Windows, not sure if it will work. |
I am not sure if I understand correctly what you mean by installation directory. |
I tried to build Qhull using Visual Studio C++ by opening the Qhull solution file for the 64 bit build (i.e. the .sln file) and received the following log file:
I'm not sure how to proceed but this may provide some additional info. If anyone can help me out, I can try to find a solution. |
Dear @djlacombe , I've never used Visual Studio and I don't know how it works. It seems that that found/selected C compiler is not working or at least cannot be used from Visual Studio. Please, follow the recommendations :
or choose another C compiler if possible. |
Dear @ueliwechsler , MiniQull (and in particular MiniQhullWrapper and findQhull.cmake file) does not look for the Qhull binary file. In particular they are looking for the following files:
If you are under windows, I suppose library extensions can be Please, once you find these files, can you report their full path to try to recommend you a valid |
@victorsndvg thanks for the the clarificication and sorry for the late reply. The first file is at
Note, I did download and used the version which is available here: http://www.qhull.org/download/qhull-2019.1.zip. |
Dear @ueliwechsler , only one question, did you install Qhull? I mean, did you run If you run it at the Qhull source directory root, it create the If previous step does not change anything I have a last try to make it work. Can you please replace the following line in your MiniQhull local repository? https://github.com/gridap/MiniQhull.jl/blob/master/deps/build.jl#L26 and change this:
by:
where: Hope it works! |
Hi @victorsndvg , thank you for your effort and information, but it did not work.
Unfortunately, your other fix did also not help. I am afraid my knowledge is not good enough to really understand what exactly is going on. |
Sorry @ueliwechsler , we have not designed the package to be used on Windows yet. As soon as we got it working on windows we will comment in this issue again. Thanks for reporting! |
Hi @victorsndvg , I'm trying to see if I can get this thing working in Windows. I've managed to get the correct
*.lib files and the lib files are either *.dll or *.dll.a . If I go to this files and manually change the extension to *.lib it works ✌️ . However, it fails latter when linking to MiniQhullWrapper.dll which I cannot manually change to MiniQhullWrapper.lib because it's rewritten everytime I build.
My question is: is there any way for CMake to check for Thank you! |
Hi @oriolcg, Since some months, @victorsndvg is working full time in another company. It is likely that he cannot help with this anymore. |
Ups... OK, I'll see if I can figure it out by myself. In any case, if someone else has any insights or wants to help, it will be very much appreciated |
Hi @oriolcg , this project was only tested under linux. I think it should be not too much dificult to use it under windows ... but I really don't figure out the steps to do it. I don't know too much about linking in windows, but I think it's a little bit different to linux. Maybe I'm wrong, but I think that windows dynamic libraries (dll) need a "pseudostatic" library (lib) in order to be "easily" linked. So, I think you need to recompile QHull library to obtain both, dynamic dlls and static libs. This is why CMake try to find lib files. Is this possible? The other possible workaround is to use Mingw to compile both, QHull and MiniQHullWrapper. I think this is the selected choice in Qhull_jll. Hope that helps! Best! |
Hi @victorsndvg , Thanks for the reply! If I compile the QHull library with VS I get both ".dll" and ".lib" and MiniQhull finds the libraries. However, I still have the same problem with "MiniQhullWrapper". I tried to modify the |
Ok, then, if I understood correctly, the problem is that MiniQhullWrapper only generates the dll file in windows, right? I've found the following post. I think it could be helpful, hopefully. https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/BuildingWinDLL Let me know if it works ;) |
Yes. However, I also tried the fix on the link, but didn't help. I guess that for now I'll have to assume that this is not going to work soon on Windows... |
I managed to build the
And what did I do?
On Windows one always link against a I actually made it work by compiling it directly as
and then editing the And now to finish I have a question. I tried to reproduce this Matlab example but got 18 triangles instead of the 12 in the Matlab example. The excess are due to fact that each cube face is decomposed into 4 triangles instead of two. Why is that?
|
FWIW – I am using |
Would it make sense to rewrite the C code in MiniQhull in Julia? It's less than 150 lines, the code looks straightforward, and (with |
The main annoyance seems to be that you will need to replicate the huge On the other hand, this isn't that bad if you at least semi-automate the translation, and since you depend on the |
The Clang output looks usable: https://gist.github.com/stevengj/0cf9bcc9f338ad8fcf78e5862d4ff851 I just ran using Clang, Qhull_jll
wc = init(; headers = [Qhull_jll.user_r_h, Qhull_jll.mem_r_h, Qhull_jll.qset_r_h, Qhull_jll.stat_r_h, Qhull_jll.libqhull_r_h],
output_file = joinpath(@__DIR__, "libqhull_out.jl"),
common_file = joinpath(@__DIR__, "libqhull_common.jl"),
header_wrapped = (root, current)->root == current,
header_library = x->"libqhull"
)
run(wc) |
One thing that worries me from the above translation is that I get julia> sizeof(LibQhull.qhT)
7136 but adding
@Gnimuc, am I using Clang.jl incorrectly here? Why is it not giving the same |
I see the type |
@eschnett, good catch. Maybe we can store |
|
Hmm, Clang doesn't handle Changing that increases the size to 8608 bytes, which is now too big! Possibly there is an alignment mismatch somewhere due to the differences in types. Grrr, a pure-Julia wrapper is going to be more of a pain than I thought. Maybe it would be better to package a minimal C wrapper as a jll file. Mainly, it needs to be able to allocate a |
This reminds me JuliaInterop/Clang.jl#238. For now, it's not trivial to map this kinda nested records from C to Julia due to the mismatched padding behavior. https://github.com/analytech-solutions/CBinding.jl is worth a try but JuliaLang/julia#35795 seems to be the future. Another way is to generate a struct that only contains an |
It might be easiest to smuggle a few additional functions into the build script for the |
@stevengj @eschnett I just tried to regenerate the bindings with Clang.jl's new generator.
The script generates a
I think the size is correct, as the Clang compiler's
the last field of |
@Gnimuc On which architectures did you check this? The value might depend on the system and/or the CPU architecture. Is there a way to check this at build time? |
It was tested on macOS.
Maybe use C11's static_assert? |
Some potential users are willing to use MiniQhull from Windows and presumably also from Mac OS, but the project is only tested for Linux. See this thread: https://discourse.julialang.org/t/delaunay-triangularization/36172/13
Is somebody in the Julia community ready to help us with the Windows and / or the mac OS extension? Feel free to fork and open a PR. Thanks!
The text was updated successfully, but these errors were encountered: