From 0b90b4df86c1288eba3ad0b6c9c415d326f5f653 Mon Sep 17 00:00:00 2001 From: gregrodgers Date: Thu, 27 Aug 2020 17:29:10 -0500 Subject: [PATCH] correct FORTRAN_FLAGS options. For some reason hipfort_check was adding an unresolved ref to exit_ which should just be exit. So we add -fno_underscoring to the compilation of the libraries. Also, we moved the -ffree-line-length-none to the default value of HIPFORT_COMPILER_FLAGS which now is added to CMAKE_Fortran_FLAGS in the top level CMake. So no need to add this in lib/CMakeLists.txt --- CMakeLists.txt | 4 ++-- lib/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e1c34e5c..8a0ccd02f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) set(HIPFORT_COMPILER "/usr/bin/gfortran" CACHE STRING "Fortran Compiler to build HIPFORT") set(HIPFORT_AR "/usr/bin/gcc-ar" CACHE STRING "Static archive command") set(HIPFORT_RANLIB "/usr/bin/gcc-ranlib" CACHE STRING "ranlib used to create Static archive") -set(HIPFORT_COMPILER_FLAGS "-std=f2003 -ffree-form -cpp -ffree-line-length-512" CACHE STRING "Compiler flags to build HIPFORT") +set(HIPFORT_COMPILER_FLAGS "-std=f2003 -ffree-form -cpp -ffree-line-length-none" CACHE STRING "Compiler flags to build HIPFORT") set(HIPFORT_BUILD_TYPE "RELEASE" CACHE STRING "Set to RELEASE TESTING or DEBUG") # The ROCm release manager and other integrators should build hipfort as follows: @@ -54,7 +54,7 @@ ENDIF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90) #OPTION(USE_OPENMP "Use OpenMP for parallelization" OFF) # Allow long lines: -set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none") +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${HIPFORT_COMPILER_FLAGS}") # Set compile flags for DEBUG, # RELEASE, or TESTING. INCLUDE(${CMAKE_MODULE_PATH}/SetFortranFlags.cmake) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9157dabe9..5be5ca8b5 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,5 +1,5 @@ -set(CMAKE_Fortran_FLAGS "${HIPFORT_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS}") +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-underscoring") file(GLOB HIPFORT_SRC_HIP "${CMAKE_CURRENT_SOURCE_DIR}/hipfort/*.f*") #file(GLOB HIPFORT_SRC_amdgcn "${CMAKE_CURRENT_SOURCE_DIR}/modules-amdgcn/*.f*") #file(GLOB HIPFORT_SRC_nvptx "${CMAKE_CURRENT_SOURCE_DIR}/modules-nvptx/*.f*")