Open al42and opened 10 months ago
Thanks for the feedback! We'll have a look, I think we'd certainly want to fix 1 and 2.
As for 3, since DPC++ doesn't have it I feel like clients can no longer depend on this anyway, though I personally liked it -- it's also really simple in our case. I wouldn't be opposed to adding it, what do you think @fknorr ?
Thanks!
POSITION_INDEPENDENT_CODE
mention that it will automatically be enabled for a shared library build, but if a shared SimSYCL links a static libenvpp that one will probably not be position independent automatically.libenvpp.a
even though that library will only used internally by libsimsycl.a
. A shared simsycl.so
could do without these extra installed libraries.FWIW, adding if(BUILD_SHARED_LIBS) set_target_properties(libenvpp PROPERTIES POSITION_INDEPENDENT_CODE ON) endif()
to libenvpp's CMakeLists.txt helps (e.g., using PATCH
command of FetchContent
), but I am not a CMake guru to say whether that's a proper solution.
Static build: "user transitively depends on libenvpp.a" Maybe I'm missing something, but I don't see any mentions of envpp
in SimSYCL's headers, so as long as libenvpp is statically linked into libsimsycl.a
, there should be no reason for a client application to care about libenvpp, right? Shared build: Agree.
"since DPC++ doesn't have it I feel like clients can no longer depend on this anyway" SimSYCL can contribute to putting peer pressure on DPC++ to adopt it :) "the API requires the user to list all sources even though SimSYCL does not actually use that information" True, that is moderately annoying. Overall, that is not a huge deal; users can trivially add this function to their code if they want to.
Hi! Thank you for this project :)
Below are some observations I made about the current build system. Nothing is too critical, but I think it would be nice to iron such sings out eventually.
-DBUILD_SHARED_LIBS=ON
) fails with a "recompile with -fPIC" error.Full repro:
Setting
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
to force PIC globally helps.simsycl-config.cmake
containsfind_dependency
forBoost
,nlohmann_json
, andlibenvpp
. However, all those libraries are PRIVATE, and, for a static library build, there should be no need to expose them to the application trying to link tolibsimsycl.a
. This makes linking to SimSYCL more complicated.Just removing those
find_dependency
does not help, more dark CMake magic is needed?add_sycl_to_target
function to ease the integration of SYCL into the client code. How about adding something like this to the