Skip to content

Conversation

@Q-Minh
Copy link
Contributor

@Q-Minh Q-Minh commented Apr 22, 2025

Fixes #227

Hi @Morwenn , I just tested this and when not using the = in -Xcompiler="/permissive-", the /permissive- does not get wrapped into -Xcompiler="..." with all the other compile options. This is probably due to CMake's option de-duplication. In any case, this is simple to fix and it works in my environment (MSVC+CUDA). Apologies for previously sending in a bad PR.

For any cpp-sort user reading this, I also want to add that the COMPILE_LANGUAGE generator expression applies per source file. In other words, for a given CMake project, different compilers can be used on different source files. To make sure that the COMPILE_LANGUAGE works correctly, either:

  • Set the LANGUAGE source file property explicitly, for example
get_target_property(sources mytarget SOURCES)
foreach(source IN LISTS sources)
    # Set LANGUAGE property based on extension (use different logic for your use case)
    get_filename_component(extension ${source} EXT)
    if (extension STREQUAL ".cu") # or other non-standard CUDA extension
        set_source_files_properties(${source} PROPERTIES LANGUAGE CUDA)
    elseif(extension STREQUAL ".c") # or other non-standard C extension
        set_source_files_properties(${source} PROPERTIES LANGUAGE C)
    elseif(extension STREQUAL ".cpp") # or other non-standard C++ extension
        set_source_files_properties(${source} PROPERTIES LANGUAGE CXX)
    endif()
endforeach()
  • Use standard per-language file extensions only.

@Morwenn
Copy link
Owner

Morwenn commented Apr 23, 2025

Uh, I didn't even know option de-duplication was a thing.

No problem for the broken previous PR, it happens. I'm gonna assume that this one has been thoroughly tested and merge it.

I plan to release a new version soon in order to release whatever small changes and fixes were added over a year. Do you think you might have other tweaks to propose, or is everything finally working for your use case? I've you're not done yet, I can wait for some time before releasing the new version.

@Morwenn Morwenn merged commit 0664515 into Morwenn:1.x.y-develop Apr 23, 2025
17 checks passed
@Morwenn
Copy link
Owner

Morwenn commented Apr 23, 2025

To be fair, CMake gives the following warning, so I should have noticed that something was off:

CMake Warning (dev) at CMakeLists.txt:46:
  Syntax Warning in cmake code at column 61

  Argument not separated from preceding token by whitespace.

@Q-Minh
Copy link
Contributor Author

Q-Minh commented Apr 24, 2025

I plan to release a new version soon in order to release whatever small changes and fixes were added over a year. Do you think you might have other tweaks to propose, or is everything finally working for your use case? I've you're not done yet, I can wait for some time before releasing the new version.

I don't have any other tweak to propose at the moment, I'm currently only using the ska_sorter so I haven't exactly explored a large part of the library. I was mostly interested in the integer sorts and sorting algorithms that perform well on almost sorted data, but haven't gotten the time to test them out yet. Feel free to make a new release, and thanks for this beautifully designed library.

@Morwenn
Copy link
Owner

Morwenn commented May 1, 2025

Ok, thanks for taking the time anyway, it's appreciated 🙂

To be frank the library is not really the state of the art anymore when it comes to faster sorting algorithms. There's been a lot of research and faster sorting algorithms, even single-threaded ones, keep being released every other week. I'm thinking for example of in-place super scalar sample sort, which is old enough and quite fast. ska_sort itself has a more recent version somewhere (in a branch of boostorg/sort I think).

The algorithms that perform well on almost-sorted data in cpp-sort are "fun" and really interesting from a theoretical point of view, but most of them are slow in most situations, which makes them poor generic algorithms. I do hope that I will have another period of strong motivation for the project in the future, because I'm still not done exploring and improving everything I want to explore and improve in the area 😄

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

Successfully merging this pull request may close these issues.

Why must /permissive- and /Zc:preprocessor compile options be imposed on the user?

2 participants