Skip to content

Commit

Permalink
make changes to build with enable-bind-c=yes
Browse files Browse the repository at this point in the history
  • Loading branch information
mlee03 authored and mlee03 committed Apr 26, 2024
1 parent cb0c48a commit e4416c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ AS_IF([test ${enable_r8_default:-yes} = yes],
[enable_r8_default=yes],
[enable_r8_default=no])

AC_ARG_ENABLE([bind-c], [AS_HELP_STRING([--enable-bind-c], [Build C compatible FMS library])])
AS_IF([test ${enable_bind_c:-no} = yes], [enable_bind_c=yes], [enable_bind_c=no])

# user enabled testing with input files
AC_MSG_CHECKING([whether to enable tests with input files])
AC_ARG_ENABLE([test-input],
Expand Down Expand Up @@ -331,6 +334,11 @@ if test $enable_setting_flags = yes; then
FCFLAGS="$FCFLAGS $FC_DEFAULT_REAL_KIND8_FLAG"])
fi

if test $enable_bind_c = yes ; then
AC_DEFINE([BIND_C], [1], [add bind(c) to subroutines])
AC_DEFINE([PORTABLE_KINDS], [1], [use portable kinds])
fi

# individual mixed precision overloads
if test $enable_overload_c4 = yes; then
AC_DEFINE([OVERLOAD_C4], [1], [Set to overload with the C4 Fortran routines])
Expand Down
5 changes: 5 additions & 0 deletions include/fms_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#ifndef __FMS_PLATFORM_
#define __FMS_PLATFORM_

#ifdef BIND_C
#define BIND_C_ bind(c)
#else
#define BIND_C_
#endif

!Set type kinds.
#ifdef PORTABLE_KINDS
Expand Down

0 comments on commit e4416c5

Please sign in to comment.