我刚刚学会了cmake
和make
几天。
我想修改ceph
中的一些源文件(用C ++编写),并编译它们以研究ceph
的工作原理。但是编译它需要太多时间,即使我做了一些小改动。我该怎么办?
或者,我想将ceph
的一些子模块编译到动态链接库(.so
)中,然后用它们替换原件。我该怎么做?
谢谢!
-------------------------------------------- 我在某个源文件中添加了一行代码:
cout << 'test' << endl
并运行make(之前我已多次制作)
make
shell中的输出:
[bop@client1 jewel]$ make
Making all in .
make[1]: Entering directory `/home/bop/jewel'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/home/bop/jewel'
Making all in src
make[1]: Entering directory \`/home/bop/jewel/src\'
make all-recursive
make[2]: Entering directory `/home/bop/jewel/src'
Making all in ocf
make[3]: Entering directory `/home/bop/jewel/src/ocf'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/bop/jewel/src/ocf'
..............
..............
./make_version -g ./.git_version
This is no git repository, not updating .git_version
if [ -n "$NO_VERSION" ] ; then \
./make_version -g ./.git_version -c ./ceph_ver.h -n ; \
else \
./make_version -g ./.git_version -c ./ceph_ver.h ; \
fi
This is no git repository, not updating .git_version
CXX erasure-code/jerasure/libec_jerasure_generic_la-ErasureCodeJerasure.lo
CXXLD libec_jerasure_generic.la
CXX erasure-code/jerasure/libec_jerasure_sse3_la-ErasureCodeJerasure.lo
CXXLD libec_jerasure_sse3.la
CXX erasure-code/jerasure/libec_jerasure_sse4_la-ErasureCodeJerasure.lo
CXXLD libec_jerasure_sse4.la
CXXLD liberasure_code.la
CXXLD librados.la
..............
..............
writing... rados.8 { } ceph-fuse.8 { } ceph-syn.8 { } ceph-disk.8 { } rbd.8 { } crushtool.8 { } radosgw.8 { } ceph-rest-api.8 { } ceph-deploy.8 { } ceph-osd.8 { } ceph-conf.8 { } rbd-replay-prep.8 { } ceph-detect-init.8 { } rbdmap.8 { } radosgw-admin.8 { } ceph-dencoder.8 { } osdmaptool.8 { } ceph-post-file.8 { } rbd-replay.8 { } ceph-mds.8 { } ceph-rbdnamer.8 { } rbd-fuse.8 { } librados-config.8 { } ceph-run.8 { } ceph-authtool.8 { } ceph.8 { } rbd-replay-many.8 { } rbd-nbd.8 { } ceph-mon.8 { } mount.ceph.8 { } ceph-clsinfo.8 { } ceph-create-keys.8 { } monmaptool.8 { } rbd-mirror.8 { } ceph-debugpack.8 { } cephfs.8 { }
build succeeded.
make[1]: Leaving directory `/home/bop/jewel/man'
Making all in doc
make[1]: Entering directory `/home/bop/jewel/doc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bop/jewel/doc'
Making all in systemd
make[1]: Entering directory `/home/bop/jewel/systemd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bop/jewel/systemd'
当它运行时,我看到CPU利用率非常低,但磁盘负载相当高。整个过程大约需要30分钟。
我不认为这是可以接受的。如何降低成本?
谢谢!