Copying from /usr/local/bin to /usr/bin?

  • Thread starter CAF123
  • Start date
In summary, it is possible to copy or move an executable from /usr/local/bin to /usr/bin, but this requires root permissions. If you are using a Linux shell, you can type sudo cp /usr/local/bin/gfortran/ /usr/local/bin or sudo ln -s /usr/local/bin/gfortran/ /usr/bin/ to make the symbolic link.
  • #36
Thanks, I get the following
Code:
.CFUserTextEncoding
.DS_Store
.Trash
.bash_history
.bash_profile
.bash_profile~
.bash_sessions
.config
.cshrc
.dropbox
.emacs.d
.kshrc
.profile
.ssh
.subversion
.vim
.viminfo
Desktop
Documents
Downloads
Dropbox
Library
Movies
Music
Pictures
Public
plus other personal files. I've tried to write export PATH="/Users/myname/Downloads/LoopTools-2.14/x86_64-Darwin/bin:$PATH" in the file .bash_profile but still I can't get the Install["LoopTools"] to run.

Thanks!
 
Technology news on Phys.org
  • #37
Can you check which executable files there are in that x86_64-Darwin/bin directory?
And then type:
Code:
which whatever-executable-file-without-path
Then try again with:
Code:
tcsh
which whatever-executable-file-without-path
 
  • #38
I like Serena said:
Can you check which executable files there are in that x86_64-Darwin/bin directory?
There is a LoopTools executable, fcc one and lt one.
And then type:
Code:
which whatever-executable-file-without-path
OK, does this just tell me the path to the executable files?
Then try again with:
Code:
tcsh
which whatever-executable-file-without-path
This came with an error saying LoopTools: command not found
 
  • #39
CAF123 said:
There is a LoopTools executable, fcc one and lt one.
OK, does this just tell me the path to the executable files?

This came with an error saying LoopTools: command not found
Yes. It means your terminal can find the executable.

Okay. Let's try editing your .cshrc and add the line:
Code:
set path=($path $HOME/Downloads/LoopTools-2.14/x86_64-Darwin/bin)
and try again.
If it works, please log out and back in before starting Mathematica.
 
  • #40
So do you mean to say just write in the line
Code:
set path=$path $HOME/Downloads/LoopTools-2.14/x86_64-Darwin/bin
in the terminal? (The brackets you had seem to give me an error but when taking them out it seems to work)
I logged out and back in but mathematica still says it can't find the MathLink executable (same error as before)
 
  • #41
CAF123 said:
So do you mean to say just write in the line
Code:
set path=$path $HOME/Downloads/LoopTools-2.14/x86_64-Darwin/bin
in the terminal? (The brackets you had seem to give me an error but when taking them out it seems to work)
I logged out and back in but mathematica still says it can't find the MathLink executable (same error as before)
No, it should be added to the file /Users/yourname/.cshrc, and I believe it should include the parentheses.
Just to check that it is correct can you execute:
Code:
tcsh
set path=($path $HOME/Downloads/LoopTools-2.14/x86_64-Darwin/bin)
which LoopTools
 
Last edited:
  • #42
Ah I see, ok I added that line to the file .cshrc and then executed the three lines above. Nothing happened but I guess that was to be expected. So, I think it is ok. I logged out but mathematica still gives the same error.

Edit: Could I not try writing the same thing in .bash_profile? But indeed I see that the manual suggests .cshrc

Just going for some food now, but thanks a lot for your help so far!
 
  • #43
CAF123 said:
Edit: Could I not try writing the same thing in .bash_profile? But indeed I see that the manual suggests .cshrc

Which file to use depends on whether you're using the Bash shell (.bash_profile) or the C shell (.cshrc).
 
  • #44
I like Serena said:
The usual shell on a Mac is 'bash' instead of 'tcsh' if I'm not mistaken.
And the corresponding configuration file is $HOME/.bashrc instead of $HOME/.cshrc .
So I think we need to modify the .bashrc instead.
I had to look up the difference between .bashrc and .bash_profile (which is what I use).

From here: https://apple.stackexchange.com/que...he-difference-between-bash-profile-and-bashrc
When you login (type username and password) via console, either sitting at the machine, or remotely via ssh: .bash_profile is executed to configure your shell before the initial command prompt.

But, if you’ve already logged into your machine and open a new terminal window (xterm) then .bashrc is executed before the window command prompt. .bashrc is also run when you start a new bash instance by typing /bin/bash in a terminal.

On OS X, Terminal by default runs a login shell every time, so this is a little different to most other systems, but you can configure that in the preferences.
 
  • Like
Likes I like Serena
  • #45
CAF123 said:
Ah I see, ok I added that line to the file .cshrc and then executed the three lines above. Nothing happened but I guess that was to be expected. So, I think it is ok. I logged out but mathematica still gives the same error.
Edit: Could I not try writing the same thing in .bash_profile? But indeed I see that the manual suggests .cshrc
No, unfortunately it's not okay that nothing happened. 'which LoopTools' should either print the path to it, or give an error that it cannot find it.
So I'm currently at a loss why this doesn't happen.

Btw, be careful how you add the line with the PATH.
.bash_profile and .cshrc are incompatible, and completely independent from each other.

How do you start Mathematica exactly?
Can you start it from within the terminal?
Is it a tcsh script? Or something else?

CAF123 said:
Just going for some food now, but thanks a lot for your help so far!
I can understand. ;)
 
Last edited:
  • #46
Hi again :)
I like Serena said:
No, unfortunately it's not okay that nothing happened. 'which LoopTools' should either print the path to it, or give an error that it cannot find it.
So I'm currently at a loss why this doesn't happen.
Ah sorry, I realized I misinformed you yesterday that nothing happened - when I typed in which LoopTools indeed I got the path to it.

Btw, be careful how you add the line with the PATH.
.bash_profile and .cshrc are incompatible, and completely independent from each other.
I see, so if I add the same path in both files then this leads to problems?

How do you start Mathematica exactly?
Can you start it from within the terminal?

I just opened up mathematica from finder and done it within a mathematica notebook. I don't think I've opened mathematica up using the terminal before. Since we've followed all the instructions given in the manual perhaps the way I'm starting mathematica is incorrect - somehow it doesn't know about the addition of the new path perhaps.
 
Back
Top