While in a conda environment (source activate
), how can I make install
into the environment library directories (lib
, bin
, etc.) and not the system directories?
Note that I do NOT want answers related to conda-build
.
While in a conda environment (source activate
), how can I make install
into the environment library directories (lib
, bin
, etc.) and not the system directories?
Note that I do NOT want answers related to conda-build
.
Use the -C
(change directory) argument to tell make
to use a different directory:
make -C $CONDA_PREFIX/lib install
From the manual:
-C dir, --directory=dir
Change to directory dir before reading the makefiles or doing anything else.
If the project uses CMake to generate Make files:
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release ..
make -j install
Docs: https://cmake.org/cmake/help/v2.8.10/cmake.html#variable%3aCMAKE_INSTALL_PREFIX
CMAKE_INSTALL_PREFIX: Install directory used by install. If "
make install
" is invoked or INSTALL is built, this directory is pre-pended onto all install directories. This variable defaults to/usr/local
on UNIX andc:/Program Files
on Windows.
© 2022 - 2024 — McMap. All rights reserved.
$CONDA_PREFIX
points to the prefix of the environment, e.g.,/home/user/miniconda3/envs/env-name
. From there you can addlib
,bin
, etc. – Miss$CONDA_PREFIX
from above), then provide it to theconfigure
command as mentioned here if you're lucky to have the make definition having been originally created in a very standard way by the authors of the project which builds the package you are installing, as mentioned on this link just included. – Dividers