Comments (4)
Hello,
Have you tried following the instructions from the README
?
Basically, the classic pattern to compile a project using CMake is to create a build
directory inside the project's root directory, then running cmake
, then make
to compile the library:
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=release
make
Note that you will need Boost as a dependency for this library. You have multiple choices here:
- Either install
Boost
through your system's favorite package manager. For example, on Ubuntu, you can runsudo apt install libboost1.65-dev
- Install directly from sources
If you choose to install boost in a custom location (that CMake can't find by itself), make sure to specify the BOOST_ROOT
and/or BOOS_LIBRARY_DIR
variables when invoking CMake:
cmake -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/path/to/your/boost ..
If you do not want to bother installing boost and other dependencies, you might want to try building the Disruptor with conan.
You will need to install conan first.
Then, checkout the yet-to-be-merged conan branch:
git checkout cmake-conan
Then, prior to running CMake inside your build directory, run conan to fetch the dependencies:
conan install ..
After that, follow the rest of the procedure to build with CMake.
Hope that helps.
from disruptor-cpp.
Thanks for your answer,
I already have boost but didnt use it with conan,
- i've did a git clone in {project}/external, then i launched the build as in the doc
- in my cmakelist i include(Disruptor)
- then i add it in target_link_libraries
but when i "make" my project, i get this error:
fatal error: Disruptor/IEventHandler.h: No such file or directory
1 | #include "Disruptor/IEventHandler.h"
I do something wrong but i can't find what, it probably seems obvious but i'm quite a beginner with cmake
from disruptor-cpp.
So if I understand correctly, you project's layout looks like this:
root_project
|
| ---- external/Disruptor
| ---- CMakeLists.txt
If you want it to work properly, you need to add the Disruptor as a subdirectory in your root CMakeLists like so:
add_subdirectory(external/Disruptor)
This will make CMake aware of the Disruptor and its targets, and build it if needed.
Then, you need to link against the right Disruptor targets (CMake will take care of adding the path to the include directories as well):
target_link_libraries(my_project PUBLIC DisruptorStatic)
from disruptor-cpp.
Hi oktal,
actually i was missing this : target_include_directories(${LIBRARY_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/external/Disruptor)
thank you very much for your library and for your help.
from disruptor-cpp.
Related Issues (14)
- Throw in ISequencer::next(N) when N > bufferSize HOT 2
- Undefined Behaviour: Integer overflow on Sequence increment HOT 2
- Eliminate overhead of std::function in `EventPoller` HOT 4
- Latency consistency compared to LMAX Disruptor Java? HOT 1
- Sequencer supported types? HOT 1
- Error: unknown mnemonic `rep' -- `rep' on arrch64 HOT 7
- Throw in MultiProducerSequencer::next(N) when N > bufferSize
- Used in production? HOT 1
- Compile with GCC 4.8.2 HOT 3
- What flags are required to compile? HOT 2
- Is there anyway to bind an eventhandler/workhandler to a certain cpu core? HOT 2
- Whether to consider removing the boost library and replacing it with the std library HOT 1
- Is it lock-free? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disruptor-cpp.