Kaldi install: install openblas on apple silicon m3 pro

  Kiến thức lập trình

I’ve been facing an error while installing openblas for kaldi on m3 pro(Sonoma 14.2).
Error message is below:

No receipt for 'com.apple.pkg.Xcode' found at '/'.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
./gensymbol osx arm64 "_" 0 0  0 0 0 0 "" "" 1 0 1 1 1 1 > osx.def
gfortran -O2 -Wl,-ld_classic -Wall -frecursive -fno-optimize-sibling-calls -fPIC -march=armv8-a  -all_load -headerpad_max_install_names -install_name "/Users/jieunpark/kaldi/tools/OpenBLAS/exports/../libopenblas.0.dylib" -dynamiclib -o ../libopenblas_armv8-r0.3.26.dylib ../libopenblas_armv8-r0.3.26.a -Wl,-exported_symbols_list,osx.def  -L/opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/aarch64-apple-darwin23/13 -L/opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc -L/opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/aarch64-apple-darwin23/13/../../..  -lgfortran -lemutls_w -lquadmath -lSystem 
ld: library not found for -ld_classic
collect2: error: ld returned 1 exit status
make[1]: *** [libopenblas_armv8-r0.3.26.dylib] Error 1
make: *** [shared] Error 2

The first erroe seems to be concerned with xcode, so I tried to resolve it with uninstall & re-install xcode, but it didn’t work. (/a/60982835/23261029)

Below code is the one for installing openblas. :

#!/usr/bin/env bash

OPENBLAS_VERSION=0.3.26

WGET=${WGET:-wget}

set -e

if ! command -v gfortran 2>/dev/null; then
  echo "$0: gfortran is not installed.  Please install it, e.g. by:"
  echo " apt-get install gfortran"
  echo "(if on Debian or Ubuntu), or:"
  echo " yum install gcc-gfortran"
  echo "(if on RedHat/CentOS).  On a Mac, if brew is installed, it's:"
  echo " brew install gfortran"
  exit 1
fi


tarball=OpenBLAS-$OPENBLAS_VERSION.tar.gz

rm -rf OpenMathLib-OpenBLAS-* OpenBLAS OpenBLAS-*.tar.gz

if [ -d "$DOWNLOAD_DIR" ]; then
  cp -p "$DOWNLOAD_DIR/$tarball" .
else
  url=$($WGET -qO- "https://api.github.com/repos/OpenMathLib/OpenBLAS/releases/tags/v${OPENBLAS_VERSION}" | python3 -c 'import sys,json;print(json.load(sys.stdin)["tarball_url"])')
  test -n "$url"
  $WGET -t3 -nv -O $tarball "$url"
fi

tar xzf $tarball
mv OpenMathLib-OpenBLAS-* OpenBLAS

MACOSX_DEPLOYMENT_TARGET=14.2.1 make PREFIX=$(pwd)/OpenBLAS/install USE_LOCKING=1 USE_THREAD=0 -C OpenBLAS all install
if [ $? -eq 0 ]; then
   echo "OpenBLAS is installed successfully."
   rm $tarball
fi

Anybody who knows what the problem is and how to solve it, please answer below.
Thanks in advance!!!!

-> I’d like to install openblas completely and finish setting for kaldi.

New contributor

jieun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT