Installation on macOS and Windows
Relevant source files
The following files were used as context for generating this wiki page:The FluentDo Agent can be installed on both macOS and Windows operating systems using pre-compiled packages or by building from the source code. Package-based installation is the recommended and simplest method for most users. Building from source offers more flexibility for development and customization.
This document outlines the different installation methods available for each platform. The primary build system used for compiling from source is CMake, which allows for generating platform-native build projects, such as Xcode for macOS and Visual Studio for Windows.
Sources: README.md:104-113, source/lib/jansson-e23f558/CMakeLists.txt:45-53
Installation Methods Summary
The following table summarizes the available installation methods for macOS and Windows.
| Operating System | Recommended Method | Other Methods |
|---|---|---|
| macOS | Homebrew (brew) | Build from source (CMake + Xcode/Make) |
| Windows | Pre-built packages (.zip, .exe, .msi) | Build from source (CMake + Visual Studio/MinGW) |
Sources: README.md:110-113, source/lib/jansson-e23f558/CMakeLists.txt:80-97, 120-126
macOS Installation
Package Installation with Homebrew
The quickest way to install the FluentDo Agent on macOS is by using the provided Homebrew tap.
brew install fluentdo/tap/agent
This command will download, compile, and install the agent and its dependencies.
Sources: README.md:110-112
Building from Source on macOS
To build from source on macOS, you need a C compiler (like Clang, included with Xcode) and CMake. The build can be configured to generate standard Unix Makefiles or an Xcode project for development and debugging.
Using Makefiles
This is the standard command-line approach.
git clone https://github.com/FluentDo/agent.git
cd agent/source/build
cmake ..
make
Sources: README.md:126-130
Generating an Xcode Project
For development within the Xcode IDE, you can instruct CMake to generate an Xcode project.
# Navigate to the build directory
cmake -E make_directory build; cd build
# Generate the Xcode project
cmake .. -G Xcode
This will create an *.xcodeproj file in the build directory, which can be opened with Xcode. Dependencies like cmetrics and jansson also support this generation method.
Sources: source/lib/yyjson-0.12.0/doc/doxygen/html/building-and-testing.html:203-204, source/lib/jansson-e23f558/CMakeLists.txt:120-126, source/lib/cmetrics/CMakeLists.txt:320-337
macOS Specific Build Configuration
The build system contains specific logic for macOS (identified as Darwin or APPLE).
- RPATH: The RPATH is set to include the monkey library directory.
- Frameworks: The agent links against the
Foundation,IOKit, andSecurityframeworks. - Event Loop: On non-Linux systems like macOS,
accept(2)is used instead ofaccept4(2). - Systemd/Upstart: Service installation scripts for systemd and upstart are skipped on macOS.
Sources: source/lib/monkey/CMakeLists.txt:124-126, source/src/CMakeLists.txt:302-307, 461-487, install.sh:196-204
The diagram below shows the platform detection logic within the install.sh script, which also supports macOS.
Sources: install.sh:189-217
Windows Installation
Package Installation
FluentDo Agent provides pre-built packages for Windows in .zip, .exe, or .msi formats. These can be downloaded from the official packages repository. This is the most straightforward installation method.
Sources: README.md:113
Building from Source on Windows
Building on Windows requires CMake and a C compiler, typically from Visual Studio or MinGW.
Generating a Visual Studio Solution
You can generate a Visual Studio solution (.sln) file using CMake. This allows you to build and debug the agent directly within the Visual Studio IDE.
The following command generates a solution for Visual Studio 2017.
# Create a build directory
md build
cd build
# Generate the Visual Studio solution
cmake -G "Visual Studio 15 2017" ..
The generated solution file will be in the build directory. You can then open it in Visual Studio and build the fluent-bit-bin or ALL_BUILD target.
Sources: source/lib/jansson-e23f558/CMakeLists.txt:80-87
The following table lists the generator strings for various Visual Studio versions.
| Visual Studio Version | CMake Generator String |
|---|---|
| Visual Studio 2019 | Visual Studio 16 2019 |
| Visual Studio 2017 | Visual Studio 15 2017 |
| Visual Studio 2015 | Visual Studio 14 2015 |
| Visual Studio 2013 | Visual Studio 12 2013 |
| Visual Studio 2012 | Visual Studio 11 2012 |
| Visual Studio 2010 | Visual Studio 10 2010 |
| Visual Studio 2008 | Visual Studio 9 2008 |
Sources: source/lib/jansson-e23f558/CMakeLists.txt:89-97
The following diagram illustrates the workflow for generating a Visual Studio project.
Using MinGW
Alternatively, you can build using MinGW to create Makefiles.
# Create a build directory
md build
cd build
# Generate MinGW Makefiles
cmake -G "MinGW Makefiles" ..
mingw32-make
Sources: source/lib/jansson-e23f558/CMakeLists.txt:111-118
Windows-Specific Build Configuration
The core CMakeLists.txt file includes specific configurations for Windows builds.
- Source Files: The
flb_dlfcn_win32.cfile is included for Windows builds to handle dynamic library loading. - Compiler Flags: The warning level is set to
/W2for MSVC. - Libraries: The build links against several Windows-specific libraries.
- Configuration File: The build process is configured to install
fluent-bit-win32.confas the default configuration file.
Sources: source/src/CMakeLists.txt:104-109, 489-494
The following libraries are linked when compiling for Windows:
| Library | Description |
|---|---|
ws2_32.lib | Windows Sockets 2 |
crypt32.lib | Cryptographic API |
Bcrypt.lib | CNG Cryptography API |
Shlwapi.lib | Shell Light-weight Utility Library |
winhttp.lib | Windows HTTP Services |
rpcrt4.lib | Remote Procedure Call runtime |
Sources: source/src/CMakeLists.txt:215-223
General Build Process with CMake
Regardless of the platform, the high-level build process using CMake follows a consistent pattern: Configuration, Generation, and Building.
The diagram below shows the general cross-platform build flow.