<commit_before>cmake_minimum_required(VERSION 3.0)
project(bench Fortran)

# https://software.intel.com/en-us/mkl-developer-reference-fortran-fortran-95-interface-conventions-for-blas-routines

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")


if(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel)

#    message(STATUS "be sure you have in your ~/.bashrc source compilervars.sh")
  list(APPEND FFLAGS -check all -fpe0 -warn -traceback -debug extended)
 #   set(FCOOPT -coarray)

elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU) # gfortran

    list(APPEND FLAGS -Wall -Werror=array-bounds -Wextra -Wpedantic)
    # -ffpe-trap=zero,overflow,underflow)

elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Flang)
  add_compile_options(-Mallocatable=03)
  link_libraries(-static-flang-libs)
endif()

add_compile_options(-O3 -g -mtune=native ${FLAGS})


add_subdirectory(pisum)
add_subdirectory(matmul)

add_executable(kind kind.f90)
target_compile_options(kind PUBLIC ${FFLAGS})

add_executable(hypot hypot.f90 perf.f90)
target_compile_options(hypot PUBLIC ${FFLAGS})
#-------------------------
enable_testing()

add_test(NAME kind COMMAND kind)
add_test(NAME hypot COMMAND hypot)
<commit_msg>cmake pgi<commit_after>cmake_minimum_required(VERSION 3.0)
project(bench Fortran)

# https://software.intel.com/en-us/mkl-developer-reference-fortran-fortran-95-interface-conventions-for-blas-routines

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/")


if(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel)

#    message(STATUS "be sure you have in your ~/.bashrc source compilervars.sh")
  list(APPEND FFLAGS -check all -fpe0 -warn -traceback -debug extended)

elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU) # gfortran

    add_compile_options(-mtune=native -Wall -Werror=array-bounds -Wextra -Wpedantic)
    # -ffpe-trap=zero,overflow,underflow)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL PGI)
  add_compile_options(-Mallocatable=03)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Flang) # cmake >= 3.10
  add_compile_options(-Mallocatable=03)
  link_libraries(-static-flang-libs)
endif()

add_compile_options(-O3 -g)


add_subdirectory(pisum)
add_subdirectory(matmul)

add_executable(kind kind.f90)
target_compile_options(kind PUBLIC ${FFLAGS})

add_executable(hypot hypot.f90 perf.f90)
target_compile_options(hypot PUBLIC ${FFLAGS})
#-------------------------
enable_testing()

add_test(NAME kind COMMAND kind)
add_test(NAME hypot COMMAND hypot)

{'fraction_non_alphanumeric': 0.1331168831168831, 'fraction_numerical': 0.013392857142857142, 'mean_word_length': 5.538461538461538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2169713', 'n_tokens_mistral': 980, 'n_tokens_neox': 905, 'n_words': 152}