워라밸 중독자

sudo 권한 없을 때 conda env에 make로 설치 본문

코딩, 딱 지금이 시작할때! (코딱지)

sudo 권한 없을 때 conda env에 make로 설치

Ufungi 2023. 7. 17. 12:25
sudo make install [sudo] password for genome: (phyx) genome@limsfep-zen-32c:/data/genome/run/snyoo/programs/phyx/deps/armadillo-7.400.2$ make install [100%] Built target armadillo Install the project... -- Install configuration: "" -- Up-to-date: /usr/include CMake Error at cmake_install.cmake:54 (file): file INSTALL cannot set permissions on "/usr/include": Operation not permitted. make: *** [Makefile:100: install] Error 1 (phyx) genome@limsfep-zen-32c:/data/genome/run/snyoo/programs/phyx/deps/armadillo-7.400.2$
 
ChatGPT
 

The error you encountered is because the make install command is attempting to install the compiled files to a system directory (/usr/include), which requires administrator (root) permissions. However, you are working in a Conda environment, and it's generally not recommended to install packages or libraries directly into the system directories using sudo or make install.

To avoid the permission issues and to keep the installation isolated within the Conda environment, you should use the DESTDIR variable during the installation process. Here's how you can modify the installation step:

  1. Navigate back to the armadillo-7.400.2 directory:
bashCopy code
cd /data/genome/run/snyoo/programs/phyx/deps/armadillo-7.400.2
  1. Instead of running sudo make install, use the DESTDIR variable with make install to specify the installation directory within your Conda environment:
bashCopy code
make install DESTDIR=$CONDA_PREFIX

By setting DESTDIR=$CONDA_PREFIX, the files will be installed into the appropriate Conda environment directory, and it won't require sudo privileges.

After running the modified make install command, the Armadillo library should be installed in the Conda environment's directories, making it accessible for the subsequent steps of the phyx installation process.