It should run on Linux (x86-32, x86-64, and ARM), iOS, macOS, and Windows (x86-64). Dependenciesįolly supports gcc (5.1+), clang, or MSVC. e.g., if you are building with CMake you can use the CMAKE_PREFIX_PATH variable to allow CMake to find folly in this temporary installation directory when building your project. However, given that folly provides no compatibility guarantees between commits we generally recommend building and installing the libraries to a temporary location, and then pointing your project's build at this temporary location, rather than installing folly in the traditional system installation directories. There are also -install-dir and -install-prefix arguments to provide some more fine-grained control of the installation directories. You can also specify a -scratch-path argument to control the location of the scratch directory used for the build.
This will help ensure that you build with recent versions of all of the dependent libraries, regardless of what versions are installed locally on your system.īy default this script will build and install folly and its dependencies in a scratch directory.
This script will download and build all of the necessary dependencies first, and will then build folly. build.sh can be used on Linux and MacOS, on Windows use the build.bat script instead. The simplest way to build folly is using the build.sh script in the top-level of the repository. You can also check the docs folder for documentation, starting with the overview.įolly is published on GitHub at Build Notesīecause folly does not provide any ABI compatibility guarantees from commit to commit, we generally recommend building folly as a static library. What's in it?īecause of folly's fairly flat structure, the best way to see what's in it is to look at the headers in top level folly/ directory. The folly/folly/docs directory contains documentation. The folly/folly/test subdirectory includes the unittests for all components, usually named ComponentXyzTest.cpp for each ComponentXyz.*.
Your code should not use files in folly/experimental lest it may break when you update Folly. The subdirectory experimental contains files that are used inside folly and possibly at Facebook but not considered stable enough for client use. we don't have an elaborate directory hierarchy (it is possible this will change in future versions). The directory structure is flat (mimicking the namespace structure), i.e. The first directory serves as an installation root of the library (with possible versioning a la folly-1.0/), and the second is to distinguish the library when including files, e.g. Physical DesignĪt the top level Folly uses the classic "stuttering" scheme folly/folly used by Boost and others. This code, typically, is still in heavy use and is well tested. This designation connotes primarily that we feel the API may change heavily over time. User code should not depend on symbols in those namespaces.įolly has an experimental directory as well. Namespace folly defines other internal namespaces such as internal or detail.
Macro names are ALL_UPPERCASE and should be prefixed with FOLLY_.
There is no restriction on internal dependencies, meaning that a given folly module may use any other folly components.Īll symbols are defined in the top-level namespace folly, except of course macros. Logical Designįolly is a collection of relatively independent components, some as simple as a few symbols. Good performance at large scale is a unifying theme in all of Folly. Performance concerns permeate much of Folly, sometimes leading to designs that are more idiosyncratic than they would otherwise be (see e.g. We endeavor to remove things from folly if or when std or Boost obsoletes them. In fact, we embark on defining our own component only when something we need is either not available, or does not meet the needed performance profile. It complements (as opposed to competing against) offerings such as Boost and of course std. In particular, it's often a dependency of Facebook's other open source C++ efforts and place where those projects can share code. Folly contains a variety of core library components used extensively at Facebook. Folly (acronymed loosely after Facebook Open Source Library) is a library of C++14 components designed with practicality and efficiency in mind.