Skip to content

Commit

Permalink
Update c-cpp.yml with tests on macos
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Golikov <kirill.golikov@abbyy.com>
  • Loading branch information
favorart committed May 14, 2024
1 parent 0d43d85 commit 1c6ad06
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,88 @@ jobs:
./NeoMLTest --MathEngine=cuda
build-and-test-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@master
- uses: seanmiddleditch/gha-setup-ninja@master # ninja

- name: check gcc
run: gcc --version

- name: install gcc
run: |
brew install g++
# link the selected version, but first try unlinking both
# without and with specified version (cover case in which
# multiple versions are already installed and/or linked)
brew unlink gcc
brew unlink gcc@${version}
brew link gcc@${version}
os_ver=$(sw_vers -productVersion | cut -d'.' -f1)
# default homebrew bin dir changed with macos 14
if (( "$os_ver" > 13 )); then
ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++
else
ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++
fi
export CC="gcc"
export CXX="g++"
- name: install intel-mkl
run: |
MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17426/m_BaseKit_p_2021.1.0.2427.dmg
MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681.dmg
#MACOS_BASEKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17426/m_BaseKit_p_2021.1.0.2427.dmg
#MACOS_HPCKIT_URL=https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681.dmg
require_fetch
$fetch $MACOS_HPCKIT_URL > m_HPCKit.dmg
hdiutil attach m_HPCKit.dmg
sudo /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s \
--action install \
--eula=accept \
--continue-with-optional-error=yes \
--log-dir=.
hdiutil detach /Volumes/"$(basename "$MACOS_HPCKIT_URL" .dmg)" -quiet
rm m_HPCKit.dmg
source /opt/intel/oneapi/setvars.sh
cat >> $GITHUB_ENV <<EOF
LD_LIBRARY_PATH=$LD_LIBRARY_PATH
LIBRARY_PATH=$LIBRARY_PATH
INFOPATH=$INFOPATH
MANPATH=$MANPATH
ONEAPI_ROOT=$ONEAPI_ROOT
CLASSPATH=$CLASSPATH
CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH
OCL_ICD_FILENAMES=$OCL_ICD_FILENAMES
INTEL_PYTHONHOME=$INTEL_PYTHONHOME
CPATH=$CPATH
SETVARS_COMPLETED=$SETVARS_COMPLETED
EOF
for path in ${PATH//:/ }; do
echo $path >> $GITHUB_PATH
done
- name: configure release
run: cmake -G Ninja /Users/runner/work/neoml/neoml/NeoML -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/Users/runner/work/neoml/build.release
- name: make release
run: cmake --build . --target install

- name: test NeoMathEngine release CPU
run: |
cd /Users/runner/work/neoml/build.release/bin
./NeoMathEngineFullTestDesktop --MathEngine=cpu
- name: test NeoML release CPU
run: |
cd /Users/runner/work/neoml/build.release/bin
./NeoMLTest --MathEngine=cpu

0 comments on commit 1c6ad06

Please sign in to comment.