Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit 1ab2250

Browse files
committed
readme: update build instructions
1 parent 64292a6 commit 1ab2250

File tree

1 file changed

+38
-155
lines changed

1 file changed

+38
-155
lines changed

README.md

Lines changed: 38 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -4,180 +4,64 @@
44
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/MASD-Project/Lobby)
55
[![Issues](https://img.shields.io/github/issues/MASD-Project/cpp_ref_impl.svg)](https://github.com/MASD-Project/cpp_ref_impl/issues)
66
[![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/MASD-Project/cpp_ref_impl.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/MASD-Project/cpp_ref_impl/context:cpp)
7-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5d998ea32f27479392c2c7b2309bd84a)](https://www.codacy.com/app/marco-craveiro/cpp_ref_impl?utm_source=github.com&utm_medium=referral&utm_content=MASD-Project/cpp_ref_impl&utm_campaign=Badge_Grade)
87
[![Build Dashboard](https://img.shields.io/badge/cdash-dashboard-00cc00.svg)](https://my.cdash.org/index.php?project=MASD+Project+-+C%2B%2B+Reference+Implementation)
98
[![Build Status](https://travis-ci.org/MASD-Project/cpp_ref_impl.svg?branch=master)](https://travis-ci.org/MASD-Project/cpp_ref_impl)
109
[![Build Status](https://img.shields.io/appveyor/ci/mcraveiro/cpp-ref-impl.svg?label=windows)](https://ci.appveyor.com/project/mcraveiro/cpp-ref-impl)
1110
[![Language](https://img.shields.io/badge/Language-C++-blue.svg)](https://www.openhub.net/p/dogen/analyses/latest/languages_summary)
11+
[![Language](https://img.shields.io/badge/Language-C++-blue.svg)](https://www.openhub.net/p/dogen/analyses/latest/languages_summary)
1212
[![C++](https://img.shields.io/badge/std-C++17-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B17)
13-
[![gcc-9](https://img.shields.io/badge/GCC-8-blue.svg)](https://www.gnu.org/software/gcc/gcc-9)
14-
[![clang-9](https://img.shields.io/badge/CLANG-9-blue.svg)](http://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html)
13+
[![gcc-11](https://img.shields.io/badge/GCC-11-blue.svg)](https://www.gnu.org/software/gcc/gcc-11)
14+
[![clang-14](https://img.shields.io/badge/CLANG-14-blue.svg)](https://releases.llvm.org/14.0.0/tools/clang/docs/ReleaseNotes.html)
1515
[![msvc2017](https://img.shields.io/badge/MSVC-2017-blue.svg)](https://visualstudio.microsoft.com/vs/whatsnew/)
16+
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/MASD-Project/cpp_ref_impl)](https://www.tickgit.com/browse?repo=github.com/MASD-Project/cpp_ref_impl)
1617

1718
# MASD C++ Reference Implementation
1819

19-
This project contains the MASD C++ Reference Implementation, generated
20-
using the [latest version of
21-
Dogen](https://github.com/MASD-Project/dogen/releases). The objective
22-
of a MASD reference implementation is to exercise all of the available
23-
functionality within Dogen and to unit test it to ensure it works as
24-
specified. The models used to generate the reference implementation
25-
are available under
26-
[projects/models](https://github.com/MASD-Project/cpp_ref_impl/tree/master/projects/models). As
27-
the objective of the reference implementation is to exercise Dogen as
28-
much as possible, the models are available in both Dia and JSON
29-
formats.
30-
31-
# Building
32-
33-
In order to build the MASD C++ Reference Implementation you will need
34-
a C++ toolchain. On Linux and OSX, you'll need a recent compiler with
35-
C++ 17 support, such as [GCC
36-
8](https://www.gnu.org/software/gcc/gcc-8) or [Clang
37-
7](https://img.shields.io/badge/CLANG-7-cyan.svg) - and
38-
[Ninja](https://ninja-build.org/manual.html) or [GNU
39-
Make](https://www.gnu.org/software/make/). On Windows you'll need
40-
[Visual Studio
41-
2017](https://visualstudio.microsoft.com/vs/whatsnew/). Older
42-
compilers may work, but we try to always use the most recent releases
43-
in MASD. So, if you can, please try using to those.
44-
45-
MASD C++ Reference Implementation has the following additional
46-
dependencies, across all operative systems:
47-
48-
| Name | Type | Version | Description |
49-
|--------|-----------|------------------------|-----------------------------------------|
50-
| [CMake](https://cmake.org/) | Mandatory | 3.12 or later. | Required to generate the build files. Earlier versions may also work. |
51-
| [Boost](https://boost.org) | Mandatory | 1.61 or later. | Earlier versions may also work, but patches may be required. **Very Important**: We link statically against Boost at present, so be sure to build and install the static libraries.|
52-
| [LibXml2](http://xmlsoft.org/) | Mandatory | 2.9.4 | Earlier versions may work but haven't been tested.|
53-
| [ODB](https://www.codesynthesis.com/products/odb/) | Optional | 2.5.0 | Required to build the ORM test model. Note that ODB 2.5 is a beta version. |
54-
55-
Though the C++ Reference Implementation should build fine with package
56-
manager supplied libraries - or even with hand-built dependencies -
57-
the easiest way to setup a development environment on all supported
58-
platforms is by using [vcpkg](https://github.com/Microsoft/vcpkg). We
59-
have a vcpkg fork with a [MASD
60-
Branch](https://github.com/MASD-Project/vcpkg/commits/masd) that is
61-
setup correctly to build both Dogen and the C++ Reference
62-
Implementation and is used/validated by our CI. If at all possible,
63-
please use this instead of the mainline vcpkg because it contains a
64-
few changes that cannot be easily mainlined (C++ 17 on all
65-
dependencies, ODB 2.5, etc).
66-
67-
Either way, you can compile vcpkg as per [vcpkg
68-
documentation](https://github.com/Microsoft/vcpkg/blob/master/README.md),
69-
and then install packages by running:
70-
71-
```
72-
./vcpkg install boost-system boost-serialization boost-date-time boost-log boost-filesystem boost-program-options boost-test libodb libodb-pgsql libodb-sqlite cpp-redis
73-
```
74-
75-
---
76-
**Notes**
77-
78-
- The default vcpkg triplet on windows [is 32-bit
79-
dynamic](https://github.com/Microsoft/vcpkg/issues/1254) whereas we
80-
build with ```--triplet x64-windows-static```. If you are experiencing
81-
[weird and wonderful build
82-
errors](https://github.com/Microsoft/vcpkg/issues/4447), check your
83-
triplet.
84-
- If you are on OSX, you probably should rely on the system's LibXML2
85-
(e.g. remove it from the vpkg list above) or else you may see [some
86-
interesting linking
87-
errors](https://github.com/Microsoft/vcpkg/issues/4476) related to ```iconv```.
88-
- Remember that the recommended compiler for OSX is Homebrew's GCC. If
89-
you do decide to use Clang, beware that for some reason [boost does
90-
not
91-
default](https://github.com/Microsoft/vcpkg/issues/4476#issuecomment-430175834)
92-
to C++ 14. You'll need to add ```cxxstd=14```.
93-
- You can skip the ODB libs (e.g. ```libodb libodb-pgsql
94-
libodb-sqlite```) if you are not targeting ORM support. **Very
95-
important**: vcpkg at present only has ODB 2.4 support, but our test
96-
project requires ODB 2.5 because it uses C++ 17 features. If you are
97-
using mainline vcpkg, please have a look at the patches in the [MASD
98-
Branch](https://github.com/MASD-Project/vcpkg/commits/masd) of our
99-
vcpkg fork.
100-
101-
---
102-
103-
Once you have all dependencies set up, you can then clone the
104-
repository and create the build directory:
105-
106-
```
107-
git clone https://github.com/MASD-Project/cpp_ref_impl.git
108-
cd cpp_ref_impl/build
109-
mkdir output
110-
cd output
111-
```
112-
113-
On Linux and OSX, you can build using GNU Make as follows:
114-
115-
```
116-
cmake -DCMAKE_TOOLCHAIN_FILE=${PATH_TO_VCPKG_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake ../..
117-
make -j${CORES}
118-
```
119-
120-
Where ```PATH_TO_VCPKG_DIR``` is the directory in which you've
121-
downloaded and built vcpkg and ```CORES``` is the number of cores
122-
available on your machine. Alternatively, you can use Ninja:
123-
124-
```
125-
cmake -DCMAKE_TOOLCHAIN_FILE=${PATH_TO_VCPKG_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake ../.. -G Ninja
126-
ninja -j${CORES}
127-
```
128-
129-
On Windows, the incantation is slightly different:
130-
131-
```
132-
cmake -DCMAKE_TOOLCHAIN_FILE=${PATH_TO_VCPKG_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake ../.. -DCMAKE_BUILD_TYPE=Release -G 'Visual Studio 14 2015 Win64'
133-
cmake --build . --config Release --target ALL_BUILD
134-
```
135-
136-
---
137-
**Notes**
20+
This project contains the MASD C++ Reference Implementation, generated using the
21+
[latest version of Dogen](https://github.com/MASD-Project/dogen/releases). The
22+
objective of a MASD reference implementation is to exercise all of the available
23+
functionality within Dogen and to unit test it to ensure it works as specified.
24+
The models used to generate the reference implementation are available under
25+
[projects/models](https://github.com/MASD-Project/cpp_ref_impl/tree/master/projects/models).
26+
As the objective of the reference implementation is to exercise Dogen as much as
27+
possible, the models are available in both Dia and JSON formats.
13828

139-
On all platforms, if you are **not** using vcpkg, you can omit
140-
```-DCMAKE_TOOLCHAIN_FILE```. However if the dependencies are not on
141-
the standard paths, you must then set ```CMAKE_INCLUDE_PATH``` and ```CMAKE_LIBRARY_PATH```
142-
accordingly, e.g.:
143-
144-
```
145-
CMAKE_INCLUDE_PATH=/my/boost/include/path CMAKE_LIBRARY_PATH=/my/boost/lib/path cmake ../..
146-
```
29+
# Building From Source
14730

148-
---
31+
For instructions on how to build the MASD C++ product reference implementation,
32+
follow the instructions on
33+
[Dogen](https://github.com/MASD-Project/dogen/releases).
14934

15035
## Running Tests
15136

152-
If you'd like to run the project tests, execute the target
153-
```run_all_tests``` or its abbreviation ```rat```.
37+
If you'd like to run the project tests, execute the target ```run_all_tests```
38+
or its abbreviation ```rat```.
15439

15540
## Regenerating Models
15641

157-
If you'd like to run Dogen to regenerate all models, you can do so by
158-
using the target ```generate_all_dia``` or its abbreviation ```gad```. This is
159-
useful, for example, to update the Reference Implementation to the
160-
latest version of Dogen, or just to see how Dogen works. However, note
161-
that Dogen must be on the path for the target to become available. If you
162-
installed Dogen via a package, it's probably already in the right
163-
location. If not, you need to tell CMake of its location by setting
164-
```CMAKE_PROGRAM_PATH```:
42+
If you'd like to run Dogen to regenerate all models, you can do so by using the
43+
target ```generate_all_dia``` or its abbreviation ```gad```. This is useful, for
44+
example, to update the Reference Implementation to the latest version of Dogen,
45+
or just to see how Dogen works. However, note that Dogen must be on the path for
46+
the target to become available. If you installed Dogen via a package, it's
47+
probably already in the right location. If not, you need to tell CMake of its
48+
location by setting ```CMAKE_PROGRAM_PATH```:
16549

16650
```
16751
CMAKE_PROGRAM_PATH=/path/to/dogen/binary cmake ../..
16852
```
16953

170-
After regeneration, you can then use ```git diff``` to inspect the
171-
differences produced by regeneration, if any. The build directory
172-
contains all of the logs, under the directory ```log```.
54+
After regeneration, you can then use ```git diff``` to inspect the differences
55+
produced by regeneration, if any. The build directory contains all of the logs,
56+
under the directory ```log```.
17357

174-
If you'd like to regenerate ODB code, you can use the target
175-
```odb_all``` or the abbreviated target ```oa```. Note that
58+
If you'd like to regenerate ODB code, you can use the target ```odb_all``` or
59+
the abbreviated target ```oa```. Note that
17660

17761
# Test Models
17862

179-
The Reference Implementation is composed of a number of test
180-
models. These can be summarised as follows:
63+
The Reference Implementation is composed of a number of test models. These can
64+
be summarised as follows:
18165

18266
| Name | Description |
18367
|-------------------------|----------------------------------------------------|
@@ -195,16 +79,15 @@ models. These can be summarised as follows:
19579
| split_project | Project with multiple roots. |
19680
| two_layers_with_objects | Model with multiple layers in Dia. |
19781

198-
The objective of this project is to ensure these models compile. In
199-
addition, a set of model specific tests is present in
200-
```test_model_sanitizer```, which exercises functionality such as
201-
serialisation, IO etc.
82+
The objective of this project is to ensure these models compile. In addition, a
83+
set of model specific tests is present in ```test_model_sanitizer```, which
84+
exercises functionality such as serialisation, IO etc.
20285

20386
# Reporting Problems
20487

205-
If you have found any issues with the generated C++ code, we ask you
206-
to please report it in order to make the code generator
207-
better. Examples of issues with the generated code:
88+
If you have found any issues with the generated C++ code, we ask you to please
89+
report it in order to make the code generator better. Examples of issues with
90+
the generated code:
20891

20992
- it may be using non-idiomatic C++, or following old idioms;
21093
- it may work, but you know of a better way of doing it;

0 commit comments

Comments
 (0)