Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to set CMAKE_Fortran_FLAGS while configuring ccmake #44

Open
vvedula22 opened this issue Aug 9, 2021 · 1 comment
Open

Option to set CMAKE_Fortran_FLAGS while configuring ccmake #44

vvedula22 opened this issue Aug 9, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vvedula22
Copy link
Contributor

CMAKE_Fortran_FLAGS are reinitialized and hardcoded in svFSI/CMakeLists.txt and svFSILS/CMakeLists.txt.

When compiling using AOCC/Intel compilers, or when debugging, users have to edit these files to set appropriate FFLAGS such as,

if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
  # set(CMAKE_Fortran_FLAGS "-O3 -DNDEBUG -march=native")
  # set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -pthread -std=legacy")

  # Use below flags for debugging
  set(CMAKE_Fortran_FLAGS "-O0")
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -pthread -std=legacy")
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -Wall -Wconversion -Wline-truncation -pedantic -fimplicit-none -fbacktrace -fbounds-check -p -fcheck=all -ffpe-trap=invalid,zero,overflow,underflow")

elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
  set(CMAKE_Fortran_FLAGS "-O3 -DNDEBUG -march=core-avx2")
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp ")

elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Flang")
  set(CMAKE_Fortran_FLAGS "-O3 -DNDEBUG -march=znver2")
  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mpreprocess -Mallocatable=03 ")

else()
  # nothing for now
  # may need to set for intel compiler or others
endif()

It would be useful to allow users to set CMAKE_Fortran_FLAGS during the configuration step in ccmake.

@ktbolt : could you take a look at this issue?

@vvedula22 vvedula22 added the enhancement New feature or request label Aug 9, 2021
@ktbolt
Copy link
Contributor

ktbolt commented Aug 9, 2021

I've also run into this problem, will have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants