Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/docker/ubuntu18.04/c4core-install
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ case $what in
$script gcc-all
$script clang-all
$script embedded
$script intel
;;
gcc-all)
$script gcc-4.8
Expand Down Expand Up @@ -292,6 +293,21 @@ case $what in
apt-get install -y \
qemu
;;
intel)
wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | apt-key add -
apt-add-repository --yes --no-update "deb https://apt.repos.intel.com/oneapi all main"
apt-get update
# intel-basekit - all basic compilers (C,C++,Fortran,Python)
# intel-hpckit
# intel-iotkit
# intel-aikit
# intel-renderkit
apt-get install -y \
intel-basekit
# then:
# - for root: `. /opt/intel/oneapi/setvars.sh`
# - for all users: `. ~/intel/oneapi/setvars.sh`
;;
*)
;;
esac
16 changes: 16 additions & 0 deletions .github/docker/ubuntu22.04/c4core-install
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ case $what in
$script gcc-all
$script clang-all
$script embedded
$script intel
;;
gcc-all)
$script gcc-4.8
Expand Down Expand Up @@ -278,6 +279,21 @@ case $what in
apt-get install -y \
qemu
;;
intel)
wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | apt-key add -
apt-add-repository --yes --no-update "deb https://apt.repos.intel.com/oneapi all main"
apt-get update
# intel-basekit - all basic compilers (C,C++,Fortran,Python)
# intel-hpckit
# intel-iotkit
# intel-aikit
# intel-renderkit
apt-get install -y \
intel-basekit
# then:
# - for root: `. /opt/intel/oneapi/setvars.sh`
# - for all users: `. ~/intel/oneapi/setvars.sh`
;;
*)
;;
esac
40 changes: 37 additions & 3 deletions .github/reqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ function _c4_gather_compilers()
clang++-5.0) _c4_addclang 5.0 ;;
clang++-4.0) _c4_addclang 4.0 ;;
clang++-3.9) _c4_addclang 3.9 ;;
arm*) ;;
icc) _c4_add_intelcxx ;;
icx) _c4_add_intelcxx ;;
icpc) _c4_add_intelcxx ;;
icpx) _c4_add_intelcxx ;;
all)
for ver in 11 10 9 8 7 6 5 4.9 4.8 ; do
all="$all g++-$ver"
Expand All @@ -276,8 +281,6 @@ function _c4_gather_compilers()
"")
# use default compiler
;;
arm*)
;;
*)
echo "unknown compiler: $cxx"
exit 1
Expand Down Expand Up @@ -375,6 +378,35 @@ function _c4_addlibcxx()
#_add_apt libc++-dev:i386
}

# add the intel compiler
function _c4_add_intelcxx()
{
# https://www.scivision.dev/intel-oneapi-github-actions/
# https://neelravi.com/post/intel-oneapi-install/

# add the key and the apt source
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list

# this is required for 32 bit https://askubuntu.com/questions/1057341/unable-to-find-stl-headers-in-ubuntu-18-04
_add_apt g++-multilib

#_add_apt intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
_add_apt intel-basekit # all basic compilers
_add_apt intel-basekit-32bit # all basic compilers
#_add_apt intel-hpckit # HPC toolkits
#_add_apt intel-iotkit # IoT toolkits
#_add_apt intel-aikit # AI analytics toolkit
#_add_apt intel-dlfdkit # Deep learning framework
#_add_apt intel-renderkit # Rendering toolkit

# NOTE after installation:
# . /opt/intel/oneapi/setvars.sh (root access)
# . ~/intel/oneapi/setvars.sh (single user)
}


#-------------------------------------------------------------------------------

Expand All @@ -393,7 +425,9 @@ function _add_apt()
sourceslist=$2
APT_PKG="$APT_PKG $pkgs"
echo "adding to apt packages: $pkgs"
_add_src "$pkgs" "$sourceslist"
if [ ! -z "$sourceslist" ] ; then
_add_src "$sourceslist" "# for packages: $pkgs"
fi
}

# add an apt source
Expand Down
13 changes: 9 additions & 4 deletions .github/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -x

PROJ_DIR=$(pwd)


