Skip to content

Instantly share code, notes, and snippets.

@ASxa86
Created December 22, 2017 05:23
Show Gist options
  • Save ASxa86/0b630a0dad62f91bb8df6e7759c8c3ce to your computer and use it in GitHub Desktop.
Save ASxa86/0b630a0dad62f91bb8df6e7759c8c3ce to your computer and use it in GitHub Desktop.
fortran value library
project (fortran_value)
enable_language (Fortran)
set (CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3")
set (CMAKE_Fortran_FLAGS_DEBUG "-f77rtl")
add_compile_options(/MP)
add_compile_options(/extend_source:132)
add_compile_options($<$<CONFIG:Debug>:/libs:static>)
add_compile_options($<$<CONFIG:Debug>:/dbglibs>)
add_compile_options($<$<CONFIG:Debug>:/threads>)
add_compile_options($<$<CONFIG:Debug>:/Od>)
add_compile_options($<$<CONFIG:RelWithDebInfo>:/libs:static>)
add_compile_options($<$<CONFIG:RelWithDebInfo>:/threads>)
add_compile_options($<$<CONFIG:RelWithDebInfo>:/O2>)
add_compile_options($<$<CONFIG:Release>:/libs:static>)
add_compile_options($<$<CONFIG:Release>:/threads>)
add_compile_options($<$<CONFIG:Release>:/O2>)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_library(${PROJECT_NAME} SHARED value.f)
REAL VALUE
COMMON /LAUPFM/ VALUE
REAL FUNCTION getValue()
!DEC$ ATTRIBUTES DLLEXPORT, c:: getValue
IMPLICIT NONE
INCLUDE 'VALUE.CMN'
getValue = VALUE
RETURN
END FUNCTION getValue
SUBROUTINE setValue(x)
!DEC$ ATTRIBUTES DLLEXPORT, c:: setValue
IMPLICIT NONE
INCLUDE 'VALUE.CMN'
REAL, INTENT(IN) :: x
VALUE = x
END SUBROUTINE setValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment