Open Cilyan opened 2 years ago
@Cilyan It is not intended to be a valid path. It is intended to be a "fill in the blanks" for the reader. I thought it was clear that it's "fill in the blanks" since it isn't a valid path (as you are pointing out here). Clearly I was mistaken on the clarity.
Do you have any suggestions on how to improve this block so that it's actual advice along the lines of:
...
)BUILD_DIR
relative to this root (.../libbezier-debug/build
)INSTALL_PREFIX
relative to this root (.../libbezier-debug/usr
)For context, this is what he is referring to https://bezier.readthedocs.io/en/2021.2.12/development.html#libbezier
The fact that python -m pip wheel .
fails for you is curious. It seems like it should for your chosen build root. Try two different things to see if it fixes the issue:
pip
changes directory when doing a build in a temporary directory)export BEZIER_INSTALL_PREFIX=...your choice of path goes here...
instead of just setting it inline for the command (this is to account for pip
making subprocesses that don't inherit the parent env vars; I don't actually think this is happening)I finally had time to dive a bit more into it. Indeed, it works only if you set the path as absolute. For the documentation, it is more common to find something like BEZIER_INSTALL_PREFIX="/<absolute-path-to>/build/usr" python -m pip wheel .
.
Also, people often expect that these kind of lines can simply be copied and pasted, so this could work:
$ SRC_DIR="src/fortran/"
$ BUILD_DIR="$(pwd)/build"
$ INSTALL_PREFIX="usr"
$ mkdir -p "${BUILD_DIR}"
$ cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-S "${SRC_DIR}" \
-B "${BUILD_DIR}"
$ cmake \
--build "${BUILD_DIR}" \
--config Debug \
--target install
and
$ BEZIER_INSTALL_PREFIX="${BUILD_DIR}/${INSTALL_PREFIX}" python -m pip wheel .
Note that I removed the chevrons, they get copied together with the command and when pasted in a terminal, this doesn't work. The dollar signs are properly placed apart by the code-block directive, so they do not get copied when selecting multiple lines.
First,
...
is not a "valid" path under Linux (it would create a...
folder, which is a hidden folder, so probably not what we want).Then,
CMAKE_INSTALL_PREFIX:PATH
seems to be relative toBUILD_DIR
, so withthe installation path is effectively
../libbezier-release/libbezier-release/usr
(=../libbezier-release/build/../libbezier-release/usr
). Although, in the docs, the way the same pattern is repeated for both variables (.../libbezier-release/
) lets the user think that both paths are relative to the current directory. In any case,BEZIER_INSTALL_PREFIX
cannot be set toINSTALL_PREFIX
but should rather be set to$BUILD_DIR/$INSTALL_PREFIX
....
is, I believe, the Windows equivalent for../..
(go up two folders), and it would somehow work if one would just replace...
with../..
(because you go down two folders, then up two folders). But it works only in this very specific case and in a real situation, going up two folders may not be possible (location not writable, for example if you are working in/home/user/bezier
,/tmp/bezier
, ...).Finally, it seems that I still get some issues, despite my best effort to convert the snippets from the docs to something Linux would accept:
despite the files being there:
Version used: