Git Product home page Git Product logo

Comments (20)

mnesarco avatar mnesarco commented on August 20, 2024

I love this library because it provides cancel-able, detachable, and split-able futures. But if Qt and boost are now required dependencies, I am afraid I cannot use it anymore and there are no alternatives :( Very sad.

from libraries.

sean-parent avatar sean-parent commented on August 20, 2024

The requirements have not changed. Boost is required if you are building the tests (which use boost test) or if you require boost optional/variant (because you don't have C++17). QT is optional if you are trying to use the QT schedulers.

cmake is only being used to generate the config.hpp if you are not building tests file (you can also provide one manually). What is your cmake command? To test I just uninstalled boost and tried this:

cmake -S . -B ../builds/noboost -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=OFF

And it worked fine.

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Hi @sean-parent thank you for looking into this.
I can build the lib appart and it works if BUILD_TESTING=OFF, but in my project I am using the lib with add_subdirectory(3rdparty/stlab) and I donΒ΄t want to set BUILD_TESTING=OFF for the whole project. Is there a way to disable tests only for stlab? something like STLAB_BUILD_TESTING=OFF ?

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Even with BUILD_TESTING=OFF it does not work with add_subdirectory(3rdparty/stlab)

[cmake] CMake Error: File /xxx/stlab/config.hpp.in does not exist.
[cmake] CMake Error at 3rdparty/stlab/cmake/StlabUtil.cmake:203 (configure_file):
[cmake]   configure_file Problem configuring file
[cmake] Call Stack (most recent call first):
[cmake]   3rdparty/stlab/stlab/CMakeLists.txt:44 (stlab_generate_config_file)

It works out of the box with 1.6.2

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Special treatment for add_subdirectory was present in 1.6.2's CMakeLists.txt

cmake_dependent_option( stlab.testing

But it was removed in 1.7.1
Maybe it is related.

from libraries.

sean-parent avatar sean-parent commented on August 20, 2024

@camio Issue may be fixed by recent PR? Can you take a look?

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Issue is present in main branch

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Oh something was merged some minutes ago. I will retry.

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Ok 9a75c3d fixed the build.
Thank you @laserallan @camio

BUILD_TESTING=OFF is still required to avoid boost, the former option to disable tests was definitively removed. so basically now it is all or nothing.

Another strange thing is this error on program termination (in 1.7.1 not present in 1.6.2):

libc++abi: terminating
Aborted (core dumped)

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

The termination exception is from priority_task_system destructor:

    ~priority_task_system() {
        assert(_q.empty() && "stlab: Thread pool not joined prior to destruction.");
    }

Is there any lifecycle management required in 1.7.1 that was not required in 1.6.2?

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Termination exception solved by calling stlab::pre_exit(); before returning from main. I am sorry, it was clearly specified in CHANGES.md πŸ€¦πŸΌβ€β™‚οΈ

from libraries.

camio avatar camio commented on August 20, 2024

Is there a way to disable tests only for stlab?

Setting BUILD_TESTING=OFF before calling add_subdirectory should work I believe.

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

BUILD_TESTING=OFF affects other subprojects. I only want to disable tests of stlab to avoid boost dependency.
A possible solution: #509 ?

from libraries.

camio avatar camio commented on August 20, 2024

See the set documentation. As long as the variable isn't a CACHE variable, which it shouldn't be, then set will apply only to the current directory scope and not impact other parts of your project.

So if you keep your stuff in 3rdparty, 3rdparty/CMakeLists.txt would look like this:

set(BUILD_TESTING OFF)
add_subdirectory(stlab)
# ...

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024
# set(BUILD_TESTING OFF)  <--- affects all below
add_subdirectory(3rdparty/stlab)
add_subdirectory(3rdparty/imgui)
add_subdirectory(3rdparty/sqlite3)
add_subdirectory(3rdparty/nlohmann/json)
add_subdirectory(3rdparty/stb)
add_subdirectory(3rdparty/rapidxml_ns)
add_subdirectory(3rdparty/tigl-partial)

What you are proposing is something like this?:

set(BUILD_TESTING OFF)
add_subdirectory(3rdparty/stlab)
set(BUILD_TESTING ON)

add_subdirectory(3rdparty/imgui)
add_subdirectory(3rdparty/sqlite3)
add_subdirectory(3rdparty/nlohmann/json)
add_subdirectory(3rdparty/stb)
add_subdirectory(3rdparty/rapidxml_ns)
add_subdirectory(3rdparty/tigl-partial)

from libraries.

camio avatar camio commented on August 20, 2024

I was assuming you don't want to enable testing for any of your 3rdparty libraries. If you only want to disable it for stlab then your second snippet looks right.

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

Those are only part of the 3rdparty submodules, others are own projects but included as 3rdparty in this specific project and some of them need to run tests that depend on config.

I will try the second snipped. Thank your for the info.

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

@camio It worked. Thank you, I am sorry for all the noise.

For reference:

set(GLOBAL_BUILD_TESTING ${BUILD_TESTING})
set(BUILD_TESTING OFF)

add_subdirectory(3rdparty/stlab)

set(BUILD_TESTING ${GLOBAL_BUILD_TESTING})
unset(GLOBAL_BUILD_TESTING)

from libraries.

camio avatar camio commented on August 20, 2024

FWIW I think that can be simplified to this:

block()
  set(BUILD_TESTING OFF)
  add_subdirectory(3rdparty/stlab)
endblock()

from libraries.

mnesarco avatar mnesarco commented on August 20, 2024

block() looks good, but it requires cmake 3.25.

from libraries.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.