Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intel oneapi windows build to CI CMake #3738

Closed
wants to merge 15 commits into from
Closed
116 changes: 79 additions & 37 deletions .github/workflows/intel-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,69 +13,111 @@ permissions:
contents: read

jobs:
Intel_build_and_test:
name: "Intel ${{ inputs.build_mode }}"
# Linux (Ubuntu) w/ gcc + CMake
#
Intel_oneapi_linux:
name: "ubuntu-oneapi ${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: add oneAPI to apt
shell: bash
run: |
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main"

# Only CMake need ninja-build, but we just install it unilaterally
# libssl, etc. are needed for the ros3 VFD
- name: Install Linux Dependencies
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz
sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev
sudo apt update
sudo apt-get install ninja-build doxygen graphviz
sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev

- name: install oneAPI dpcpp and fortran compiler
shell: bash
run: |
sudo apt update
sudo apt install -y intel-oneapi-compiler-dpcpp-cpp
sudo apt install -y intel-oneapi-compiler-fortran

- name: install oneAPI MKL library
shell: bash
run: |
sudo apt install -y intel-oneapi-mkl-devel
- name: add oneAPI to env
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: intel
version: '2023.2'

- name: CMake Configure with icx
- name: CMake Configure with oneapi
shell: bash
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
source /opt/intel/oneapi/setvars.sh
export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake -G Ninja \
cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_TOOLCHAIN_FILE=config/toolchain/intel.cmake \
-DMKL_ROOT="/opt/intel/oneapi/mkl/latest" \
-DTBB_ROOT="/opt/intel/oneapi/tbb/latest" \
-DLIBAEC_USE_LOCALCONTENT=OFF \
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_BUILD_FORTRAN=OFF \
$GITHUB_WORKSPACE

# BUILD
- name: CMake Build
shell: bash
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
source /opt/intel/oneapi/setvars.sh
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
working-directory: ${{ runner.workspace }}/build

# RUN TESTS
- name: CMake Run Tests
shell: bash
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
working-directory: ${{ runner.workspace }}/build

Intel_oneapi_windows:
name: "windows-oneapi ${{ inputs.build_mode }}"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Install Dependencies (Windows)
run: choco install ninja

- name: add oneAPI to env
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: intel
version: '2023.2'

- name: CMake Configure with oneapi
shell: pwsh
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
mkdir "${{ runner.workspace }}/build"
Set-Location -Path "${{ runner.workspace }}\\build"
cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} -DHDF5_BUILD_FORTRAN=OFF -DLIBAEC_USE_LOCALCONTENT=OFF -DZLIB_USE_LOCALCONTENT=OFF ${{ github.workspace }}

# BUILD
- name: CMake Build
shell: pwsh
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
working-directory: ${{ runner.workspace }}/build

