Skip to content

Commit

Permalink
Remove gblevents.f and cleanup build (#74)
Browse files Browse the repository at this point in the history
Remove gblevents.f and cleanup build

gblevents created a circular dependency with nemsio and was moved to UFS_UTILS.

With gblevents removed w3emc no longer contains dependencies  on other libraries.

mova2i.c was deleted and a C binding added to mova2i.f.
Now the library has no C functions and associated flags removed from the build.
  • Loading branch information
kgerheiser authored Jun 21, 2021
1 parent 17fe85e commit 1bf6236
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 4,114 deletions.
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ file(STRINGS "VERSION" pVersion)
project(
w3emc
VERSION ${pVersion}
LANGUAGES C Fortran)
LANGUAGES Fortran)

# Handle user options.
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
Expand All @@ -24,12 +24,6 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

# Find required packages.
find_package(nemsio 2.5.0 CONFIG REQUIRED)
find_package(sigio 2.3.0 CONFIG REQUIRED)

find_package(NetCDF 4.3.3 REQUIRED Fortran)

# Compile the source code in the src directory.
add_subdirectory(src)

Expand Down
347 changes: 0 additions & 347 deletions cmake/FindNetCDF.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions cmake/PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
include(CMakeFindDependencyMacro)

find_dependency(nemsio CONFIG)
find_dependency(sigio CONFIG)
find_dependency(NetCDF COMPONENTS Fortran)

# Get the build type from real32 library target
get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@_4 IMPORTED_CONFIGURATIONS)

Expand Down
21 changes: 0 additions & 21 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
include("list_of_files.cmake")

if(APPLE)
add_compile_definitions(APPLE)
elseif(UNIX)
add_compile_definitions(LINUX)
endif()

if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3")
elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_C_FLAGS "-ggdb ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3")
endif()

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "-g -traceback -fixed ${CMAKE_Fortran_FLAGS}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O2")
Expand All @@ -31,7 +17,6 @@ endif()
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "^(GNU)$" AND ${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -fallow-argument-mismatch -fallow-invalid-boz")
endif()
set_source_files_properties(${c_src} PROPERTIES COMPILE_OPTIONS "${c_flags}")

set(kinds "4" "8" "d")
foreach(kind ${kinds})
Expand All @@ -45,16 +30,10 @@ foreach(kind ${kinds})
"${fortran_${kind}_flags}")
set_target_properties(${lib_name} PROPERTIES Fortran_MODULE_DIRECTORY
${module_dir})
add_library(${lib_name}_c OBJECT ${c_src})

# add_library(${lib_name} STATIC $<TARGET_OBJECTS:${lib_name}_f>
# $<TARGET_OBJECTS:${lib_name}_c>)

target_include_directories(${lib_name} INTERFACE
$<BUILD_INTERFACE:${module_dir}>
$<INSTALL_INTERFACE:include_${kind}>)
target_link_libraries(${lib_name} PRIVATE nemsio::nemsio sigio::sigio
NetCDF::NetCDF_Fortran)
list(APPEND LIB_TARGETS ${lib_name})

install(DIRECTORY ${module_dir} DESTINATION ${CMAKE_INSTALL_PREFIX})
Expand Down
3,662 changes: 0 additions & 3,662 deletions src/gblevents.f

This file was deleted.

4 changes: 0 additions & 4 deletions src/list_of_files.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(fortran_src
${CMAKE_CURRENT_SOURCE_DIR}/args_mod.f
${CMAKE_CURRENT_SOURCE_DIR}/gblevents.f
${CMAKE_CURRENT_SOURCE_DIR}/getgbens.f
${CMAKE_CURRENT_SOURCE_DIR}/isrchne.f
${CMAKE_CURRENT_SOURCE_DIR}/iw3mat.f
Expand Down Expand Up @@ -213,6 +212,3 @@ set(fortran_src
${CMAKE_CURRENT_SOURCE_DIR}/xstore.f
)

set(c_src
${CMAKE_CURRENT_SOURCE_DIR}/mova2i.c
)
68 changes: 0 additions & 68 deletions src/mova2i.c

This file was deleted.

2 changes: 1 addition & 1 deletion src/mova2i.f
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
C> LANGUAGE: IBM XL FORTRAN
C> MACHINE: IBM SP
C>
Integer Function mova2i(a)
Integer Function mova2i(a)
C
integer mold
character(len=1) a
Expand Down

0 comments on commit 1bf6236

Please sign in to comment.