简体   繁体   中英

How to solve this Octave pkg install error

I tried to install my first Octave package with the command: pkg install -forge control . The following error occurred.

octave:1> pkg install -forge control
ld: warning: directory not found for option '-L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin20/11'
ld: warning: directory not found for option '-L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin20/11/../../..'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [__control_slicot_functions__.oct] Error 1
tar -xzf slicot.tar.gz
/usr/local/Cellar/octave/6.4.0_1/bin/mkoctfile-6.4.0 -Wall -Wno-deprecated-declarations  __control_helper_functions__.cc
mkdir sltmp
mv slicot/src/*.f ./sltmp
mv slicot/src_aux/*.f ./sltmp
if [ "1" = "1" ]; then \
        echo "copy routines using DGGES"; \
        cp SB04OD.fortran ./sltmp/SB04OD.f; \
        cp SG03AD.fortran ./sltmp/SG03AD.f; \
        cp SG03BD.fortran ./sltmp/SG03BD.f; \
    fi;
copy routines using DGGES
cp AB08NX.fortran ./sltmp/AB08NX.f
cp AG08BY.fortran ./sltmp/AG08BY.f
cp SB01BY.fortran ./sltmp/SB01BY.f
cp SB01FY.fortran ./sltmp/SB01FY.f
cp SB06ND.fortran ./sltmp/SB06ND.f
cp TB01MD.fortran ./sltmp/TB01MD.f
cp TB01ND.fortran ./sltmp/TB01ND.f
cp TB01ZD.fortran ./sltmp/TB01ZD.f
cp TG04BX.fortran ./sltmp/TG04BX.f
cp ODLTZM.fortran ./sltmp/ODLTZM.f
cp makefile.slicot ./sltmp/makefile
cd sltmp; /usr/local/Cellar/octave/6.4.0_1/bin/mkoctfile-6.4.0 -w -c MA02ID.f; rm MA02ID.f; /usr/local/Cellar/octave/6.4.0_1/bin/mkoctfile-6.4.0 -c *.f;
ar -rc slicotlibrary.a ./sltmp/*.o
rm -rf sltmp slicot
LDFLAGS="-F/usr/local/opt/qt@5/lib  -L/usr/local/opt/openblas/lib -lopenblas  -L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin20/11 -L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin20/11/../../.. -lgfortran -lquadmath -lm" \
    /usr/local/Cellar/octave/6.4.0_1/bin/mkoctfile-6.4.0 -Wall -Wno-deprecated-declarations  __control_slicot_functions__.cc common.cc slicotlibrary.a

error: pkg: error running 'make' for the control package.
error: called from
    configure_make at line 110 column 9
    install at line 196 column 7
    pkg at line 568 column 9

I noticed the warning in the first two lines of the message about some directory not found. Then I found out that the correct path should be /usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin21/11/ (darwin 21 , not 20).

I also checked the Octave version information: octave --version . It also reads:

GNU Octave, version 6.4.0
...
Octave was configured for "x86_64-apple-darwin20.6.0".

How could I solve this issue?

More info:

  • macOS Monterey 12.1
  • Octave 6.4.0, installed with Homebrew 3.3.9-36-ge970bb1

I got this to work by simply linking sym linking 21 to 20:

ln -s x86_64-apple-darwin21 x86_64-apple-darwin20

Probably not the right way to do this, but I was able to load the control and signal packages. The signal function I want use seems to be working.

I would like to know if there is a "proper" way to fix this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM