help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't install packages because Octave is using clang instead of home


From: David Lowenfels
Subject: Re: can't install packages because Octave is using clang instead of homebrew gcc (MacOS)
Date: Sat, 15 Jun 2019 19:12:12 -0700

Thanks Mike. The variables set in ~/.bashrc don't seem to be
propagating into octave shell environment... any other suggestions?

octave:2> system("which $SHELL")
/bin/bash
ans = 0
octave:3> system("$SHELL")
bash-3.2$ echo $CC
gcc-9
bash-3.2$ exit
exit
ans = 0
octave:4> system("echo $CC")
ans = 0
octave:5> system("echo $PATH")
/usr/local/sbin:/Users/dfl/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/Cellar/octave/5.1.0_4/libexec/octave/5.1.0/site/exec/x86_64-apple-darwin18.5.0:/usr/local/Cellar/octave/5.1.0_4/libexec/octave/api-v53/site/exec/x86_64-apple-darwin18.5.0:/usr/local/Cellar/octave/5.1.0_4/libexec/octave/site/exec/x86_64-apple-darwin18.5.0:/usr/local/Cellar/octave/5.1.0_4/libexec/octave/5.1.0/exec/x86_64-apple-darwin18.5.0:/usr/local/Cellar/octave/5.1.0_4/bin
ans = 0

MacBook-Pro:octave dfl$ more ~/.bashrc
export CC=gcc-9
export CXX=g++-9

MacBook-Pro:octave dfl$ more ~/.bash_profile
. ~/.profile
. ~/.bashrc
alias ls='ls -Gh'
eval "$(rbenv init -)"
export PATH="/usr/local/sbin:$PATH"


On Sat, Jun 15, 2019 at 12:01 PM Mike Miller <address@hidden> wrote:
>
> Hi David,
>
> On Sat, Jun 15, 2019 at 10:29:54 -0700, David Lowenfels wrote:
> > I just installed a fresh copy of Octave (5.1.0) using homebrew (2.15) and 
> > am having problems installing packages from octave-forge.
> > It appears that octave is using Xcode clang instead of my homebrew gcc, 
> > even though I have the following aliases in my ~/.bash_profile
> >
> > alias gcc='gcc-9' # use homebrew
> > alias cc='gcc-9'
> > alias g++='g++-9'
> > alias c++='c++-9'
> >
> > octave:1> system("gcc --version")
> > Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> > --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
> > octave:2> system("echo $SHELL")
> > /bin/bash
> > octave:3> system("alias")
> > ans = 0
>
> Aliases are a bash feature that is specific to interactive shells. Other
> programs won't see shell aliases as a general rule, not just Octave.
>
> > I also tried:
> > export CC=/usr/local/bin/gcc-9
> > And also tried putting it in ~/.bashrc instead of ~/.bash_profile.
>
> This is closer to the right solution. Please try also setting CXX, which
> is the standard variable for the C++ compiler.
>
>     export CXX=g++-9
>
> Does that help? You may also need to set the DL_LD environment variable,
> which is specific to Octave.
>
> You can also call 'pkg install' with the '-verbose' option to see the
> full compiler commands.
>
> --
> mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]