LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-06-2023, 01:29 AM   #1
Stealthsniper
LQ Newbie
 
Registered: Dec 2023
Posts: 2

Rep: Reputation: 0
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.

Last edited by Stealthsniper; 12-06-2023 at 01:33 AM.
 
Old 12-06-2023, 05:13 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
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.
 
Old 12-06-2023, 02:52 PM   #3
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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.

Last edited by computersavvy; 12-08-2023 at 09:46 AM.
 
Old 12-08-2023, 08:46 AM   #4
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 779

Rep: Reputation: 246Reputation: 246Reputation: 246
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.
 
Old 12-17-2023, 02:35 AM   #5
Stealthsniper
LQ Newbie
 
Registered: Dec 2023
Posts: 2

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by computersavvy View Post
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.
terminal output1.txt
 
Old 12-17-2023, 02:51 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: RISC-V to hand out 1,000 free RISC-V dev boards LXer Syndicated Linux News 0 05-04-2021 03:36 AM
LXer: Linux Foundation and RISC-V International launch free RISC-V training classes LXer Syndicated Linux News 0 03-04-2021 02:30 AM
LXer: Learn About the RISC-V ISA with Two Free Training Courses from The Linux Foundation and RISC-V International LXer Syndicated Linux News 0 03-03-2021 09:10 PM
LXer: Debian GNU/Linux Operating System Is Now Supported on 64-bit RISC-V Hardware LXer Syndicated Linux News 0 04-08-2018 12:33 AM
GNU Make and GNU GCC DEBUG vs RELEASE compiler options aryan1 Programming 1 01-12-2010 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration