\ 跳到主要內容

pybind11

Hi, what I tried to reach in the past 2 days was to build the pybind11 from source. At first I failed to find information I expected in the pdf documentation in readme (I focused on the wrong chapter I later found). What I did at first was following the history, I followed them and then tried them myself, and it was like:

rm -rf /usr/local/include/pybind
cd ~/git-repo
git clone (github pybind repository)
cd pybind
mkdir build/install -p
cd build/install
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ../..
sudo make install
the viewer could be successfully built and run.  The second attempt was following was following the pdf documentation in readme:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make check -j 4
along with sudo make install followed.

Up to this point, I don't quite understand the purpose of `mkdir` before `cmake`, and the reason to why `cmake` and `sudo make install` seems to be the main point to build `pybind11` instead of other action such as `python3 setup.py install`, and when to define certain variable such as  `-DCMAKE_INSTALL_PREFIX=/usr/local` instead of leaving it default.



留言