\ 跳到主要內容

cmake

YY: Good to know that you managed to rebuild with pybind11 reinstalled.  Comments:

1. Please search the cmake document for why you should mkdir before building a cmake project.  Similarly, please share the link that provides the information.

So at first I went here.  I get to know:

Usage

  cmake [options] path-to-source
  cmake [options] path-to-existing-build
  cmake [options] -S path-to-source -B path-to-build
From the video, the mkdir seems to be what most people do. The reason to why mkdir I supposed is that it helps organize our files, so that files won't be a mess. It helps, but not a necessity. In order to better confirm my words, I did a little experiment on it:
cmake -DCMAKE_INSTALL_PREFIX=/ .
sudo make install
It works as well. So I think the reason to mkdir is that it helps sort our files in an organized way. 

While building pybind, there are files being generated, including Makefile; no additional CMakeLists.txt are generated accordingly. I'm not sure whether it is possible that cmake would generate an additional CMakeLists.txt. If it does, the reason to mkdir will be even obvious, i.e, overwritting will increase the difficulty if we want to undo. 

2. Please find out what CMAKE_INSTALL_PREFIX does, and show me the link that explains it to you.
It designated the directory of installation. (link)
On my pc, while cmake -DCMAKE_INSTALL_PREFIX=/ .,
...
-- Installing: /usr/include/pybind11/common.h
-- Installing: /usr/include/pybind11/pybind11.h
...
while cmake -DCMAKE_INSTALL_PREFIX=/usr/local .,
...
-- Installing: /usr/local/include/pybind11/common.h
-- Installing: /usr/local/include/pybind11/pybind11.h
...


3. Read the cmake control file of either pybind11 or modmesh and tell me what it does.  You should also tell me which file(s) are the cmake control file.  Show me the links, too.
From this documentation, I think CMakeLists.txt is the cmake control file. Within CMakeLists.tx. there are if-statements, to me it correspond to the Flow Control-> conditional statement in the link above. 

  • Addressing my comments will not bring answers to your questions immediately, but will train you the skills for you to find the answers yourself later. And I would like to ask you that which platform do you want to use for developing modmesh?  It's Windows or Linux?  And why?
I would like to use Linux. Well, I think the main purpose to me is that Linux seems to be a developing platform, where I expect it to result in less troubles in the future. Also, targets on developing problem, there are more discussion on Linux and less on Windows on the internet, so I expect on Linux I could better overcome troubles in the future. 

  • While answering the questions, since you can build the code, please run all the unit tests.  You should see all of them pass.  After that, please break one test and tell me what do you do to break it and why it breaks. 
I'll work on building the code, running the unit tests, and break one test tomorrow. But may I ask, what do you mean by break?


留言