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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
----------------- | ||
|
@@ -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.) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you add a note that |
||
|
||
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 | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alimaredia Sounds reasonable.