diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ac5ff90 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,73 @@ +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) + +# Include overwrites before setting up the project +set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/config/DefaultFlags.cmake) + +# Define fdict project and languages used +project(fdict + LANGUAGES Fortran + DESCRIPTION "Fortran dictionary for arbitrary data-types" + ) + + +# Define project versions +file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PROJECT_VERSION) + +# Listify the string +string(REPLACE "." ";" VERSION_LIST ${PROJECT_VERSION}) +list(GET VERSION_LIST 0 PROJECT_VERSION_MAJOR) +list(GET VERSION_LIST 1 PROJECT_VERSION_MINOR) +list(GET VERSION_LIST 2 PROJECT_VERSION_PATCH) +unset(VERSION_LIST) + + +# Define library specific content +set(PROJECT_AUTHOR "Nick Papior") +set(PROJECT_DESCRIPTION "Fortran dictionary for arbitrary data-types") +set(PROJECT_URL "https://github.com/zerothi/fdict") +set(PROJECT_LICENSE "Mozilla Public License, 2.0 (MPL-2.0)") +message("** PROJECT_NAME = ${PROJECT_NAME}") +message("** Please report any build problems here: ${PROJECT_URL}") + + +# Define the module temporary location +#set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/modules/) + +list(APPEND FYPPFLAGS + "-DPROJECT_NAME=\\\"${PROJECT_NAME}\\\"" + "-DPROJECT_VERSION=\\\"${PROJECT_VERSION}\\\"" + "-DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}" + "-DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}" + "-DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}" + ) + + +# Add our custom definitions +add_subdirectory(config) + +# Define the allocatable array sizes +set(F_ARRAY ":") +foreach(IR RANGE 2 ${CMAKE_MAXIMUM_RANK}) + list(APPEND F_ARRAY ":") +endforeach() +string(REPLACE ";" "," F_ARRAY "${F_ARRAY}") + +# Once we have the sizes of the settings defined, we will add a check that the compiler will actually handle this. +check_fortran_source_compiles("real, allocatable :: array(${F_ARRAY}); end" fmaximum_rank SRC_EXT f90) +unset(F_ARRAY) +check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128) + +foreach(V IN ITEMS fmaximum_rank f03real128) + if(NOT ${${V}}) + message(FATAL_ERROR "Could not succesfully test compiler capability: ${V}") + endif() +endforeach() + + +add_subdirectory(src) + + +install(EXPORT ${PROJECT_NAME}-targets + NAMESPACE ${PROJECT_NAME}:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) diff --git a/Makefile.project b/Makefile.project index 5898a3c..05f6285 100644 --- a/Makefile.project +++ b/Makefile.project @@ -3,10 +3,10 @@ _SMEKA_project = 1 # Contains specific default information for this project # Step this version upon new versions -PROJECT_MAJOR = 0 -PROJECT_MINOR = 9 -PROJECT_PATCH = 0 -PROJECT_VERSION = $(PROJECT_MAJOR).$(PROJECT_MINOR).$(PROJECT_PATCH) +PROJECT_VERSION_MAJOR = 0 +PROJECT_VERSION_MINOR = 9 +PROJECT_VERSION_PATCH = 0 +PROJECT_VERSION = $(PROJECT_VERSION_MAJOR).$(PROJECT_VERSION_MINOR).$(PROJECT_VERSION_PATCH) # These are constant default PROJECT_NAME = fdict @@ -16,9 +16,9 @@ FDICT_LIB ?= fdict$(LIB_SUFFIX) FDICT_LIB_STATIC ?= lib$(FDICT_LIB).a FDICT_LIB_SHARED ?= lib$(FDICT_LIB).so -FYPPFLAGS += -DPROJECT_MAJOR=$(PROJECT_MAJOR) -FYPPFLAGS += -DPROJECT_MINOR=$(PROJECT_MINOR) -FYPPFLAGS += -DPROJECT_PATCH=$(PROJECT_PATCH) +FYPPFLAGS += -DPROJECT_VERSION_MAJOR=$(PROJECT_VERSION_MAJOR) +FYPPFLAGS += -DPROJECT_VERSION_MINOR=$(PROJECT_VERSION_MINOR) +FYPPFLAGS += -DPROJECT_VERSION_PATCH=$(PROJECT_VERSION_PATCH) # Define custom options for fdict STATIC ?= 1 diff --git a/README.md b/README.md index 3db5dad..20c6bcf 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,8 @@ To enable the non-default data types you can do so with (Makefile scheme): FYPPFLAGS += -DWITH_LOG64=1 # for logical kind(18) FYPPFLAGS += -DWITH_ISO_C=1 # for enabling c_ptr and c_funptr +For `cmake` the same arguments can be made. + By default `fdict` generates the kind specifications from the `selected_*_kind` routines, however, if one wishes to use the `iso_fortran_env` module simply add `FYPPFLAGS += -DWITH_ISO_ENV`. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..ac39a10 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.9.0 diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt new file mode 100644 index 0000000..b45066b --- /dev/null +++ b/config/CMakeLists.txt @@ -0,0 +1,152 @@ +# Ensure we use some basic packages + +# Project installation follows GNU installation directory convention +include(GNUInstallDirs) + +include(ProjectOptions.cmake) + +# --- compiler feature checks +include(CheckFortranSourceCompiles) +include(CheckFortranSourceRuns) + +set(CMAKE_INSTALL_CMAKECONFIG_DIR + "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) + + +# Export a pkg-config file +configure_file( + "${PROJECT_SOURCE_DIR}/fdict.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + @ONLY +) + +# Install pkg-config files +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" +) + +# Export CMake package file +include(CMakePackageConfigHelpers) + +# Export a cmake package configure file +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/template.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKECONFIG_DIR}" +) + +if(BUILD_SHARED_LIBS OR PROJECT_VERSION_MAJOR EQUAL 0) + # Due to the uncertain ABI compatibility of Fortran shared libraries + # limit compatibility for dynamic linking to same minor version. + set(COMPATIBILITY SameMinorVersion) +else() + # Require API compatibility via semantic versioning for static linking. + set(COMPATIBILITY SameMajorVersion) +endif() + +# Export a package version file +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" + VERSION "${PROJECT_VERSION}" + COMPATIBILITY ${COMPATIBILITY} +) + +# Install cmake configuration files +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" + DESTINATION "${CMAKE_INSTALL_CMAKECONFIG_DIR}" +) + + +# Preprocesses a list of files with given preprocessor and preprocessor options +# +# Args: +# preproc [in]: Preprocessor program +# preprocopts [in]: Preprocessor options +# srcext [in]: File extension of the source files +# trgext [in]: File extension of the target files +# srcfiles [in]: List of the source files +# trgfiles [out]: Contains the list of the preprocessed files on exit +# +function(preprocess preproc preprocopts srcext trgext srcfiles trgfiles) + + set(_trgfiles) + foreach(srcfile IN LISTS srcfiles) + string(REGEX REPLACE "\\.${srcext}$" ".${trgext}" trgfile ${srcfile}) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${trgfile} + COMMAND ${preproc} ${preprocopts} ${CMAKE_CURRENT_SOURCE_DIR}/${srcfile} ${CMAKE_CURRENT_BINARY_DIR}/${trgfile} + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}) + list(APPEND _trgfiles ${CMAKE_CURRENT_BINARY_DIR}/${trgfile}) + endforeach() + set(${trgfiles} ${_trgfiles} PARENT_SCOPE) + +endfunction() + +# Define a function for fyppifying sources +function(fyppify) + # Parse arguments + set(options "") + set(oneValueArgs FYPP EXTIN EXTOUT COMMENT OUTPUT) + set(multiValueArgs FLAGS FILES) + cmake_parse_arguments( + _fyppify "${options}" "${oneValueArgs}" "${multiValueArgs}" + ${ARGN} + ) + + # Now handle arguments + #[==[ + message(INFO "Before parsing inputs: + comment=${_fyppify_COMMENT} + fypp=${_fyppify_FYPP} + EXTIN=${_fyppify_EXTIN} + EXTOUT=${_fyppify_EXTOUT} + FLAGS=${_fyppify_FLAGS} + FILES=${_fyppify_FILES} + ") + ]==] + + if(NOT DEFINED _fyppify_FYPP) + set(_fyppify_FYPP ${FYPP}) + endif() + if(NOT DEFINED _fyppify_EXTIN) + set(_fyppify_EXTIN "fypp") + endif() + if(NOT DEFINED _fyppify_EXTOUT) + set(_fyppify_EXTOUT "f90") + endif() + if(DEFINED _fyppify_COMMENT) + message(VERBOSE "-- Setting up fyppify: ${_fyppify_COMMENT}") + endif() + if(NOT DEFINED _fyppify_FLAGS) + set(_fyppify_FLAGS "") + endif() + if(NOT DEFINED _fyppify_FILES) + message(FATAL_ERROR "fyppify requires FILES arguments to determine which files to preprocess") + endif() + + #[==[ + message(INFO "After parsing inputs: + comment=${_fyppify_COMMENT} + fypp=${_fyppify_FYPP} + EXTIN=${_fyppify_EXTIN} + EXTOUT=${_fyppify_EXTOUT} + FLAGS=${_fyppify_FLAGS} + FILES=${_fyppify_FILES} + ") + ]==] + + # Lets do the preprocessing + preprocess("${_fyppify_FYPP}" "${_fyppify_FLAGS}" + "${_fyppify_EXTIN}" "${_fyppify_EXTOUT}" + "${_fyppify_FILES}" _outfiles) + if(DEFINED _fyppify_OUTPUT) + set(${_fyppify_OUTPUT} ${_outfiles} PARENT_SCOPE) + endif() + +endfunction() diff --git a/config/DefaultFlags.cmake b/config/DefaultFlags.cmake new file mode 100644 index 0000000..47717ad --- /dev/null +++ b/config/DefaultFlags.cmake @@ -0,0 +1,42 @@ +if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + # GNU compiler gfortran + set( + CMAKE_Fortran_FLAGS_INIT + "-fimplicit-none" + ) + set( + CMAKE_Fortran_FLAGS_RELEASE_INIT + ) + set( + CMAKE_Fortran_FLAGS_DEBUG_INIT + "-Wall" + "-Wextra" + "-Wimplicit-procedure" + ) +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel") + # Intel compiler ifort + set( + CMAKE_Fortran_FLAGS_INIT + ) + set( + CMAKE_Fortran_FLAGS_RELEASE_INIT + ) + set( + CMAKE_Fortran_FLAGS_DEBUG_INIT + "-warn declarations,general,usage,interfaces,unused" + ) +else() + # unknown compiler (possibly) + set( + CMAKE_Fortran_FLAGS_INIT + ) + set( + CMAKE_Fortran_FLAGS_RELEASE_INIT + ) + set( + CMAKE_Fortran_FLAGS_DEBUG_INIT + ) +endif() +string(REPLACE ";" " " CMAKE_Fortran_FLAGS_INIT "${CMAKE_Fortran_FLAGS_INIT}") +string(REPLACE ";" " " CMAKE_Fortran_FLAGS_RELEASE_INIT "${CMAKE_Fortran_FLAGS_RELEASE_INIT}") +string(REPLACE ";" " " CMAKE_Fortran_FLAGS_DEBUG_INIT "${CMAKE_Fortran_FLAGS_DEBUG_INIT}") diff --git a/config/ProjectOptions.cmake b/config/ProjectOptions.cmake new file mode 100644 index 0000000..4c9acbb --- /dev/null +++ b/config/ProjectOptions.cmake @@ -0,0 +1,62 @@ +# Here we define all options that are related to fdict + +# Ensure we have the program fypp installed +find_program(FYPP fypp) +if(NOT FYPP) + message(FATAL_ERROR "Could not find executable fypp -- it is required for the pre-processing step") +endif() + +# We need to define certain variables before the initial configuration of this project +if(NOT DEFINED CMAKE_MAXIMUM_RANK) + set(CMAKE_MAXIMUM_RANK 5 CACHE STRING "Maximum array rank for generated procedures") +endif() + +# Whether we should use the iso_fortran_env for data-types +message(CHECK_START "Requested use of intrinsic fortran module (iso_fortran_env) for data-types") +if(DEFINED "WITH_ISO_ENV}") + message(CHECK_PASS "used") + list(APPEND FYPPFLAGS "-DWITH_ISO_ENV=$") +else() + message(CHECK_FAIL "not used") +endif() + + +# Parse data-type options +message(CHECK_START "Checking for data-type interfaces") +list(APPEND CMAKE_MESSAGE_INDENT " ") +foreach(var INT8 INT16 REAL80 REAL128 LOG8 LOG16 LOG64 ISO_C) + message(CHECK_START "data-type ${var}") + if(DEFINED "WITH_${var}") + message(CHECK_PASS "added") + list(APPEND FYPPFLAGS "-DWITH_${var}=$") + else() + message(CHECK_FAIL "not added") + endif() +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) +message(CHECK_PASS "done") + +# Global maxrank +message(CHECK_START "Checking for data-type rank size interfaces") +list(APPEND CMAKE_MESSAGE_INDENT " ") +message(CHECK_START "default rank size") +if(DEFINED "MAXRANK") + message(CHECK_PASS "found size = ${MAXRANK}") + list(APPEND FYPPFLAGS "-DMAXRANK=${MAXRANK}") +else() + set(MAXRANK 5) + message(CHECK_FAIL "using default size = ${MAXRANK}") +endif() + +# Parse rank sizes +foreach(var INT REAL CMPLX LOG ISO_C) + message(CHECK_START "rank size of ${var}") + if(DEFINED "MAXRANK_${var}") + message(CHECK_PASS "found size = ${MAXRANK_${var}}") + list(APPEND FYPPFLAGS "-DMAXRANK_${var}=${MAXRANK_${var}}") + else() + message(CHECK_FAIL "using default size = ${MAXRANK}") + endif() +endforeach() +list(POP_BACK CMAKE_MESSAGE_INDENT) +message(CHECK_PASS "done") diff --git a/config/README b/config/README new file mode 100644 index 0000000..15b7c2b --- /dev/null +++ b/config/README @@ -0,0 +1,5 @@ +These configuration files are highly inspired from the +github.com/fortran-lang/stdlib project. + +I acknowledge and thank them for their continued support to +the Fortran community! \ No newline at end of file diff --git a/config/autocmake_safeguards.cmake b/config/autocmake_safeguards.cmake new file mode 100644 index 0000000..7c0a2a9 --- /dev/null +++ b/config/autocmake_safeguards.cmake @@ -0,0 +1,26 @@ +# Downloaded from +# https://github.com/coderefinery/autocmake/blob/master/modules/safeguards.cmake +# * changed text of in-source message + +#.rst: +# +# Provides safeguards against in-source builds and bad build types. +# +# Variables used:: +# +# PROJECT_SOURCE_DIR +# PROJECT_BINARY_DIR +# CMAKE_BUILD_TYPE + +if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR}) + message(FATAL_ERROR "In-source builds not allowed. Please run CMake from top directory and specify a build directory (e.g., cmake -H. -Bbuild).") +endif() + +string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower) +string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper) + +if(NOT cmake_build_type_tolower STREQUAL "debug" AND + NOT cmake_build_type_tolower STREQUAL "release" AND + NOT cmake_build_type_tolower STREQUAL "relwithdebinfo") + message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).") +endif() diff --git a/config/template.cmake b/config/template.cmake new file mode 100644 index 0000000..b57c8b8 --- /dev/null +++ b/config/template.cmake @@ -0,0 +1,7 @@ +@PACKAGE_INIT@ + +set("@PROJECT_NAME@_MAXIMUM_RANK" @CMAKE_MAXIMUM_RANK@) + +if(NOT TARGET "@PROJECT_NAME@::@PROJECT_NAME@") + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") +endif() diff --git a/config/template.pc b/config/template.pc new file mode 100644 index 0000000..7d9f61f --- /dev/null +++ b/config/template.pc @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +moduledir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: @PROJECT_NAME@ +Description: @PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -l@PROJECT_NAME@ +Cflags: -I${includedir} \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..0a61596 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,75 @@ +# Make CMake run the scripts for creating the input files +# Define this directory's module location +set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules/) + +# Define the files that needs to be fyppified +set(fyppFiles + fdict_types.fypp + variable.fypp + dictionary.fypp +) + + +# Do the preprocessing +fyppify( + EXTIN "fypp" EXTOUT "f90" + FLAGS ${FYPPFLAGS} + COMMENT "fyppifying source codes" + FILES ${fyppFiles} + OUTPUT outFiles +) + +set(SRC + ${outFiles} +) + +# Also fyppify the global inclusion file +fyppify( + EXTIN "fypp.in" EXTOUT "fypp" + FLAGS "${FYPPFLAGS}" + COMMENT "fyppifying global input file" + FILES fdict.fypp.in + OUTPUT outFiles + ) + +# Ensure it is a target +add_custom_target(fdict.fypp ALL DEPENDS ${outFiles}) + +# Generate the include file for discovering versions +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/fdict.inc.in" + "${CMAKE_CURRENT_BINARY_DIR}/fdict.inc" + @ONLY +) + +# Define all +set(INTERFACES + ${outFiles} + ${CMAKE_CURRENT_BINARY_DIR}/fdict.inc +) + +install(FILES ${INTERFACES} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +# Finally define the fdict library +add_library(${PROJECT_NAME} ${SRC}) + +# Attach the headers to the target +set_target_properties(${PROJECT_NAME} + PROPERTIES + POSITION_INDEPENDENT_CODE ON +) + +# Install all modules +install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +# Install the library targets +install(TARGETS ${PROJECT_NAME} + EXPORT "${PROJECT_NAME}-targets" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) diff --git a/src/Makefile.inc b/src/Makefile.inc index 9a1da84..4fbcfea 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -28,9 +28,9 @@ fdict.fypp: fdict.fypp.in fdict.inc: @$(ECHO) "#ifndef _FDICT_INCLUDE_DEFINED" > $@ @$(ECHO) "#define _FDICT_INCLUDE_DEFINED" >> $@ - @$(ECHO) "#define _FDICT_MAJOR_ $(PROJECT_MAJOR)" >> $@ - @$(ECHO) "#define _FDICT_MINOR_ $(PROJECT_MINOR)" >> $@ - @$(ECHO) "#define _FDICT_PATCH_ $(PROJECT_PATCH)" >> $@ + @$(ECHO) "#define _FDICT_MAJOR_ $(PROJECT_VERSION_MAJOR)" >> $@ + @$(ECHO) "#define _FDICT_MINOR_ $(PROJECT_VERSION_MINOR)" >> $@ + @$(ECHO) "#define _FDICT_PATCH_ $(PROJECT_VERSION_PATCH)" >> $@ @$(ECHO) "#define _FDICT_VERSION_ $(PROJECT_VERSION)" >> $@ @$(ECHO) "#endif" >> $@ diff --git a/src/fdict.fypp.in b/src/fdict.fypp.in new file mode 100644 index 0000000..7901b99 --- /dev/null +++ b/src/fdict.fypp.in @@ -0,0 +1,38 @@ +#! Define all constants +#:include 'fdict_common.fypp' +#:def set_constant(name, value) +${"#:set {} = {}".format(name, value)}$ +#:enddef +#! +#:if defined("WITH_ALL") +${set_constant("WITH_ALL", WITH_ALL) +#:endif +${set_constant("FDICT_VERSION", "'{}.{}.{}'".format(PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH))}$ +${set_constant("FDICT_MAJOR", PROJECT_VERSION_MAJOR)}$ +${set_constant("FDICT_MINOR", PROJECT_VERSION_MINOR)}$ +${set_constant("FDICT_PATCH", PROJECT_VERSION_PATCH)}$ +${set_constant("WITH_ISO_C", WITH_ISO_C)}$ +${set_constant("WITH_ISO_ENV", WITH_ISO_ENV)}$ +${set_constant("MAXRANK", MAXRANK)}$ +${set_constant("WITH_REAL80", WITH_REAL80)}$ +${set_constant("WITH_REAL128", WITH_REAL128)}$ +${set_constant("WITH_INT8", WITH_INT8)}$ +${set_constant("WITH_INT16", WITH_INT16)}$ +${set_constant("WITH_LOG8", WITH_LOG8)}$ +${set_constant("WITH_LOG16", WITH_LOG16)}$ +${set_constant("WITH_LOG64", WITH_LOG64)}$ +#:if defined("MAXRANK_INT") +${set_constant("MAXRANK_INT", MAXRANK_INT)}$ +#:endif +#:if defined("MAXRANK_REAL") +${set_constant("MAXRANK_REAL", MAXRANK_REAL)}$ +#:endif +#:if defined("MAXRANK_CMPLX") +${set_constant("MAXRANK_CMPLX", MAXRANK_CMPLX)}$ +#:endif +#:if defined("MAXRANK_LOG") +${set_constant("MAXRANK_LOG", MAXRANK_LOG)}$ +#:endif +#:if defined("MAXRANK_ISO_C") +${set_constant("MAXRANK_ISO_C", MAXRANK_ISO_C)}$ +#:endif diff --git a/src/fdict.inc.in b/src/fdict.inc.in new file mode 100644 index 0000000..55fb0b1 --- /dev/null +++ b/src/fdict.inc.in @@ -0,0 +1,9 @@ +#ifndef _FDICT_FDICT_INC +#define _FDICT_FDICT_INC 1 + +#define _FDICT_MAJOR_ @PROJECT_VERSION_MAJOR@ +#define _FDICT_MINOR_ @PROJECT_VERSION_MINOR@ +#define _FDICT_PATCH_ @PROJECT_VERSION_PATCH@ +#define _FDICT_VERSION_ @PROJECT_VERSION@ + +#endif