# RUN TESTS
- name: CMake Run Tests
shell: pwsh
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
CXX: ${{ steps.setup-fortran.outputs.cxx }}
run: |
source /opt/intel/oneapi/setvars.sh
export SYCL_DEVICE_FILTER=opencl.cpu
ctest . --parallel 2 -C ${{ inputs.build_mode }} -V
ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -E tfloatsattrs
working-directory: ${{ runner.workspace }}/build
34 changes: 34 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@
"ci-Java",
"ci-StdShar"
]
},
{
"name": "ci-StdShar-Intel",
"description": "Intel Standard Config for x64 (Release)",
"inherits": [
"ci-x64-Release-Intel",
"ci-CPP",
"ci-Java",
"ci-StdShar"
]
}
],
"buildPresets": [
Expand Down Expand Up @@ -187,6 +197,15 @@
"inherits": [
"ci-x64-Release-GNUC"
]
},
{
"name": "ci-StdShar-Intel",
"description": "Intel Standard Build for x64 (Release)",
"configurePreset": "ci-StdShar-Intel",
"verbose": true,
"inherits": [
"ci-x64-Release-Intel"
]
}
],
"testPresets": [
Expand Down Expand Up @@ -232,6 +251,11 @@
"name": "ci-StdShar-GNUC",
"configurePreset": "ci-StdShar-GNUC",
"inherits": "ci-x64-Release-GNUC"
},
{
"name": "ci-StdShar-Intel",
"configurePreset": "ci-StdShar-Intel",
"inherits": "ci-x64-Release-Intel"
}
],
"workflowPresets": [
Expand Down Expand Up @@ -261,6 +285,16 @@
{"type": "test", "name": "ci-StdShar-GNUC"},
{"type": "package", "name": "ci-StdShar-GNUC"}
]
},
{
"name": "ci-StdShar-Intel",
"steps": [
{"type": "configure", "name": "ci-StdShar-Intel"},
{"type": "build", "name": "ci-StdShar-Intel"},
{"type": "test", "name": "ci-StdShar-Intel"},
{"type": "package", "name": "ci-StdShar-Intel"}
]
}
}
]
}
Expand Down
80 changes: 75 additions & 5 deletions config/cmake-presets/hidden-presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,28 @@
"ci-GNUC"
]
},
{
"name": "ci-x64-Debug-Intel",
"description": "Intel for x64 (Debug)",
"hidden": true,
"inherits": [
"ci-base",
"ci-x64",
"ci-Debug",
"ci-Intel"
]
},
{
"name": "ci-x64-Release-Intel",
"description": "Intel for x64 (Release)",
"hidden": true,
"inherits": [
"ci-base",
"ci-x64",
"ci-Release",
"ci-Intel"
]
}
{
"name": "ci-x64-Debug-MSVC-asan",
"description": "x64-Debug-MSVC with /fsanitize=address",
Expand Down Expand Up @@ -265,15 +287,17 @@
"hidden": true,
"inherits": [
"ci-base"
]
],
"configuration": "Debug"
},
{
"name": "ci-x64-Release-MSVC",
"configurePreset": "ci-x64-Release-MSVC",
"hidden": true,
"inherits": [
"ci-base"
]
],
"configuration": "RelWithDebInfo"
},
{
"name": "ci-x64-Debug-Clang",
Expand Down Expand Up @@ -307,6 +331,24 @@
"ci-base"
]
},
{
"name": "ci-x64-Debug-Intel",
"configurePreset": "ci-x64-Debug-Intel",
"hidden": true,
"inherits": [
"ci-base"
],
"configuration": "Debug"
},
{
"name": "ci-x64-Release-Intel",
"configurePreset": "ci-x64-Release-Intel",
"hidden": true,
"inherits": [
"ci-base"
],
"configuration": "RelWithDebInfo"
}
{
"name": "ci-x64-Debug-MSVC-asan",
"configurePreset": "ci-x64-Debug-MSVC-asan",
Expand Down Expand Up @@ -370,15 +412,17 @@
"hidden": true,
"inherits": [
"ci-base"
]
],
"configuration": "Debug"
},
{
"name": "ci-x64-Release-MSVC",
"configurePreset": "ci-x64-Release-MSVC",
"hidden": true,
"inherits": [
"ci-base"
]
],
"configuration": "RelWithDebInfo"
},
{
"name": "ci-x64-Debug-Clang",
Expand Down Expand Up @@ -412,6 +456,22 @@
"ci-base"
]
},
{
"name": "ci-x64-Debug-Intel",
"configurePreset": "ci-x64-Debug-Intel",
"hidden": true,
"inherits": [
"ci-base"
]
},
{
"name": "ci-x64-Release-Intel",
"configurePreset": "ci-x64-Release-Intel",
"hidden": true,
"inherits": [
"ci-base"
],
}
{
"name": "ci-x64-Debug-MSVC-asan",
"configurePreset": "ci-x64-Debug-MSVC-asan",
Expand Down Expand Up @@ -467,7 +527,8 @@
"inherits": "ci-base",
"generators": [
"ZIP"
]
],
"configurations": ["Release"]
},
{
"name": "ci-x64-Release-Clang",
Expand All @@ -486,6 +547,15 @@
"generators": [
"TGZ"
]
},
{
"name": "ci-x64-Release-Intel",
"configurePreset": "ci-x64-Release-Intel",
"hidden": true,
"inherits": "ci-base",
"generators": [
"TGZ"
]
}
]
}
Expand Down
8 changes: 7 additions & 1 deletion fortran/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ if (WIN32)
if (NOT H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE)
set (H5_DBL_NOT_UNIQUE_EXP ";")
endif ()
set (CMAKE_NO_DEPRECATED_SYMBOLS 0)
if (NOT H5_NO_DEPRECATED_SYMBOLS)
set (H5_NO_DEPRECATED_SYMBOLS ";")
set (CMAKE_NO_DEPRECATED_SYMBOLS 1)
set (DLL_NO_DEPRECATED_SYMBOLS ";")
endif ()
configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY)
endif ()
Expand All @@ -25,8 +27,12 @@ endif ()

# Define Parallel variable for passing to H5config_f.inc.cmake
set (CMAKE_H5_HAVE_PARALLEL 0)
set (CMAKE_H5_HAVE_SUBFILING_VFD 0)
if (H5_HAVE_PARALLEL)
set (CMAKE_H5_HAVE_PARALLEL 1)
if (H5_HAVE_SUBFILING_VFD)
set (CMAKE_H5_HAVE_SUBFILING_VFD 1)
endif ()
endif ()

set (CMAKE_H5_HAVE_FLOAT128 0)
Expand Down
Loading
Loading