'make install' into a conda environment
Asked Answered
L

2

14

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.

Lifeblood answered 15/12, 2017 at 22:0 Comment(3)
With the environment activated, the environment variable $CONDA_PREFIX points to the prefix of the environment, e.g., /home/user/miniconda3/envs/env-name. From there you can add lib, bin, etc.Miss
@Lifeblood Did you find a solution to this?Birdsall
You would find the root path to your conda environment (maybe, $CONDA_PREFIX from above), then provide it to the configure 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
Y
0

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.
Yielding answered 1/9, 2021 at 20:51 Comment(0)
P
0

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 and c:/Program Files on Windows.

Phantasmal answered 25/6 at 1:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.