ENH: AdaptiveCpp added to SuperBuild Mac and Linux#294
ENH: AdaptiveCpp added to SuperBuild Mac and Linux#294cpinter merged 2 commits intoSlicerRt:masterfrom
Conversation
|
It looks good to me. @ferdymercury if you have any comments or requests please let us know. I'll wait for your feedback before clicking merge. Thanks! |
|
Looks great to me. Thanks. The only remaining question would be the one raised by @lassoan on whether we can also support Windows (not important to me). The point here was to support SYCL. If I understand correctly, for Windows, since you mentioned that AdaptiveCpp only works with gcc, we could instead use Intel's OneApi DPC compiler. https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html which natively supports SYCL compilation. Would that be doable? I guess we would need something like: Windows example: |
|
A single compiler needs to be used on the factory machine so that the components are compatible with each other, so I don't see this possible. Maybe if you explained your motivation behind including AdaptiveCpp and IPOPT in SlicerRT and the kind of audience for which these are useful, @lassoan would have a better idea about the needs. Thanks! (FYI we are exploring the possibility of using Ipopt via the pre-compiled DLLs on Windows. I don't want to include binary files into the repo, but we'll suggest a solution if using the DLLs work) |
|
Sure. For AdaptiveCpp, this is the idea: we are developing a fast library GPU proton dose calculator using SYCL that we want to integrate with SlicerRT. This library has let's say 10 targets, and one of them uses SYCL. The correct way of dealing with this in CMake is: The last statement is a CMake macro that properly uses the SYCL compiler for that target. The rest of targets are compiled with standard GCC. This is nothing new, the same happens when you use CUDA and CMake. You define (with slightly different statements) which targets use CUDA acceleration, the other ones are compiled with standard GCC. One does not need to also compile all the others with CUDA nvcc compiler even if it's posible. This is the situation with Linux at least, not sure about Windows. So... to embed our new tool in SlicerRT, we need a compiler that is SYCL-capable, and we do not mind if it's intel DPC or adaptivecpp or any other. The challenge here might be that it's a rather modern feature that only some recent compilers have. . The audience is people doing forward treatment planning in proton therapy, and comparisons between analytical and Monte carlo dosimetry. Concerning IPOPT, it's a completely different (opposite) problem. It's an external very old library. We want to embed it with SlicerRT for fast inverse treatment planning optimization. Here the challenge is the opposite: rather old Fortran stuff and old configure/make scripts. The audience is people doing or learning inverse treatment planning in radiotherapy. |
|
Thanks a lot @ferdymercury ! What I don't know for example, is how prevalent it is using Linux among researchers working with proton therapy. In any case @xskere already managed to include the DLLs in a simple way (CMake downloads it), so it should work. He confirmed that headers can be included without an issue on Windows, but I'd rather test it somehow, executing the code. Do you have a simple example we could run on Windows? Thank you! |
|
Thanks, makes sense. What about this example? https://github.com/coin-or/Ipopt/tree/stable/3.14/examples/Cpp_example Among researchers... well researchers in hospitals probably most have Windows, researchers outside hospitals have 60% Unix systems |
|
Thank you! The example seems to be for Ipopt. I'll copy it to that ticket for reference. Any suggestions for AdaptiveCpp? |
|
It seems that I am mixing up the two. Hang on :) |
|
For AdaptiveCpp, there could be this example: https://github.com/AdaptiveCpp/AdaptiveCpp/blob/develop/examples/CMakeLists.txt Or if you want something more simple, we have done something by hand ourselves, just in the CMakeLists: and then a file |
659f286 to
25d7f47
Compare
ferdymercury
left a comment
There was a problem hiding this comment.
To my needs, it looks perfect and can be merged, thanks a lot!
Unimportant for me:
The remaining question is whether the same basic_SYCL_Ctest can be run in Windows via find_package(IntelDPCPP) or if that would mess up with the rest of the SlicerRt Build system.
I attempted to use this and have not managed to make it work. I tried with both IntelDPCPP (which is apparently being deprecated soon) and IntelSYCL which was the recommended alternative. There are incompatibilities with MSVC and it does not work due to them. |
Thanks. Right, it's IntelSYCL now. I managed to use IntelSYCL on Linux successfully some time ago (installing oneAPI on Linux), but yeah no idea about MSVC. So in my opinion let's just skip Windows |
Just for future reference, in case someone using Linux wants later to swap AdaptiveCpp with IntelSYCL compiler, our SYCL-basic test compiles and runs perfectly fine on Alma9 after tuning the CMakeLists a bit: |
25d7f47 to
c2baf29
Compare
c2baf29 to
a860f10
Compare
a860f10 to
e9da541
Compare
Also added CLI11 dependency needed for Testing Re SlicerRt#292
e9da541 to
a5492a1
Compare
AdaptiveCpp has been added to the superbuild. By default it's not added to the build, but by setting EXTENSION_BUILDS_ADAPTIVE_CPP to ON, AdaptiveCpp will build, but only on Mac or Linux, otherwise it will be omitted.
Re #292