Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build without sudoer right? #78

Open
DooYal opened this issue Nov 2, 2023 · 1 comment
Open

How to build without sudoer right? #78

DooYal opened this issue Nov 2, 2023 · 1 comment

Comments

@DooYal
Copy link

DooYal commented Nov 2, 2023

In "build" step, the process interrput with the following information:

[100%] Built target spmatrix_test
[100%] Building C object CMakeFiles/splinalg_test.dir/splinalg/test.c.o
[100%] Linking C executable bin/splinalg_test
[100%] Built target splinalg_test
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libgsl.a
CMake Error at cmake_install.cmake:46 (file):
file INSTALL cannot copy file "/public/home/dy/bin/gsl/build/libgsl.a" to
"/usr/local/lib/libgsl.a": Permission denied.

Unfortunately, I have no sudoer right, and I used
opam install gpl
which also meet with the same error

Let opam run your package manager to install the required system packages?
(answer 'n' for other options) [Y/n] y

  • /usr/bin/sudo "yum" "install" "gsl-devel"
    [sudo] password for dy:
  • dy is not in the sudoers file. This incident will be reported.
    [ERROR] System package install failed with exit code 1 at command:
    sudo yum install gsl-devel

However, I can install gsl without build step by my own prefix
So, how should I do to change the prefix in build step?

@phetdam
Copy link

phetdam commented Jan 27, 2024

Hi,

How are you running the installation command? /usr/local by default requires sudo; you can install into your own user directory, e.g. using ~ or ~/local as you desire. If using CMake, e.g. cmake --install, you can change the installation root via the --prefix argument. For example, using ~ as the install root, you can install like this:

cmake --install build_dir --prefix $HOME

Your final installation tree in your user directory ~ should then look something like this:

~/
    include/
        gsl/
    lib/
        libgsl.a
        libgslcblas.a
    bin/
        gsl-config

Of course, you can replace $HOME with $HOME/local or anywhere you have permission to write to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants