Skip to content
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

cmake doesn't recognize catch include #29

Open
shakfu opened this issue Jun 23, 2022 · 5 comments
Open

cmake doesn't recognize catch include #29

shakfu opened this issue Jun 23, 2022 · 5 comments

Comments

@shakfu
Copy link

shakfu commented Jun 23, 2022

Hi,

Saw your excellent presentation "Threads Considered Harmful" and decided to checkout concore. Thanks for sharing!

Incidentally, I was wondering if concore can be used, even in a limited way, from c? Any tips to test this?

In any case, I wanted to let you know that I couldn't build concur unless I disabled the tests. For some reason, conan won't install catch properly for me. Here's my sequence:

$ cd concore
$ conan --version
Conan version 1.49.0
$ cmake --version
cmake version 3.23.2
$ cat build.sh
mkdir -p build
pushd build
conan install .. --build=missing -s build_type=Release
cmake -D CMAKE_BUILD_TYPE=Release -D concore.testing=ON ..
cmake --build .
popd build
$ ./build.sh
~/Downloads/src/concore/build ~/Downloads/src/concore
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=12.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

conanfile.py (concore/0.6.0): Installing package
Requirements
Packages

Installing (downloading, building) binaries...
conanfile.py (concore/0.6.0): Generator txt created conanbuildinfo.txt
conanfile.py (concore/0.6.0): Generator cmake created conanbuildinfo.cmake
conanfile.py (concore/0.6.0): Aggregating env generators
conanfile.py (concore/0.6.0): Generated conaninfo.txt
conanfile.py (concore/0.6.0): Generated graphinfo
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /Users/sa/Downloads/src/concore/build
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- System           : Darwin-19.6.0
-- System name      : Darwin
-- System ver       : 19.6.0
--
-- Library ver      : 0.6.0
-- Build date       : 2022-06-23
-- Build year       : 2022
-- Use C++ 2020     : OFF
-- Use profiling    : OFF
-- Use Tracy        : OFF
-- Profiling include: OFF
-- Profiling path   : OFF
--
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Concore compile definitions: _GLIBCXX_USE_CXX11_ABI=1
CMake Error at test/CMakeLists.txt:69 (include):
  include could not find requested file:

    Catch


CMake Error at test/CMakeLists.txt:70 (catch_discover_tests):
  Unknown CMake command "catch_discover_tests".


-- Configuring incomplete, errors occurred!
See also "/Users/sa/Downloads/src/concore/build/CMakeFiles/CMakeOutput.log".
make: Makefile: No such file or directory
make: *** No rule to make target `Makefile'.  Stop.
~/Downloads/src/concore/build

If I disable the following two lines in the CMakeLists.txt file I can build without issues.

# Testing code
#enable_testing()
#add_subdirectory(test)
$ ./build.sh
...
[  8%] Building CXX object src/CMakeFiles/concore.dir/lib/detail/exec_context.cpp.o
[ 16%] Building CXX object src/CMakeFiles/concore.dir/lib/low_level/semaphore.cpp.o
[ 25%] Building CXX object src/CMakeFiles/concore.dir/lib/task.cpp.o
[ 33%] Building CXX object src/CMakeFiles/concore.dir/lib/init.cpp.o
[ 41%] Building CXX object src/CMakeFiles/concore.dir/lib/n_serializer.cpp.o
[ 50%] Building CXX object src/CMakeFiles/concore.dir/lib/pipeline.cpp.o
[ 58%] Building CXX object src/CMakeFiles/concore.dir/lib/rw_serializer.cpp.o
[ 66%] Building CXX object src/CMakeFiles/concore.dir/lib/serializer.cpp.o
[ 75%] Building CXX object src/CMakeFiles/concore.dir/lib/task_graph.cpp.o
[ 83%] Building CXX object src/CMakeFiles/concore.dir/lib/task_group.cpp.o
[ 91%] Building CXX object src/CMakeFiles/concore.dir/lib/std/thread_pool.cpp.o
[100%] Linking CXX static library ../lib/libconcore.a
[100%] Built target concore
~/Downloads/src/concore/build
@shakfu
Copy link
Author

shakfu commented Jun 23, 2022

It looks like the requirements are not being downloaded. I've tested this separately using the conan demo project git clone https://github.com/conan-io/examples.git && cd examples/libraries/poco/md5 and it works fine. I can't figure out why this isn't working on your particular setup.

@lucteo
Copy link
Owner

lucteo commented Jun 25, 2022

Thank you very much!
Please also see Structured Concurrency. In the last year or so, I got convinced that senders/receivers are the proper model for concurrency. They provide better abstractions for concurrency compared to tasks.

I was contemplating switching concore to senders/receivers model (but reusing the reference implementation from https://github.com/brycelelbach/wg21_p2300_std_execution), but I did not get a change to work on this.

@shakfu
Copy link
Author

shakfu commented Jun 25, 2022

Many thanks for your reply, Lucian.

I'll have a look at your new presentation (which I missed somehow), and definitely checkout the ref implementation of the std::execution model. I was pretty much persuaded by the elegance of the top-down design in your earlier presentation and concore model, so It'll be interesting to see how your thinking has evolved since then.

@sansajn
Copy link

sansajn commented Sep 23, 2022

Hello, I'm also struggling with the same Catch issue on current master branch. In my case console output looks this way

(base) ja@ja-home:~/source/concore$ mkdir -p build
(base) ja@ja-home:~/source/concore$ pushd build
~/source/concore/build ~/source/concore
(base) ja@ja-home:~/source/concore/build$ conan install .. --build=missing -s build_type=Release
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

conanfile.py (concore/0.6.0): Installing package
Requirements
Packages

Installing (downloading, building) binaries...
conanfile.py (concore/0.6.0): Generator txt created conanbuildinfo.txt
conanfile.py (concore/0.6.0): Generator cmake created conanbuildinfo.cmake
conanfile.py (concore/0.6.0): Aggregating env generators
conanfile.py (concore/0.6.0): Generated conaninfo.txt
conanfile.py (concore/0.6.0): Generated graphinfo
(base) ja@ja-home:~/source/concore/build$ cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D concore.testing=ON ..
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /home/ja/source/concore/build
-- Conan: Compiler GCC>=5, checking major version 11
-- Conan: Checking correct version: 11
-- The C compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- System           : Linux-5.15.0-47-generic
-- System name      : Linux
-- System ver       : 5.15.0-47-generic
-- 
-- Library ver      : 0.6.0
-- Build date       : 2022-09-23
-- Build year       : 2022
-- Use C++ 2020     : OFF
-- Use profiling    : OFF
-- Use Tracy        : OFF
-- Profiling include: OFF
-- Profiling path   : OFF
-- 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Concore compile definitions: _GLIBCXX_USE_CXX11_ABI=1
CMake Error at test/CMakeLists.txt:69 (include):
  include could not find requested file:

    Catch


CMake Error at test/CMakeLists.txt:70 (catch_discover_tests):
  Unknown CMake command "catch_discover_tests".


-- Configuring incomplete, errors occurred!
See also "/home/ja/source/concore/build/CMakeFiles/CMakeOutput.log".

@lucteo
Copy link
Owner

lucteo commented Sep 27, 2022

Hi, Adam
Thank you for the interest in this library.

As I mentioned above, I would now suggest using P2300 reference implementation instead of concore.

Best regards,
LucTeo

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

No branches or pull requests

3 participants