-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes to case of VTK identifiers (#63)
* WIP: Travis CI updates * WIP: updates * Revert gfortran-9 to 8 w/ linux bionic * Fix line cnt * Remove redundant submodule use statements * Re-use gcc-9 w/ linux TRAVIS-CI * README updates * WIP: cmake updates for MSVS, platform abstraction * Capitalization fix * Added ability to specify encoding * case fixes to legacy vtk writes * Modern VTK case fixes * travis-ci fix for updated cmake
- Loading branch information
Showing
22 changed files
with
342 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Functions to abstract common tasks for creating and manipulating targets & tests | ||
include_guard(DIRECTORY) # Check to see if the file has previously been processed | ||
# Create a function to generate libraries from lists of source files | ||
# given relative to the current CMakeLists.txt | ||
# | ||
# Mandatory arguments: | ||
# | ||
# Positional argument 1: lib_name | ||
# Name of library to create (without leading "lib") | ||
# Keyword Argument SOURCES: | ||
# A list of source files relative to ${CMAKE_CURRENT_SOURCE_DIR} to compile | ||
# | ||
# Optional keyword arguments: | ||
# LINKAGE: Allowed values are STATIC, SHARED, MODULE. Not passing a value | ||
# defaults to CMake's default behavior. (BUILD_SHARED_LIBS can override | ||
# CMakes default behavior but LINKAGE specified here takes precedence. | ||
# set LIB_FORCE_LINKAGE=(STATIC | SHARED | MODULE) to override.) | ||
# INSTALL_DEST: Subdirectory install location. Defaults to "lib". | ||
|
||
function(add_lib lib_name) | ||
# Parse arguments | ||
set(options "") | ||
set(oneValueArgs LINKAGE INSTALL_DEST) | ||
set(multiValueArgs SOURCES) | ||
cmake_parse_arguments(add_lib "${options}" "${oneValueArgs}" "${multiValueArgs}" | ||
${ARGN}) | ||
if(NOT add_lib_SOURCES) | ||
message( FATAL_ERROR "Argument 'SOURCES' to add_lib() CMake function is mandatory! | ||
Please pass the source file names (relative to the ${CMAKE_CURRENT_SOURCE_DIR}).") | ||
endif() | ||
|
||
# Add each source file (with path) to list | ||
foreach(src IN LISTS add_lib_SOURCES) | ||
list(APPEND ${lib_name}Sources "${CMAKE_CURRENT_SOURCE_DIR}/${src}") | ||
endforeach() | ||
|
||
# Determine linkage if specified; default to system default behavior | ||
# See CMake documentation for BUILD_SHARED_LIBS variable | ||
set(ALLOWED_LINKAGE STATIC SHARED MODULE) | ||
if(add_lib_LINKAGE) | ||
if(NOT ${add_lib_LINKAGE} IN_LIST ALLOWED_LINKAGE) | ||
message( FATAL_ERROR "Argument 'LINKAGE' passed to add_lib() must be one of: | ||
STATIC, SHARED, or MODULE to match valid options passed to add_library()") | ||
else() | ||
set(LINKAGE ${add_lib_LINKAGE}) | ||
endif() | ||
endif() | ||
|
||
if(LIB_FORCE_LINKAGE) | ||
if(NOT ${LIB_FORCE_LINKAGE} IN_LIST ALLOWED_LINKAGE) | ||
message( FATAL_ERROR "'LIB_FORCE_LINKAGE' must be one of: | ||
STATIC, SHARED, or MODULE to match valid options passed to add_library()") | ||
else() | ||
set(LINKAGE ${LIB_FORCE_LINKAGE}) | ||
endif() | ||
endif() | ||
|
||
# Add library target using info processed so far | ||
add_library(${lib_name} ${LINKAGE} | ||
${${lib_name}Sources}) | ||
|
||
get_target_property(LNK_LANG ${lib_name} LINKER_LANGUAGE) | ||
if(NOT ${LINKER_LANGUAGE} STREQUAL C) | ||
target_compile_options(${lib_name} BEFORE | ||
PRIVATE ${prefix}warn${infix}errors) | ||
if(TARGET OpenCoarrays::caf_mpi_static) | ||
target_link_libraries(${lib_name} | ||
PUBLIC OpenCoarrays::caf_mpi_static) | ||
endif() | ||
endif() | ||
|
||
# Tell CMake where to install it | ||
set(_INSTALL_DEST "lib") | ||
if(add_lib_INSTALL_DEST) | ||
set(_INSTALL_DEST ${add_lib_INSTALL_DEST}) | ||
endif() | ||
endfunction(add_lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This function handles the compiler and platform options | ||
# for the following compilers: | ||
# 1) gfortran | ||
# 2) intel (not implemented / testted as part of this project) | ||
# | ||
set(CMAKE_VERBOSE_MAKEFILE OFF) | ||
include_guard(DIRECTORY) # Check to see if the file has previously been processed | ||
|
||
# Compiler options | ||
if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel") | ||
# Intel platform specific settings | ||
if (WIN32) # Windows options | ||
set(prefix "/") | ||
set(infix ":") | ||
set(Qf "Q") | ||
set(Q "Q") | ||
set(eq ":") | ||
set(colon ":") | ||
set(colon_ ":") | ||
set(libs_static "/libs:static") | ||
set(dbglibs "/dbglibs") | ||
else() # *nix options | ||
set(prefix "-") | ||
set(infix " ") | ||
set(Qf "f") | ||
set(Q "") | ||
set(eq "=") | ||
set(colon "") | ||
set(colon_ " ") | ||
set(libs_static "") | ||
set(dbglibs "") | ||
endif() | ||
|
||
set(Intel_Fortran_FLAGS_Release "${prefix}check${colon_}none ${prefix}O3") | ||
set(Intel_Fortran_FLAGS_Debug "${prefix}check${colon_}all ${prefix}O0") | ||
|
||
# "${prefix}nologo ${prefix}debug${infix}full ${prefix}MP ${prefix}Od ${prefix}standard-semantics ${prefix}warn${infix}errors ${prefix}stand${infix}f15 ${prefix}debug-parameters${infix}all ${prefix}warn${infix}declarations ${prefix}warn${infix}unused ${prefix}warn${infix}interfaces ${prefix}${Qf}trapuv ${prefix}${Q}init${eq}snan ${prefix}${Q}init${eq}arrays ${prefix}fpe${colon}0 ${prefix}traceback ${prefix}check${colon_}bounds ${prefix}check${colon_}stack ${libs_static} ${prefix}threads ${dbglibs} ${prefix}free" | ||
# "${prefix}nologo ${prefix}debug${infix}full ${prefix}multiple-processes ${prefix}O0 ${prefix}standard-semantics ${prefix}warn${infix}errors ${prefix}stand${infix}f15 ${prefix}debug-parameters${infix}all ${prefix}warn${infix}declarations ${prefix}warn${infix}unused ${prefix}warn${infix}interfaces ${prefix}${Qf}trapuv ${prefix}${Q}init${eq}snan ${prefix}${Q}init${eq}arrays ${prefix}fpe${colon}0 ${prefix}traceback ${prefix}check${colon_}bounds ${prefix}check${colon_}stack ${libs_static} ${prefix}threads ${dbglibs} ${prefix}free" | ||
|
||
set(Intel_EXE_LINKER_FLAGS "${prefix}traceback ${prefix}stand${colon_}f15 ${prefix}${Q}coarray${colon_}distributed") | ||
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") | ||
# GFortran build configs | ||
set(GNU_Fortran_FLAGS_Release "-fbacktrace -std=f2018 -ffree-form -fcheck=all") | ||
set(GNU_Fortran_FLAGS_Debug "-fbacktrace -std=f2018 -ffree-form") | ||
else() | ||
message(WARNING | ||
"\n" | ||
"Attempting to build with untested Fortran compiler: ${CMAKE_Fortran_COMPILER_ID}. " | ||
"Please report any failures through the vtkmofo Git issues\n\n" | ||
) | ||
endif() | ||
|
||
list(JOIN ${CMAKE_Fortran_COMPILER_ID}_Fortran_FLAGS_${CMAKE_BUILD_TYPE} " " CMAKE_Fortran_FLAGS) |
Oops, something went wrong.