function c4_show_info()
{
set +x
Expand Down Expand Up @@ -49,6 +50,10 @@ function c4_show_info()
echo "number of cores=$(nproc)"
$CXX_ --version
;;
icpx|icpc|icx|icc)
echo "number of cores=$(nproc)"
( source /opt/intel/oneapi/setvars.sh ; $CXX_ --version )
;;
esac
set -x
git branch
Expand Down Expand Up @@ -341,8 +346,8 @@ function c4_cfg_test()
-DCMAKE_BUILD_TYPE=$BT $CMFLAGS \
-DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS"
;;
*g++*|*gcc*|*clang*)
export CC_=$(echo "$CXX_" | sed 's:clang++:clang:g' | sed 's:g++:gcc:g')
*g++*|*gcc*|*clang*|icpx|icpc)
export CC_=$(echo "$CXX_" | sed 's:clang++:clang:g' | sed 's:g++:gcc:g' | sed 's:icpx:icx:g' | sed 's:icpc:icc:g')
_c4_choose_clang_tidy $CXX_
cmake -S $PROJ_DIR -B $build_dir -DCMAKE_INSTALL_PREFIX="$install_dir" \
-DCMAKE_C_COMPILER=$CC_ -DCMAKE_CXX_COMPILER=$CXX_ \
Expand Down Expand Up @@ -439,7 +444,7 @@ function _c4_parallel_build_flags()
echo "-IDEBuildOperationMaxNumberOfConcurrentCompileTasks=$NUM_JOBS_BUILD"
fi
;;
*g++*|*gcc*|*clang*|em++)
*g++*|*gcc*|*clang*|em++|icpx|icpc|icx|icc)
if [ -z "$NUM_JOBS_BUILD" ] ; then
echo "-j $(nproc)"
else
Expand All @@ -466,7 +471,7 @@ function _c4_generator_build_flags()
# https://stackoverflow.com/questions/51153525/xcode-10-unable-to-attach-db-error
echo "-UseModernBuildSystem=NO"
;;
*g++*|*gcc*|*clang*|em++)
*g++*|*gcc*|*clang*|em++|icpx|icpc|icx|icc)
;;
"") # allow empty compiler
;;
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: intel

defaults:
#if: "!contains(github.event.head_commit.message, 'skip ci')" # SKIP
run:
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash -e -x {0}

on:
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

env:
PROJ_PFX_TARGET: c4core-
PROJ_PFX_CMAKE: C4CORE_
CMAKE_FLAGS:
NUM_JOBS_BUILD: # 4


jobs:

#----------------------------------------------------------------------------
intel:
name: intel/c++${{matrix.std}}/${{matrix.bt}}
continue-on-error: true
if: always() # https://stackoverflow.com/questions/62045967/github-actions-is-there-a-way-to-continue-on-error-while-still-getting-correct
runs-on: ubuntu-latest
container: ghcr.io/biojppm/c4core/ubuntu18.04:latest # use the docker image
strategy:
fail-fast: false
matrix:
include:
- {std: 11, cxx: icpx, bt: Debug , bitlinks: shared64 static32}
- {std: 11, cxx: icpx, bt: Release, bitlinks: shared64 static32}
- {std: 17, cxx: icpx, bt: Debug , bitlinks: shared64 static32}
- {std: 17, cxx: icpx, bt: Release, bitlinks: shared64 static32}
- {std: 20, cxx: icpx, bt: Debug , bitlinks: shared64 static32}
- {std: 20, cxx: icpx, bt: Release, bitlinks: shared64 static32}
env: {STD: "${{matrix.std}}", CXX_: "${{matrix.cxx}}", BT: "${{matrix.bt}}", BITLINKS: "${{matrix.bitlinks}}", VG: "${{matrix.vg}}", SAN: "${{matrix.san}}", LINT: "${{matrix.lint}}", OS: "${{matrix.os}}"}
steps:
- {name: checkout, uses: actions/checkout@v3, with: {submodules: recursive}}
- {name: checkout, uses: actions/checkout@v3, with: {submodules: recursive}}
- run: git config --system --add safe.directory '*' # needed for running in the docker image. see https://github.com/actions/checkout/issues/1169
- run: c4core-install intel
- {name: show info, run: source .github/setenv.sh && c4_show_info}
- name: shared64-configure---------------------------------------------------
run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_cfg_test shared64
- {name: shared64-build, run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_build_test shared64}
- {name: shared64-run, run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_run_test shared64}
- {name: shared64-pack, run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_package shared64}
- name: static64-configure---------------------------------------------------
run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_cfg_test static64
- {name: static64-build, run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_build_test static64}
- {name: static64-run, run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_run_test static64}
- {name: static64-pack, run: source /opt/intel/oneapi/setvars.sh intel64 && source .github/setenv.sh && c4_package static64}
- name: static32-configure---------------------------------------------------
run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_cfg_test static32
- {name: static32-build, run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_build_test static32}
- {name: static32-run, run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_run_test static32}
- {name: static32-pack, run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_package static32}
- name: shared32-configure---------------------------------------------------
run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_cfg_test shared32
- {name: shared32-build, run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_build_test shared32}
- {name: shared32-run, run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_run_test shared32}
- {name: shared32-pack, run: source /opt/intel/oneapi/setvars.sh intel32 && source .github/setenv.sh && c4_package shared32}