Skip to content

Commit

Permalink
Add ifort to ci tests
Browse files Browse the repository at this point in the history
* ifort, even though deprecated, should still be on our list of tested compilers for the time being
  • Loading branch information
fluidnumerics-joe committed Dec 6, 2023
1 parent 365ae6c commit 87392a5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
test:
timeout-minutes: 5
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os_name }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }} - ${{ github.event_name }}
name: ${{ matrix.os_name }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -72,6 +72,13 @@ jobs:
shell: bash
build_type: debug

- os: ubuntu-22.04
os_name: linux
fcompiler: ifort
ccompiler: icx-cc
shell: bash
build_type: debug

- os: ubuntu-22.04
os_name: linux
fcompiler: gfortran-9
Expand Down Expand Up @@ -106,6 +113,13 @@ jobs:
ccompiler: icx-cc
shell: bash
build_type: fpm

- os: ubuntu-22.04
os_name: linux
fcompiler: ifort
ccompiler: icx-cc
shell: bash
build_type: fpm


# Windows
Expand Down Expand Up @@ -137,7 +151,7 @@ jobs:
path: /opt/intel/oneapi
key: ${{ matrix.os }}-${{ matrix.fcompiler }}-${{ env.INTEL_ONEAPI_VERSION }}
- name: Install Intel oneAPI Fortran compiler
if: matrix.fcompiler == 'ifx' && steps.cache.outputs.cache-hit != 'true'
if: ${{ (matrix.fcompiler == 'ifx' || matrix.fcompiler == 'ifort') && steps.cache.outputs.cache-hit != 'true' }}
run: |
# download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
Expand All @@ -155,7 +169,7 @@ jobs:
env | grep oneapi >> $GITHUB_ENV
- name: Use existing Intel oneAPI Fortran compiler
if: matrix.fcompiler == 'ifx' && steps.cache.outputs.cache-hit == 'true'
if: ${{ (matrix.fcompiler == 'ifx' || matrix.fcompiler == 'ifort') && steps.cache.outputs.cache-hit != 'true' }}
run: |
# set environment variables and make them persistent across steps
. /opt/intel/oneapi/setvars.sh
Expand Down
26 changes: 14 additions & 12 deletions src/FEQParse.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ module FEQParse

function Construct_EquationParser(equation,indepVars) result(parser)
type(EquationParser) :: parser
character(*) :: equation
character(1) :: indepVars(1:)
character(*) :: equation
character(1) :: indepVars(1:)
! Local
integer :: i
character(Error_Message_Length) :: errorMsg
Expand All @@ -109,6 +109,7 @@ function Construct_EquationParser(equation,indepVars) result(parser)

parser % inFixFormula = " "
parser % equation = equation
parser % variableName = '#noname'
errorMsg = " "

call parser % CleanEquation(equationIsClean,errorMsg)
Expand Down Expand Up @@ -147,14 +148,14 @@ subroutine Destruct_EquationParser(parser)
end subroutine Destruct_EquationParser

subroutine CleanEquation(parser,equationCleaned,errorMsg)
class(EquationParser),intent(inout) :: parser
class(EquationParser),intent(inout) :: parser
logical,intent(out) :: equationCleaned
character(Error_Message_Length),intent(out) :: errorMsg
! Local
integer :: nChar,equalSignLoc,j,i
character(Max_Equation_Length) :: infixformula

equationCleaned = .false.
parser % variableName = '#noname'

nChar = len_trim(parser % equation)
equalSignLoc = index(parser % equation,"=")
Expand All @@ -164,23 +165,24 @@ subroutine CleanEquation(parser,equationCleaned,errorMsg)
return
end if

parser % variableName = trim(parser % equation(1:equalSignLoc - 1))
parser % variableName = parser % equation(1:equalSignLoc - 1)
! print*, "variable : "//parser % variableName

! Grab the formula to the right of the equal sign and left adjust the formula
parser % inFixFormula = parser % equation(equalSignLoc + 1:)
parser % inFixFormula = adjustl(parser % inFixFormula)

inFixFormula = parser % equation(equalSignLoc + 1:Max_Equation_Length)
! print*, "infix : "//inFixFormula
! print*, "len_trim(infix) : ", len_trim(inFixFormula)
! Remove any spaces
j = 1
do i = 1,len_trim(parser % inFixFormula)
if (parser % inFixFormula(i:i) /= " ") then
parser % inFixFormula(j:j) = parser % inFixFormula(i:i)
do i = 1,len_trim(inFixFormula)
if (inFixFormula(i:i) /= " ") then
parser % inFixFormula(j:j) = inFixFormula(i:i)
j = j + 1
end if
end do

parser % inFixFormula(j:Max_Equation_Length) = " "

! print*, "parser % infixformula : ", parser % infixformula
equationCleaned = .true.

end subroutine CleanEquation
Expand Down

0 comments on commit 87392a5

Please sign in to comment.