Skip to content

Commit

Permalink
Merge branch 'master' into standalonecmake
Browse files Browse the repository at this point in the history
  • Loading branch information
andriish authored Jan 23, 2020
2 parents 7385d4f + 7cecef3 commit 11fbbed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def main(args):
parser.add_argument('-j', '--jobs', default=1, const=0, nargs="?", type=int, help="Number of processors to use on when building, use '-j' with no arguments to launch job-per-core. (default: 1) ")
parser.add_argument("--type", default='Release', choices=['Release', 'Debug', 'MinSizeRel', 'RelWithDebInfo'], help="Specify build type")
parser.add_argument('--compiler', default='clang', help='Compiler to use, defualt is clang')
parser.add_argument('--binder', default='', help='Path to Binder tool. If none is given then download, build and install binder into main/source/build. Use "--binder-debug" to control which mode of binder (debug/release) is used.')
parser.add_argument('--binder', default='', help='Path to Binder tool. If none is given then download, build and install binder into build/ directory. Use "--binder-debug" to control which mode of binder (debug/release) is used.')
parser.add_argument("--binder-debug", action="store_true", help="Run binder tool in debug mode (only relevant if no '--binder' option was specified)")
parser.add_argument('--pybind11', default='', help='Path to pybind11 source tree')
parser.add_argument('--annotate-includes', action="store_true", help='Annotate includes in generated source files')
Expand Down
15 changes: 9 additions & 6 deletions documentation/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following tools need to be present in order to build and use **Binder**

- CMake, https://cmake.org
- Pybind11, RosettaCommons fork: https://github.com/RosettaCommons/pybind11
- [optional] Ninja (or you can use `make` by ommiting `-G Ninja` command below)
- [optional] Ninja (or you can use `make` by ommiting `-G Ninja` command below)



Expand All @@ -23,34 +23,37 @@ The steps below is encoded in `binder/build.py` and `binder/build-and-run-tests.

.. code-block:: bash
# clone Binder
cd $HOME
git clone https://github.com/RosettaCommons/binder.git
# Create build dir
mkdir $HOME/prefix && cd $HOME/prefix
# Clone LLVM
git clone http://llvm.org/git/llvm.git llvm && cd llvm
git reset --hard origin/release_38
git checkout release_60
# Clone Clang
cd $HOME/prefix/llvm/tools
git clone http://llvm.org/git/clang.git clang
cd clang && git reset --hard origin/release_38
cd clang && git checkout release_60
# Clone Clang extra tools
cd $HOME/prefix/llvm/tools/clang/tools
git clone http://llvm.org/git/clang-tools-extra.git extra
cd extra && git checkout release_60
# Create symlink pointing to binder/src dir
ln -s $HOME/binder/binder $HOME/prefix/llvm/tools/clang/tools/extra/binder
ln -s $HOME/binder/source $HOME/prefix/llvm/tools/clang/tools/extra/binder
# Create ``llvm/tools/clang/tools/extra/CMakeLists.txt`` file with content: ``add_subdirectory(binder)``
echo 'add_subdirectory(binder)' > $HOME/prefix/llvm/tools/clang/tools/extra/CMakeLists.txt
# Build Binder
mkdir $HOME/prefix/build && cd $HOME/prefix/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_EH=1 -DLLVM_ENABLE_RTTI=ON .. && ninja
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_EH=1 -DLLVM_ENABLE_RTTI=ON ../llvm && ninja
# At this point, if all above steps is succeseful, binder should be at
# $HOME/prefix/build/bin/binder
Expand Down
9 changes: 8 additions & 1 deletion source/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ void add_relevant_include_for_decl(NamedDecl const *decl, IncludeSet &includes/*
{
{ "<algorithm>", {"std::move_backward", "std::iter_swap", "std::min"} },

{ "<iterator>", {"std::advance", "std::distance", "std::iterator", "std::iterator_traits", "std::reverse_iterator", "std::bidirectional_iterator_tag", "std::forward_iterator_tag", "std::input_iterator_tag", "std::random_access_iterator_tag",} },
{ "<iterator>",
{
"std::advance", "std::distance", "std::iterator", "std::iterator_traits", "std::reverse_iterator", "std::bidirectional_iterator_tag",
"std::forward_iterator_tag", "std::input_iterator_tag", "std::random_access_iterator_tag",
"std::begin", "std::end",
}
},

{ "<locale>", {"std::ctype", "std::ctype_byname", "std::ctype_base", "std::locale", "std::money_base", "std::messages_base", "std::numpunct", "std::num_get", "std::num_put", "std::numpunct_byname", "std::time_base", "std::codecvt", "std::codecvt_base", "std::codecvt_byname"} },

Expand Down Expand Up @@ -234,6 +240,7 @@ void add_relevant_include_for_decl(NamedDecl const *decl, IncludeSet &includes/*

make_pair("<bits/stl_heap.h>", "<algorithm>"),

make_pair("<bits/types/__mbstate_t.h>", "<ios>"),

// C headers
make_pair("<bits/libio.h>", "<stdio.h>"),
Expand Down

0 comments on commit 11fbbed

Please sign in to comment.