[Top][All Lists]

[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: Mike Miller
Subject: Re: can't install packages because Octave is using clang instead of homebrew gcc (MacOS)
Date: Sat, 15 Jun 2019 11:59:25 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

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/ 
> --with-gxx-include-dir=/Applications/
> 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.


Attachment: signature.asc
Description: PGP signature

reply via email to

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