Skip to content

Commit

Permalink
oneAPI from setup-fortran; HDF5 download+CMake; remove `standard-sema…
Browse files Browse the repository at this point in the history
…ntics` flags
  • Loading branch information
perazz committed Jun 24, 2024
1 parent dcac4bb commit be78522
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 32 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,18 @@ jobs:
- name: (Ubuntu) finalize oneAPI environment
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
run: |
# To run HDF5 with oneAPI, we need to build it from source
# Install MPI
sudo apt-get install -y -q intel-oneapi-mpi-devel ninja-build cmake
source /opt/intel/oneapi/setvars.sh --force
printenv >> $GITHUB_ENV
# To run HDF5 with oneAPI, we need to build it from source. Use CMake to generate pkg-config info
curl -O -L https://github.com/HDFGroup/hdf5/archive/refs/tags/snapshot-1.14.tar.gz
tar zxf snapshot-1.14.tar.gz
cd hdf5-snapshot-1.14
sh ./autogen.sh
sh ./configure --prefix=/tmp CC="$(which icx)" FC="$(which ifx)" --enable-build-mode=production --enable-fortran
cmake -B build -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DHDF5_BUILD_FORTRAN=ON -DCMAKE_INSTALL_PREFIX=/usr
cd build
make -j
make check -j
sudo make install
- name: (Windows) Put MSYS2_MinGW64 on PATH
if: contains(matrix.os,'windows') && (!contains(matrix.mpi,'intel'))
Expand Down Expand Up @@ -224,8 +228,8 @@ jobs:
mv $(which fpm) fpm-bootstrap${{ matrix.exe }}
echo "BOOTSTRAP=$PWD/fpm-bootstrap" >> $GITHUB_ENV
- name: (macOS) Use gcc/g++ instead of Clang for C/C++
if: contains(matrix.os,'macOS')
- name: (macOS/Ubuntu) Use gcc/g++ instead of Clang for C/C++ / ifx to build fpm
if: contains(matrix.os,'macOS') || contains(matrix.os,'ubuntu')
shell: bash
run: |
echo "FPM_FC=gfortran-${{ env.GCC_V }}" >> $GITHUB_ENV
Expand Down
18 changes: 9 additions & 9 deletions src/fpm/manifest/profiles.f90
Original file line number Diff line number Diff line change
Expand Up @@ -749,25 +749,25 @@ function get_default_profiles(error) result(default_profiles)
& 'ifort', &
& OS_ALL, &
& flags = ' -fp-model precise -pc64 -align all -error-limit 1 -reentrancy&
& threaded -nogen-interfaces -assume byterecl -standard-semantics', &
& threaded -nogen-interfaces -assume byterecl', &
& is_built_in=.true.), &
& new_profile('release', &
& 'ifort', &
& OS_WINDOWS, &
& flags = ' /fp:precise /align:all /error-limit:1 /reentrancy:threaded&
& /nogen-interfaces /assume:byterecl /standard-semantics', &
& /nogen-interfaces /assume:byterecl', &
& is_built_in=.true.), &
& new_profile('release', &
& 'ifx', &
& OS_ALL, &
& flags = ' -fp-model=precise -pc64 -align all -error-limit 1 -reentrancy&
& threaded -nogen-interfaces -assume byterecl -standard-semantics', &
& threaded -nogen-interfaces -assume byterecl', &
& is_built_in=.true.), &
& new_profile('release', &
& 'ifx', &
& OS_WINDOWS, &
& flags = ' /fp:precise /align:all /error-limit:1 /reentrancy:threaded&
& /nogen-interfaces /assume:byterecl /standard-semantics', &
& /nogen-interfaces /assume:byterecl', &
& is_built_in=.true.), &
& new_profile('release', &
&'nagfor', &
Expand Down Expand Up @@ -805,28 +805,28 @@ function get_default_profiles(error) result(default_profiles)
& new_profile('debug', &
& 'ifort', &
& OS_ALL, &
& flags = ' -warn all -check all -error-limit 1 -O0 -g -assume byterecl -standard-semantics -traceback', &
& flags = ' -warn all -check all -error-limit 1 -O0 -g -assume byterecl -traceback', &
& is_built_in=.true.), &
& new_profile('debug', &
& 'ifort', &
& OS_WINDOWS, &
& flags = ' /warn:all /check:all /error-limit:1&
& /Od /Z7 /assume:byterecl /standard-semantics /traceback', &
& /Od /Z7 /assume:byterecl /traceback', &
& is_built_in=.true.), &
& new_profile('debug', &
& 'ifx', &
& OS_ALL, &
& flags = ' -warn all -check all -error-limit 1 -O0 -g -assume byterecl -standard-semantics -traceback', &
& flags = ' -warn all -check all -error-limit 1 -O0 -g -assume byterecl -traceback', &
& is_built_in=.true.), &
& new_profile('debug', &
& 'ifx', &
& OS_WINDOWS, &
& flags = ' /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl /standard-semantics', &
& flags = ' /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl', &
& is_built_in=.true.), &
& new_profile('debug', &
& 'ifx', &
& OS_WINDOWS, &
& flags = ' /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl /standard-semantics', &
& flags = ' /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl', &
& is_built_in=.true.), &
& new_profile('debug', &
& 'lfortran', &
Expand Down
22 changes: 6 additions & 16 deletions src/fpm_compiler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ subroutine get_release_compile_flags(id, flags)
flag_intel_limit//&
flag_intel_pthread//&
flag_intel_nogen//&
flag_intel_byterecl//&
flag_intel_standard_compliance
flag_intel_byterecl

case(id_intel_classic_mac)
flags = &
Expand All @@ -320,8 +319,7 @@ subroutine get_release_compile_flags(id, flags)
flag_intel_limit//&
flag_intel_pthread//&
flag_intel_nogen//&
flag_intel_byterecl//&
flag_intel_standard_compliance
flag_intel_byterecl

case(id_intel_classic_windows)
flags = &
Expand All @@ -331,8 +329,7 @@ subroutine get_release_compile_flags(id, flags)
flag_intel_limit_win//&
flag_intel_pthread_win//&
flag_intel_nogen_win//&
flag_intel_byterecl_win//&
flag_intel_standard_compliance_win
flag_intel_byterecl_win

case(id_intel_llvm_nix)
flags = &
Expand All @@ -342,8 +339,7 @@ subroutine get_release_compile_flags(id, flags)
flag_intel_limit//&
flag_intel_pthread//&
flag_intel_nogen//&
flag_intel_byterecl//&
flag_intel_standard_compliance
flag_intel_byterecl

case(id_intel_llvm_windows)
flags = &
Expand All @@ -353,8 +349,7 @@ subroutine get_release_compile_flags(id, flags)
flag_intel_limit_win//&
flag_intel_pthread_win//&
flag_intel_nogen_win//&
flag_intel_byterecl_win//&
flag_intel_standard_compliance_win
flag_intel_byterecl_win

case(id_nag)
flags = &
Expand Down Expand Up @@ -418,7 +413,6 @@ subroutine get_debug_compile_flags(id, flags)
flag_intel_limit//&
flag_intel_debug//&
flag_intel_byterecl//&
flag_intel_standard_compliance//&
flag_intel_backtrace

case(id_intel_classic_mac)
Expand All @@ -428,7 +422,6 @@ subroutine get_debug_compile_flags(id, flags)
flag_intel_limit//&
flag_intel_debug//&
flag_intel_byterecl//&
flag_intel_standard_compliance//&
flag_intel_backtrace
case(id_intel_classic_windows)
flags = &
Expand All @@ -437,7 +430,6 @@ subroutine get_debug_compile_flags(id, flags)
flag_intel_limit_win//&
flag_intel_debug_win//&
flag_intel_byterecl_win//&
flag_intel_standard_compliance_win//&
flag_intel_backtrace_win
case(id_intel_llvm_nix)
flags = &
Expand All @@ -446,16 +438,14 @@ subroutine get_debug_compile_flags(id, flags)
flag_intel_limit//&
flag_intel_debug//&
flag_intel_byterecl//&
flag_intel_standard_compliance//&
flag_intel_backtrace
case(id_intel_llvm_windows)
flags = &
flag_intel_warn_win//&
flag_intel_check_win//&
flag_intel_limit_win//&
flag_intel_debug_win//&
flag_intel_byterecl_win//&
flag_intel_standard_compliance_win
flag_intel_byterecl_win
case(id_nag)
flags = &
flag_nag_debug//&
Expand Down
2 changes: 1 addition & 1 deletion test/fpm_test/test_manifest.f90
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ subroutine test_profiles(error)
compiler = 'ifort'
call find_profile(package%profiles, profile_name, compiler, 3, profile_found, chosen_profile)
if (.not.(chosen_profile%flags.eq.&
' /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl /standard-semantics /traceback')) then
' /warn:all /check:all /error-limit:1 /Od /Z7 /assume:byterecl /traceback')) then
call test_failed(error, "Failed to load built-in profile "//profile_name)
return
end if
Expand Down

0 comments on commit be78522

Please sign in to comment.