-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes workflow file add pull request to register workflow add missed subroutine interface c__pdafomi_localize_covar_noniso work out build process and CI for Linux and Mac; cleaned compile pyPDAF on windows; hopefully improved stability using intel-fortran-rt and mpi when new conda version is published; cannot workout a windows build CI as it seems very difficult to set up Intel Fortran with Visual studio in github runner but it is useful to keep the compiler environment variable options.
- Loading branch information
Showing
27 changed files
with
779 additions
and
218 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: test_linux_build | ||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
test_ubuntu_build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
ref: upgrade2.2.1 | ||
|
||
- name: installing dependent libraries | ||
run: sudo apt install -y liblapack-dev libblas-dev libopenmpi-dev | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v5 | ||
|
||
- name: install pyPDAF | ||
run: pip install -v . | ||
|
||
- name: run example | ||
run: mpiexec --oversubscribe -n 4 python -u example/main.py | ||
|
||
- name: Setup tmate session | ||
if: ${{ failure() }} | ||
uses: mxschmitt/action-tmate@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: test_mac_build | ||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
test_mac_build: | ||
runs-on: macos-latest | ||
steps: | ||
- name: check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
ref: upgrade2.2.1 | ||
|
||
- name: Setup Fortran compiler | ||
uses: fortran-lang/[email protected] | ||
id: setup-fortran | ||
with: | ||
compiler: gcc | ||
version: 13 | ||
|
||
- name: install dependent Libaries | ||
run: brew install openblas lapack open-mpi | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v5 | ||
|
||
- name: install pyPDAF | ||
run: | | ||
mv setup_mac.cfg setup.cfg | ||
pip install -v . | ||
- name: run example | ||
run: | | ||
mv example/config_mac.py example/config.py | ||
mv example/config_obsA_mac.py example/config_obsA.py | ||
mpiexec --oversubscribe -n 4 python -u example/main.py | ||
- name: Setup tmate session | ||
if: ${{ failure() }} | ||
uses: mxschmitt/action-tmate@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: test_win_build | ||
on: [workflow_dispatch] | ||
|
||
env: | ||
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/e83a8e64-04fc-45df-85c6-c2208d03bdb5/w_BaseKit_p_2024.2.0.635_offline.exe | ||
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0d500705-397e-41b3-8b2b-2a3da1753fc2/w_HPCKit_p_2024.2.0.633_offline.exe | ||
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler | ||
WINDOWS_DPCPP_COMPONENTS: intel.oneapi.win.mkl.devel:intel.oneapi.win.tbb.devel | ||
CACHE_NUMBER: 5 | ||
COMPILER_VERSION: 2024.2.0 | ||
TBB_VERSION: 2021.13.0 | ||
VS_VER: vs2022 | ||
|
||
jobs: | ||
test_windows_build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: check out oneAPI code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: oneapi-src/oneapi-ci | ||
|
||
- name: cache install fortran | ||
id: cache-install-fortran | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat | ||
C:\Program Files (x86)\Intel\oneAPI\compiler | ||
key: install-${{ env.CACHE_NUMBER }}-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/scripts/cache_exclude_windows.sh') }} | ||
|
||
- name: install fortran | ||
if: steps.cache-install.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS | ||
|
||
- name: cache install mkl | ||
id: cache-install-mkl | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat | ||
C:\Program Files (x86)\Intel\oneAPI\compiler | ||
C:\Program Files (x86)\Intel\oneAPI\tbb | ||
C:\Windows\System32\OpenCL.dll | ||
key: install-${{ env.CACHE_NUMBER }}-${{ env.WINDOWS_BASEKIT_URL }}-${{ env.WINDOWS_DPCPP_COMPONENTS }}-compiler-tbb-opencl-${{ hashFiles('**/scripts/cache_exclude_windows.sh') }} | ||
|
||
- name: install mkl | ||
if: steps.cache-install.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: scripts/install_windows.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_COMPONENTS | ||
|
||
- name: restore registry on cache hit | ||
if: steps.cache-install.outputs.cache-hit == 'true' | ||
shell: bash | ||
run: scripts/restore_registry.bat $COMPILER_VERSION $TBB_VERSION | ||
|
||
- name: check out pyPDAF code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
ref: upgrade2.2.1 | ||
|
||
- name: install pyPDAF | ||
run: | | ||
cmd.exe /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" | ||
cmd.exe /k "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" | ||
cmd.exe /k '"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\env\vars.bat" && powershell' | ||
cd D:\a\pyPDAF\pyPDAF | ||
Move-Item -Path setup_win.cfg -Destination setup.cfg -Force | ||
pip install -v . | ||
- name: run example | ||
run: | | ||
Move-Item -Path example/config_win.py -Destination example/config.py -Force | ||
Move-Item -Path example/config_obsA_win.py -Destination example/config_obsA.py -Force | ||
mpiexec --oversubscribe -n 4 python -u example/main.py | ||
- name: Setup tmate session | ||
if: ${{ failure() }} | ||
uses: mxschmitt/action-tmate@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Set the PDAF library name, it can be pdaf-var or pdaf-d | ||
set(PDAF_NAME "pdaf-var") | ||
|
||
# Set preprocessor and linker for current system | ||
# AR is used to generate static libraries | ||
set(CMAKE_AR "ar" CACHE FILEPATH "Archiver") | ||
# RANKLIB is used to deal with static libraries | ||
set(CMAKE_RANLIB "ranlib" CACHE FILEPATH "Ranlib") | ||
# Here a linker is specified it can be the compiler used | ||
set(CMAKE_LINKER "mpif90" CACHE FILEPATH "Linker") | ||
# CPP is the C preprocessor | ||
set(CMAKE_CPP "cpp" CACHE FILEPATH "C Preprocessor") | ||
|
||
# set compiler executable | ||
set(CMAKE_Fortran_COMPILER "mpif90") | ||
# Set compiler flags for Release/Production configurations | ||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -ffree-line-length-none -fdefault-real-8 -fPIC -mmacosx-version-min=11.0") | ||
# Set compiler flags for Debug configurations | ||
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -Wall -Wextra -g -pedantic -fcheck=all -fbacktrace -ffree-line-length-none -fdefault-real-8 -fPIC") | ||
|
||
# set MPI library information | ||
set(MPI_Fortran_INCLUDE_PATH | ||
"" | ||
CACHE STRING "path to the include directory of MPI_Fortran") | ||
set(MPI_Fortran_MODULE_DIR | ||
"" | ||
CACHE STRING "path to the module directory of MPI_Fortran") | ||
|
||
# Check if the build type is not explicitly set and default to Release | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Set the PDAF library name, it can be pdaf-var or pdaf-d | ||
set(PDAF_NAME "pdaf-var") | ||
|
||
# set MPI library information | ||
set(MPI_NAME "msmpi;msmpifec") | ||
set(MPI_Fortran_INCLUDE_PATH | ||
"C:/Program Files (x86)/Microsoft SDKs/MPI/Include" | ||
CACHE STRING "path to the MPI Fortran mpi.h include directory") | ||
set(MPI_Fortran_MODULE_INCLUDE_PATH | ||
"C:/Program Files (x86)/Microsoft SDKs/MPI/Include/x64" | ||
CACHE STRING "path to the include directory to compile MPI Fortran module") | ||
set(MPI_Fortran_MODULE_DIR | ||
"C:/Users/cymji/Desktop/pyPDAF/PDAF_V2.2.1/mpi_include" | ||
CACHE STRING "path to the installed module directory of MPI_Fortran") | ||
# We have to compile MPI-MPI mod file ourselves in Windows | ||
set(MPI_Fortran_MODULE_SRC_FILE "C:/Program Files (x86)/Microsoft SDKs/MPI/Include/mpi.f90" | ||
CACHE STRING "path to the MPI Fortran module source file" ) | ||
# We have to compile MPI-MPI mod file ourselves in Windows | ||
set(MPI_Fortran_LINK_DIR "C:/Program Files (x86)/Microsoft SDKs/MPI/Lib/x64" | ||
CACHE STRING "path to the MPI Fortran libraries" ) | ||
# This overrides any language flags and must be given before add_library | ||
set_source_files_properties(${MPI_Fortran_MODULE_SRC_FILE} PROPERTIES COMPILE_FLAGS "/O2 /Qdiag-disable:10448 /Qdiag-disable:10423") | ||
|
||
# ideally, we should provide compiler options based on target or source files, | ||
# but this will force us to use multiple config files or encode it in the CMakelist.txt file | ||
set(CMAKE_Fortran_FLAGS_RELEASE "/O2 /4R8 /Qdiag-disable:10448 /Qdiag-disable:10423" CACHE STRING "RELEASE FLAGS" FORCE) | ||
# Set compiler flags for Debug configurations | ||
set(CMAKE_Fortran_FLAGS_DEBUG "/Od /debug:full /traceback /check:all /Qtrapuv /4R8 /Qdiag-disable:10448 /Qdiag-disable:10423" CACHE STRING "DEBUG FLAGS" FORCE) | ||
|
||
# set BLAS information | ||
set(BLAS_NAME "mkl_core;mkl_intel_lp64;mkl_sequential") | ||
set(BLAS_INCLUDE_PATH "") | ||
set(BLAS_LIB_PATH "C:/Program Files (x86)/Intel/oneAPI/mkl/2024.2/lib") |
Oops, something went wrong.