Skip to content

Compilation errors with Intel compiler #123

@drtpotter

Description

@drtpotter

Hi there,

I'm trying to compile hipfort using the Intel compiler on the hipfort develop branch and getting a few issues. One of them I cannot get around.

These lines, starting at CMakeLists.txt:113, breaks the cmake configuration because the added flags -std=f2003 and -std=f2008 are not valid arguments on the Intel Fortran compiler. Therefore testing of command line arguments in a later step fails and cmake configuration halts with an error.

IF(CMAKE_Fortran_COMPILER_SUPPORTS_F08)
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${HIPFORT_COMPILER_FLAGS} -std=f2008")
ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F08)
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${HIPFORT_COMPILER_FLAGS} -std=f2003")

If I delete the -std flags in CMakeLists.txt and use the following cmake compile options, then I can get past the cmake configuration step.

# Intel compilation flags
FLAGS="-O2 -g -free -cpp -fPIC -fmax-errors=5 -assume nounderscore"
cmake -DCMAKE_INSTALL_PREFIX=/opt/hipfort_intel/5.7.1 -DHIPFORT_COMPILER=ifort -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_COMPILER="icx" -DCMAKE_C_FLAGS="-O2 -g" -DCMAKE_CXX_COMPILER="icpx" -DCMAKE_CXX_FLAGS="-O2 -g" -DCMAKE_Fortran_COMPILER="ifort" -DCMAKE_Fortran_FLAGS="${FLAGS}" -DHIPFORT_COMPILER_FLAGS="${FLAGS}" -DCMAKE_BUILD_TYPE=RELEASE ..

running make then fails at this point.

[  6%] Building Fortran object lib/CMakeFiles/hipfort-amdgcn.dir/hipfort/hipfort_hipmalloc.f.o
ifort: command line warning #10006: ignoring unknown option '-fno-underscoring'
ifort: command line remark #10148: option '-vec-report0' not supported
/netsoft/src/hipfort/lib/hipfort/hipfort_hipmalloc.f(1007): error #6911: The syntax of this substring is invalid.   [PTR]
        ptr(LBOUND(dsource,1):,LBOUND(dsource,2):) => tmp
--------^
compilation aborted for /netsoft/src/hipfort/lib/hipfort/hipfort_hipmalloc.f (code 1)
make[2]: *** [lib/CMakeFiles/hipfort-amdgcn.dir/build.make:231: lib/CMakeFiles/hipfort-amdgcn.dir/hipfort/hipfort_hipmalloc.f.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:144: lib/CMakeFiles/hipfort-amdgcn.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions