Skip to content

Commit

Permalink
Revert to CMAKE_C_COMPILER in preprocessing invocation to address CLA…
Browse files Browse the repository at this point in the history
…NG existence under gcc, split ectrans module from submodules for more flexible compilation
  • Loading branch information
piotrows committed Nov 13, 2023
1 parent 8c602b2 commit 1b11f84
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ecbuild_add_option( FEATURE FFTW
REQUIRED_PACKAGES "FFTW COMPONENTS double ${single}" )

ecbuild_add_option( FEATURE TRANSI
DEFAULT ON
DEFAULT ON
DESCRIPTION "Compile TransI C-interface to trans"
CONDITION HAVE_DOUBLE_PRECISION )

Expand Down
2 changes: 1 addition & 1 deletion src/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ecbuild_list_add_pattern( LIST driver_src
QUIET
)
set(CMAKE_Fortran_PREPROCESS_SOURCE
"gcc -cpp <DEFINES> <INCLUDES> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
"<CMAKE_C_COMPILER> -cpp <DEFINES> <INCLUDES> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
foreach( prec sp dp )
if( HAVE_${prec} )
if( ${prec} MATCHES "sp" )
Expand Down
3 changes: 1 addition & 2 deletions src/trans/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ ecbuild_list_add_pattern( LIST trans_src
if( NOT HAVE_FFTW )
ecbuild_list_exclude_pattern( LIST trans_src REGEX tpm_fftw.F90 )
endif()

set(CMAKE_Fortran_PREPROCESS_SOURCE
"gcc -cpp <DEFINES> <INCLUDES> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
"<CMAKE_C_COMPILER> -cpp <DEFINES> <INCLUDES> -E <SOURCE> -o <PREPROCESSED_SOURCE>")

foreach( prec dp sp )
if( HAVE_${prec} )
Expand Down
6 changes: 6 additions & 0 deletions src/trans/module/dir_trans_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "renames.inc"
#define INMODULE
submodule (ectrans_mod) dir_trans_mod
contains
#include "dir_trans.F90"
end submodule dir_trans_mod
25 changes: 0 additions & 25 deletions src/trans/module/ectrans_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,3 @@ module ectrans_mod
#include "specnorm.h"
contains
end module ectrans_mod
submodule (ectrans_mod) setup_trans0_mod
contains
#include "setup_trans0.F90"
end submodule setup_trans0_mod
submodule (ectrans_mod) setup_trans_mod
contains
#include "setup_trans.F90"
end submodule setup_trans_mod
submodule (ectrans_mod) inv_trans_mod
contains
#include "inv_trans.F90"
end submodule inv_trans_mod
submodule (ectrans_mod) dir_trans_mod
contains
#include "dir_trans.F90"
end submodule dir_trans_mod
submodule (ectrans_mod) trans_inq__mod
contains
#include "trans_inq.F90"
end submodule trans_inq__mod
submodule (ectrans_mod) specnorm_mod
contains
#include "specnorm.F90"
end submodule specnorm_mod

6 changes: 6 additions & 0 deletions src/trans/module/inv_trans_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "renames.inc"
#define INMODULE
submodule (ectrans_mod) inv_trans_mod
contains
#include "inv_trans.F90"
end submodule inv_trans_mod
6 changes: 6 additions & 0 deletions src/trans/module/setup_trans0_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "renames.inc"
#define INMODULE
submodule (ectrans_mod) setup_trans0_mod
contains
#include "setup_trans0.F90"
end submodule setup_trans0_mod
6 changes: 6 additions & 0 deletions src/trans/module/setup_trans_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "renames.inc"
#define INMODULE
submodule (ectrans_mod) setup_trans_mod
contains
#include "setup_trans.F90"
end submodule setup_trans_mod
7 changes: 7 additions & 0 deletions src/trans/module/specnorm_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "renames.inc"
#define INMODULE
submodule (ectrans_mod) specnorm_mod
contains
#include "specnorm.F90"
end submodule specnorm_mod

7 changes: 7 additions & 0 deletions src/trans/module/trans_inq_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "renames.inc"
#define INMODULE
submodule (ectrans_mod) trans_inq_mod
contains
#include "trans_inq.F90"
end submodule trans_inq_mod

0 comments on commit 1b11f84

Please sign in to comment.