THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
- install the Xcode command line tools, it will give you gcc, make and most commandline tools. To install open terminal and type "xcode-select —install"
- You need a few other libraries for successfully building minifi on a mac. I used brew to install the additional libraries (make,leveldb,uuid,boost ).
- if you don have brew execute "/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- if you already have brew make sure to update it by "brew update". if you get errors doing update check Fix brew update error section.
- install the additional libraries
- brew install cmake
- brew install leveldb
- brew install ossp-uuid
- brew install boost
- brew install doxygen
- Build minifi . Clone the Minfi-cpp git project. In context to this guide i have minifi-cpp under /opt/code/nifi-minifi-cpp
- Change Directory to minifi source folder - cd /opt/code/nifi-minifi-cpp
- mkdir build
- cd build
- cmake .
- make
- make package
- You should have a tar.gz file in the build folder. Untar and run minifi by “bin/minifi.sh start”
- Alternately you can run minifi from the /opt/code/nifi-minifi-cpp/build folder using “nohup main/minifi &”
- If you get an error for MINIFI_HOME or ../conf, make sure there is a conf folder , with minifi.properties at the minifi root level.
Debugging Minifi
- Run with debug log level.
- vi main/MinifiMain.cpp and change logger->setLogLevel(logging::info); to logger->setLogLevel(logging::debug);
- Step by Step debugging
- go to your build director "cd build"
- o debug build minifi with debug optionns "cmake -DCMAKE_BUILD_TYPE=Debug .."
- execute make
- you should already have lldb from command line install. execute "lldb -f main/minifi"
- you should now see a lldb prompt. issue the commands on the lldb prompt.
- set a breakpoint to where you want to start debugging "(lldb) breakpoint set --file FlowController.cpp --line 229"
- delete break point (lldb) breakpoint delete <id>
- start minifi "process launch" , add --stop-at-entry to break at the main method.
- step through the code using s -> step-in , n->step-over, f->step-out
Fix brew update error
- sudo chown -R ${whoami} /usr/local - gives you ownership of /usr/local
- cd /usr/local
- git reset --hard FETCH_HEAD
- git checkout Library