Skip to content
Merged
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
65 changes: 65 additions & 0 deletions .github/workflows/linux-llvmflang-cmake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: linux-llvmflang-cmake

on:
push:
branches:
- master
- main
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'

jobs:
linux-tests:
timeout-minutes: 20
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os }} - flang-new-${{ matrix.llvm_version }} - ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
llvm_version: 19
build_type: debug

- os: ubuntu-24.04
llvm_version: 20
build_type: debug

defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install LLVM Flang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.llvm_version }}
sudo apt-get install -y flang-${{ matrix.llvm_version }}

- name: Show version information
run: |
flang-new-${{ matrix.llvm_version }} --version
clang-${{ matrix.llvm_version }} --version

- name: Build with Cmake
run: |
mkdir build
cd build
FC=flang-new-${{ matrix.llvm_version }} CC=clang-${{ matrix.llvm_version }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
make VERBOSE=1

- name: Run ctests
run: |
cd build/test
ctest || ctest --rerun-failed --output-on-failure
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,24 @@ elseif( "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "IntelLLVM" )
set( CMAKE_C_FLAGS_COVERAGE "-g -O0")

elseif( "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Flang" )
# Classic Flang (PGI-derived)
set( CMAKE_Fortran_FLAGS "-Mpreprocess" )
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -O0 -g -Wall -pedantic" )
set( CMAKE_Fortran_FLAGS_COVERAGE "${CMAKE_Fortran_FLAGS_DEBUG}") # Code coverage not available with ifx
set( CMAKE_Fortran_FLAGS_COVERAGE "${CMAKE_Fortran_FLAGS_DEBUG}") # Code coverage not available
set( CMAKE_Fortran_FLAGS_PROFILE "-O3")
set( CMAKE_Fortran_FLAGS_RELEASE "-O3" )
set( CMAKE_C_FLAGS_COVERAGE "-g -O0")

elseif( "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "LLVMFlang" )
# LLVM Flang (flang-new, LLVM-based) - uses GCC-style flags
set( CMAKE_Fortran_FLAGS "-cpp" )
set( CMAKE_Fortran_FLAGS_DEBUG "-g -O0 -Wall -pedantic" )
set( CMAKE_Fortran_FLAGS_COVERAGE "${CMAKE_Fortran_FLAGS_DEBUG}") # Code coverage not available
set( CMAKE_Fortran_FLAGS_PROFILE "-O3")
set( CMAKE_Fortran_FLAGS_RELEASE "-O3" )
set( CMAKE_C_FLAGS_COVERAGE "-g -O0")

elseif( "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "NVHPC" )
elseif( "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "NVHPC" )
set( CMAKE_Fortran_FLAGS "-Mpreprocess" )
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -O0 -Wall -C -g -traceback" )
set( CMAKE_Fortran_FLAGS_COVERAGE "${CMAKE_Fortran_FLAGS_DEBUG}") # Code coverage not available with ifx
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Copyright 2020 Fluid Numerics LLC

[![linux-amdflang-cmake](https://github.com/FluidNumerics/feq-parse/actions/workflows/linux-amdflang-cmake.yaml/badge.svg)](https://github.com/FluidNumerics/feq-parse/actions/workflows/linux-amdflang-cmake.yaml)
[![linux-nvfortran-cmake](https://github.com/FluidNumerics/feq-parse/actions/workflows/linux-nvfortran-cmake.yaml/badge.svg)](https://github.com/FluidNumerics/feq-parse/actions/workflows/linux-nvfortran-cmake.yaml)
[![linux-llvmflang-cmake](https://github.com/FluidNumerics/feq-parse/actions/workflows/linux-llvmflang-cmake.yaml/badge.svg)](https://github.com/FluidNumerics/feq-parse/actions/workflows/linux-llvmflang-cmake.yaml)

[![windows-gnu-cmake](https://github.com/fluidnumerics/feq-parse/actions/workflows/windows-gnu-cmake.yml/badge.svg)](https://github.com/FluidNumerics/feq-parse/actions/workflows/windows-gnu-cmake.yml)
[![windows-gnu-fpm](https://github.com/fluidnumerics/feq-parse/actions/workflows/windows-gnu-fpm.yml/badge.svg)](https://github.com/FluidNumerics/feq-parse/actions/workflows/windows-gnu-fpm.yml)
Expand Down Expand Up @@ -134,6 +135,7 @@ GNU Fortran | 13.2.0 | Windows Server 2022 (10.0.20348 Build 1547) (MSYS2) | `fp
Intel oneAPI (`ifx`)| 2023.2 | Ubuntu 22.04.2 LTS | `fpm`, `cmake` | x86_64
Intel oneAPI classic (`ifort`) | 2021.1 | Ubuntu 22.04.2 LTS | `fpm`, `cmake` | x86_64
Nvidia HPC (`nvfortran`) | 23.11 | Ubuntu 22.04.2 LTS | `cmake` | x86_64
LLVM Flang (`flang-new`) | 19, 20 | Ubuntu 24.04 LTS | `cmake` | x86_64

## Usage

Expand Down
53 changes: 1 addition & 52 deletions src/FEQParse_Functions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module FEQParse_Functions

implicit none

integer,public :: nFunctions = 17
integer,public :: nFunctions = 16
integer,protected,public :: maxFunctionLength = 0
integer,parameter :: maxFunctions = 100
logical :: isInitialized = .false.
Expand All @@ -51,7 +51,6 @@ module FEQParse_Functions
enumerator :: asin_function = 14
enumerator :: atan_function = 15
enumerator :: sech_function = 16
enumerator :: rand_function = 17
endenum

private
Expand Down Expand Up @@ -104,18 +103,6 @@ pure real(real64) function f64(x)

type(FEQParse_Function),public :: Functions(maxFunctions)

interface
pure real(real32) function randomize_r32()
import
endfunction
endinterface

interface
pure real(real64) function randomize_r64()
import
endfunction
endinterface

interface AddFunction
module procedure :: AddFunction32
module procedure :: AddFunction64
Expand Down Expand Up @@ -268,10 +255,6 @@ subroutine InitializeFunctions()
Functions(sech_function)%ptr32 => sech32
Functions(sech_function)%ptr64 => sech64

Functions(rand_function) = Tuple("rand","RAND")
Functions(rand_function)%ptr32 => rand32
Functions(rand_function)%ptr64 => rand64

isInitialized = .true.
endsubroutine InitializeFunctions

Expand Down Expand Up @@ -473,24 +456,6 @@ pure real(real64) function sech64(x) result(fx)
fx = 2.0_real64/(exp(x)+exp(-x))
endfunction

pure real(real32) function rand32(x) result(fx)
real(real32),intent(in) :: x
!private
real(real32) :: r
associate(r => randomize_r32())
fx = r*x
endassociate
endfunction

pure real(real64) function rand64(x) result(fx)
real(real64),intent(in) :: x
!private
real(real64) :: r
associate(r => randomize_r64())
fx = r*x
endassociate
endfunction

pure function ToUpperCase(str) result(res)
character(*),intent(in) :: str
character(len(str)) :: res
Expand All @@ -507,19 +472,3 @@ pure function ToUpperCase(str) result(res)
endfunction ToUpperCase

endmodule FEQParse_Functions

real(real32) function randomize_r32()
use,intrinsic :: iso_fortran_env,only:real32
real(real32) :: r

call random_number(r)
randomize_r32 = r
endfunction

real(real64) function randomize_r64()
use,intrinsic :: iso_fortran_env,only:real64
real(real64) :: r

call random_number(r)
randomize_r64 = r
endfunction
10 changes: 0 additions & 10 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,6 @@ add_fortran_tests (
"monadic_r4fp64.f90"
"monadic_sfp32.f90"
"monadic_sfp64.f90"
"random_r1fp32.f90"
"random_r1fp64.f90"
"random_r2fp32.f90"
"random_r2fp64.f90"
"random_r3fp32.f90"
"random_r3fp64.f90"
"random_r4fp32.f90"
"random_r4fp64.f90"
"random_sfp32.f90"
"random_sfp64.f90"
"sech_r1fp32.f90"
"sech_r1fp64.f90"
"sech_r2fp32.f90"
Expand Down
72 changes: 0 additions & 72 deletions test/random_r1fp32.f90

This file was deleted.

72 changes: 0 additions & 72 deletions test/random_r1fp64.f90

This file was deleted.

Loading