diff --git a/meson.build b/meson.build index e3914e3..a6e7958 100644 --- a/meson.build +++ b/meson.build @@ -11,18 +11,10 @@ project( sources = [] subdir('src') -# Intel compiler (as of 2024.0.2) crashes when building the library with optimization turned on. -if meson.get_compiler('fortran').get_id() == 'intel-llvm' - fortran_args = ['-O0'] -else - fortran_args = [] -endif - fortuno_lib = library( meson.project_name(), sources: sources, version: meson.project_version(), - fortran_args: fortran_args ) fortuno_dep = declare_dependency( diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84883cb..735cdf1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,11 +22,6 @@ target_include_directories( $ ) -# ifx (as of version 2024.0.2) crashes when optimization is turned on -if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM") - target_compile_options(Fortuno PRIVATE "-O0") -endif () - if (FORTUNO_INSTALL) install( TARGETS Fortuno diff --git a/src/fortuno/testcontext.f90 b/src/fortuno/testcontext.f90 index 7b658d1..d2f482e 100644 --- a/src/fortuno/testcontext.f90 +++ b/src/fortuno/testcontext.f90 @@ -129,9 +129,23 @@ subroutine test_context_register_check(this, checkfailed, msg, file, line) allocate(failureinfo) call this%create_failure_location(failureinfo%location, file, line) if (present(msg)) failureinfo%message = msg - if (allocated(this%failureinfo_)) call move_alloc(this%failureinfo_, failureinfo%previous) + ! Workaround:ifx:2024.0 + ! ifx crashes during compilation with optimization on the move_alloc statement. + ! if (allocated(this%failureinfo_)) call move_alloc(this%failureinfo_, failureinfo%previous) + if (allocated(this%failureinfo_)) call my_move_alloc(this%failureinfo_, failureinfo%previous) call move_alloc(failureinfo, this%failureinfo_) + contains + + ! Workaround move_alloc function. + subroutine my_move_alloc(src, trg) + type(failure_info), allocatable, intent(inout) :: src + type(failure_info), allocatable, intent(out) :: trg + + call move_alloc(src, trg) + + end subroutine my_move_alloc + end subroutine test_context_register_check