LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No permission to write into directory for RISC-V GNU compiler Ubuntu 20.04 (https://www.linuxquestions.org/questions/linux-newbie-8/no-permission-to-write-into-directory-for-risc-v-gnu-compiler-ubuntu-20-04-a-4175731565/)

Stealthsniper 12-06-2023 01:29 AM

No permission to write into directory for RISC-V GNU compiler Ubuntu 20.04
 
Hi everyone, I'm an undergraduate student who is entirely new to Linux. I am currently using Ubuntu 20.04 LTS and working on setting up and simulating an IBEX RISC-V core on my computer. I am trying to install the GNU compiler, but i am having issues. These are the commands I ran:
cd new
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain/
/configure --prefix=$home/new
make linux
The error produced:
mkdir -p /.test || \
(echo "Sorry, you don't have permission to write to" \
"''. Please make sure that the location is " \
"writable or use --prefix to specify another destination.'" \
&& exit 1)
mkdir: cannot create directory ‘/.test’: Permission denied
Sorry, you don't have permission to write to ''. Please make sure that the location is writable or use --prefix to specify another destination.'
make: *** [Makefile:221: stamps/check-write-permission] Error 1
A person on GitHub said I am writing into root rather than the Home directory. But I don't understand what i am doing wrong.

pan64 12-06-2023 05:13 AM

mkdir -p /.test
Most probably there is a variable in front of /.test, like
mkdir -p $THIS_IS_A_NICE_DIR/.test
but that variable is either empty or not defined at all.

computersavvy 12-06-2023 02:52 PM

Code:

/configure --prefix=$home/new
This would be an error.
You should either use the absolute path or use the proper variable.
"$home" is not correct by default and probably should be "$HOME"

It probably should be "./configure" and not "/configure" since the build instructions probably include the configure command in the build directory where you are running the command. Linux commands would not be in the root directory.

jayjwa 12-08-2023 08:46 AM

It's standard autoconf stuff
Code:

jayjwa@atr2 ~/riscv-gnu-toolchain (master) > ./configure --prefix=$HOME
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out

"./" means "this path I'm in right here". You can change $PREFIX, depending on what you want. Having a subdirectory called "new" in my ~/ would be a severe affront to my sense of order.

Stealthsniper 12-17-2023 02:35 AM

1 Attachment(s)
Quote:

Originally Posted by computersavvy (Post 6468828)
Code:

/configure --prefix=$home/new
This would be an error.
You should either use the absolute path or use the proper variable.
"$home" is not correct by default and probably should be "$HOME"

It probably should be "./configure" and not "/configure" since the build instructions probably include the configure command in the build directory where you are running the command. Linux commands would not be in the root directory.

Hi! I realised there were a few typos in the command I provided. Yes, it should be "./configure". And the path I provided is actually "...prefix=/home/aaron/new/", which I learnt is the same as "...prefix=$HOME/new/". Thanks.

I proceeded to try to solve this whole headache by running "sudo ./configure --prefix=/home/aaron/new/", and "sudo make linux". It sort of went well, but I can't tell. So I decided to spam "sudo make linux", and it gave an output "make: Nothing to be done for 'linux'". Should this be the desired output for a successful operation?

Here is the logfile.
Attachment 42242

pan64 12-17-2023 02:51 AM

do not use sudo with make, that is not required (the only exception is at the end the sudo make install).
Nothing to be done means it is already made.


All times are GMT -5. The time now is 05:50 PM.