Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Removed README.cmake.md, edited README.md #10028

Merged
merged 1 commit into from Jul 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
133 changes: 0 additions & 133 deletions README.cmake.md

This file was deleted.

74 changes: 64 additions & 10 deletions README.md
Expand Up @@ -66,9 +66,50 @@ Build instructions:
make

This assumes you make your build dir a subdirectory of the ceph.git
checkout. If you put it elsewhere, just replace .. above with a
checkout. If you put it elsewhere, just replace .. above with a
correct path to the checkout.

To build only certain targets use:

make [target name]

To install:

make install

CMake Options
-------------

If you run the `cmake` command by hand, there are many options you can
Copy link
Member

@ivancich ivancich Jun 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance on an exhaustive list of -D options? Can we expect sys admins to know how to interpret CMakeLists.txt files to figure it all out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe cmake -LH will do the trick (sort of).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivancich that's a good question, the -D options are not just limited to the options we define in CMakeLists.txt with the option() function, but also to variables defined by CMake (ex: CMAKE_BUILD_TYPE, CMAKE_C_FLAGS, etc.). So I don't think it would be good to have an exhaustive list, but what do you think about a list of 10-20 very important ones?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alimaredia Sounds reasonable.

set with "-D". For example the option to build the RADOS Gateway is
defaulted to ON. To build without the RADOS Gateway:

cmake -DWITH_RADOSGW=OFF [path to top level ceph directory]

Another example below is building with debugging and alternate locations
for a couple of external dependencies:

cmake -DLEVELDB_PREFIX="/opt/hyperleveldb" -DOFED_PREFIX="/opt/ofed" \
-DCMAKE_INSTALL_PREFIX=/opt/accelio -DCMAKE_C_FLAGS="-O0 -g3 -gdwarf-4" \
..

To view an exhaustive list of -D options, you can invoke `cmake` with:

cmake -LH
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivancich actually cmake -LH does do the trick from what I found. What do you think?


If you often pipe `make` to `less` and would like to maintain the
diagnostic colors for errors and warnings (and if your compiler
supports it), you can invoke `cmake` with:

cmake -DDIAGNOSTICS_COLOR=always ..

Then you'll get the diagnostic colors when you execute:

make | less -R

Other available values for 'DIAGNOSTICS_COLOR' are 'auto' (default) and
'never'.


Building packages
-----------------
Expand Down Expand Up @@ -114,28 +155,41 @@ To start or stop individual daemons, the sysvinit script can be used:
Running unit tests
==================

To run build and run all tests, use ctest:
To build and run all tests (in parallel using all processors), use `ctest`:

cd build
make
ctest -j$(nproc)

To run an individual test manually, run the ctest command with -R
(regex matching):
(Note: Many targets built from src/test are not run using `ctest`.
Targets starting with "unittest" are run in `make check` and thus can
be run with `ctest`. Targets starting with "ceph_test" can not, and should
be run by hand.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a note that ctest does not build the dependencies needed to run the test in question?


To build and run all tests and their dependencies without other
unnecessary targets in Ceph:

cd build
make check -j$(nproc)

To run an individual test manually, run `ctest` with -R (regex matching):

ctest -R [regex matching test name(s)]

ctest -R [test name]
(Note: `ctest` does not build the test it's running or the dependencies needed
to run it)

To run an individual test manually and see all the tests output, run
the ctest command with the -V (verbose) flag:
`ctest` with the -V (verbose) flag:

ctest -V -R [test name]
ctest -V -R [regex matching test name(s)]

To run an tests manually and run the jobs in parallel, run the ctest
command with the -j flag:
To run an tests manually and run the jobs in parallel, run `ctest` with
the -j flag:

ctest -j [number of jobs]

There are many other flags you can give the ctest command for better control
There are many other flags you can give `ctest` for better control
over manual test execution. To view these options run:

man ctest
Expand Down