[flang][OpenMP] Compile proper `omp_lib.mod` from the `openmp/src/include` sources (#80874)

This PR changes the build system to use use the sources for the module
`omp_lib` and the `omp_lib.h` include file from the `openmp` runtime
project and not from a separate copy of these files. This will greatly
reduce potential for inconsistencies when adding features to the OpenMP
runtime implementation.

When the OpenMP subproject is not configured, this PR also disables the
corresponding LIT tests with a "REQUIRES" directive at the beginning of
the OpenMP test files.

---------

Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
GitOrigin-RevId: fb5fd2d82f9befba9cf5152d1a0c5e6f91ee48f0
diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt
index ff129fe..f05bcab 100644
--- a/runtime/src/CMakeLists.txt
+++ b/runtime/src/CMakeLists.txt
@@ -316,9 +316,25 @@
 
 # Building the Fortran module files
 # One compilation step creates both omp_lib.mod and omp_lib_kinds.mod
-if(${LIBOMP_FORTRAN_MODULES})
-  configure_file(${LIBOMP_INC_DIR}/omp_lib.h.var omp_lib.h @ONLY)
-  configure_file(${LIBOMP_INC_DIR}/omp_lib.f90.var omp_lib.f90 @ONLY)
+configure_file(${LIBOMP_INC_DIR}/omp_lib.h.var omp_lib.h @ONLY)
+configure_file(${LIBOMP_INC_DIR}/omp_lib.F90.var omp_lib.F90 @ONLY)
+
+set(BUILD_FORTRAN_MODULES False)
+if (NOT ${LIBOMP_FORTRAN_MODULES_COMPILER} STREQUAL "")
+  # If libomp is built as an LLVM runtime and the flang compiler is available,
+  # compile the Fortran module files.
+  message(STATUS "configuring openmp to build Fortran module files using ${LIBOMP_FORTRAN_MODULES_COMPILER}")
+  set(LIBOMP_FORTRAN_SOURCE_FILE omp_lib.F90)
+  add_custom_target(libomp-mod ALL DEPENDS omp_lib.mod omp_lib_kinds.mod)
+  add_custom_command(
+    OUTPUT omp_lib.mod omp_lib_kinds.mod
+    COMMAND ${LIBOMP_FORTRAN_MODULES_COMPILER} -cpp -fsyntax-only ${LIBOMP_FORTRAN_SOURCE_FILE}
+    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_FORTRAN_SOURCE_FILE}
+      ${CMAKE_CURRENT_BINARY_DIR}/omp_lib.h
+  )
+  set(BUILD_FORTRAN_MODULES True)
+elseif(${LIBOMP_FORTRAN_MODULES})
+  # The following requests explicit building of the Fortran module files
   # Workaround for gfortran to build modules with the
   # omp_sched_monotonic integer parameter
   if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
@@ -327,7 +343,7 @@
   add_custom_target(libomp-mod ALL DEPENDS omp_lib.mod omp_lib_kinds.mod)
   libomp_get_fflags(LIBOMP_CONFIGURED_FFLAGS)
   if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-    set(LIBOMP_FORTRAN_SOURCE_FILE omp_lib.f90)
+    set(LIBOMP_FORTRAN_SOURCE_FILE omp_lib.F90)
   else()
     message(FATAL_ERROR "Fortran module build requires Fortran 90 compiler")
   endif()
@@ -339,6 +355,7 @@
       ${CMAKE_CURRENT_BINARY_DIR}/omp_lib.h
   )
   set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES omp_lib${CMAKE_C_OUTPUT_EXTENSION})
+  set(BUILD_FORTRAN_MODULES True)
 endif()
 
 # Move files to exports/ directory if requested
@@ -412,11 +429,15 @@
   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omp-tools.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH} RENAME ompt.h)
   set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
 endif()
-if(${LIBOMP_FORTRAN_MODULES})
+if(${BUILD_FORTRAN_MODULES})
+  set (destination ${LIBOMP_HEADERS_INSTALL_PATH})
+  if (NOT ${LIBOMP_MODULES_INSTALL_PATH} STREQUAL "")
+    set (destination ${LIBOMP_MODULES_INSTALL_PATH})
+  endif()
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/omp_lib.h
     ${CMAKE_CURRENT_BINARY_DIR}/omp_lib.mod
     ${CMAKE_CURRENT_BINARY_DIR}/omp_lib_kinds.mod
-    DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
+    DESTINATION ${destination}
   )
 endif()
diff --git a/runtime/src/include/omp_lib.f90.var b/runtime/src/include/omp_lib.F90.var
similarity index 62%
rename from runtime/src/include/omp_lib.f90.var
rename to runtime/src/include/omp_lib.F90.var
index 1ca542d..63a3c93 100644
--- a/runtime/src/include/omp_lib.f90.var
+++ b/runtime/src/include/omp_lib.F90.var
@@ -14,37 +14,42 @@
 
         use, intrinsic :: iso_c_binding
 
-        integer, parameter :: omp_integer_kind       = c_int
-        integer, parameter :: omp_logical_kind       = 4
-        integer, parameter :: omp_real_kind          = c_float
-        integer, parameter :: kmp_double_kind        = c_double
-        integer, parameter :: omp_lock_kind          = c_intptr_t
-        integer, parameter :: omp_nest_lock_kind     = c_intptr_t
-        integer, parameter :: omp_sched_kind         = omp_integer_kind
-        integer, parameter :: omp_proc_bind_kind     = omp_integer_kind
-        integer, parameter :: kmp_pointer_kind       = c_intptr_t
-        integer, parameter :: kmp_size_t_kind        = c_size_t
-        integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
-        integer, parameter :: kmp_cancel_kind        = omp_integer_kind
-        integer, parameter :: omp_sync_hint_kind     = omp_integer_kind
-        integer, parameter :: omp_lock_hint_kind     = omp_sync_hint_kind
-        integer, parameter :: omp_control_tool_kind  = omp_integer_kind
-        integer, parameter :: omp_control_tool_result_kind = omp_integer_kind
-        integer, parameter :: omp_allocator_handle_kind = c_intptr_t
-        integer, parameter :: omp_memspace_handle_kind = c_intptr_t
-        integer, parameter :: omp_alloctrait_key_kind = omp_integer_kind
-        integer, parameter :: omp_alloctrait_val_kind = c_intptr_t
-        integer, parameter :: omp_interop_kind = c_intptr_t
-        integer, parameter :: omp_interop_fr_kind = omp_integer_kind
+        ! Set PRIVATE by default to explicitly only export what is meant
+        ! to be exported by this MODULE.
+        private
+
+        integer, parameter, public :: omp_integer_kind       = c_int
+        integer, parameter, public :: omp_logical_kind       = 4
+        integer, parameter, public :: omp_real_kind          = c_float
+        integer, parameter, public :: kmp_double_kind        = c_double
+        integer, parameter, public :: omp_lock_kind          = c_intptr_t
+        integer, parameter, public :: omp_nest_lock_kind     = c_intptr_t
+        integer, parameter, public :: omp_sched_kind         = omp_integer_kind
+        integer, parameter, public :: omp_proc_bind_kind     = omp_integer_kind
+        integer, parameter, public :: kmp_pointer_kind       = c_intptr_t
+        integer, parameter, public :: kmp_size_t_kind        = c_size_t
+        integer, parameter, public :: kmp_affinity_mask_kind = c_intptr_t
+        integer, parameter, public :: kmp_cancel_kind        = omp_integer_kind
+        integer, parameter, public :: omp_sync_hint_kind     = omp_integer_kind
+        integer, parameter, public :: omp_lock_hint_kind     = omp_sync_hint_kind
+        integer, parameter, public :: omp_control_tool_kind  = omp_integer_kind
+        integer, parameter, public :: omp_control_tool_result_kind = omp_integer_kind
+        integer, parameter, public :: omp_allocator_handle_kind = c_intptr_t
+        integer, parameter, public :: omp_memspace_handle_kind = c_intptr_t
+        integer, parameter, public :: omp_alloctrait_key_kind = omp_integer_kind
+        integer, parameter, public :: omp_alloctrait_val_kind = c_intptr_t
+        integer, parameter, public :: omp_interop_kind = c_intptr_t
+        integer, parameter, public :: omp_interop_fr_kind = omp_integer_kind
 
         type omp_alloctrait
           integer(kind=omp_alloctrait_key_kind) key
           integer(kind=omp_alloctrait_val_kind) value
         end type omp_alloctrait
+        public :: omp_alloctrait
 
-        integer, parameter :: omp_pause_resource_kind = omp_integer_kind
-        integer, parameter :: omp_depend_kind = c_intptr_t
-        integer, parameter :: omp_event_handle_kind = c_intptr_t
+        integer, parameter, public :: omp_pause_resource_kind = omp_integer_kind
+        integer, parameter, public :: omp_depend_kind = c_intptr_t
+        integer, parameter, public :: omp_event_handle_kind = c_intptr_t
 
       end module omp_lib_kinds
 
@@ -52,119 +57,151 @@
 
         use omp_lib_kinds
 
-        integer (kind=omp_integer_kind), parameter :: openmp_version    = @LIBOMP_OMP_YEAR_MONTH@
-        integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
-        integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
-        integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
+        ! Set PRIVATE by default to explicitly only export what is meant
+        ! to be exported by this MODULE.
+        private
+
+        ! Re-export definitions in omp_lib_kinds
+        public :: omp_integer_kind
+        public :: omp_logical_kind
+        public :: omp_real_kind
+        public :: kmp_double_kind
+        public :: omp_lock_kind
+        public :: omp_nest_lock_kind
+        public :: omp_sched_kind
+        public :: omp_proc_bind_kind
+        public :: kmp_pointer_kind
+        public :: kmp_size_t_kind
+        public :: kmp_affinity_mask_kind
+        public :: kmp_cancel_kind
+        public :: omp_sync_hint_kind
+        public :: omp_lock_hint_kind
+        public :: omp_control_tool_kind
+        public :: omp_control_tool_result_kind
+        public :: omp_allocator_handle_kind
+        public :: omp_memspace_handle_kind
+        public :: omp_alloctrait_key_kind
+        public :: omp_alloctrait_val_kind
+        public :: omp_interop_kind
+        public :: omp_interop_fr_kind
+        public :: omp_alloctrait
+        public :: omp_pause_resource_kind
+        public :: omp_depend_kind
+        public :: omp_event_handle_kind
+
+        integer (kind=omp_integer_kind), parameter, public :: openmp_version    = @LIBOMP_OMP_YEAR_MONTH@
+        integer (kind=omp_integer_kind), parameter, public :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
+        integer (kind=omp_integer_kind), parameter, public :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
+        integer (kind=omp_integer_kind), parameter, public :: kmp_version_build = @LIBOMP_VERSION_BUILD@
         character(*)               kmp_build_date
         parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
 
-        integer(kind=omp_sched_kind), parameter :: omp_sched_static  = 1
-        integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
-        integer(kind=omp_sched_kind), parameter :: omp_sched_guided  = 3
-        integer(kind=omp_sched_kind), parameter :: omp_sched_auto    = 4
-        integer(kind=omp_sched_kind), parameter :: omp_sched_monotonic = int(Z'80000000', kind=omp_sched_kind)
+        integer(kind=omp_sched_kind), parameter, public :: omp_sched_static  = 1
+        integer(kind=omp_sched_kind), parameter, public :: omp_sched_dynamic = 2
+        integer(kind=omp_sched_kind), parameter, public :: omp_sched_guided  = 3
+        integer(kind=omp_sched_kind), parameter, public :: omp_sched_auto    = 4
+        integer(kind=omp_sched_kind), parameter, public :: omp_sched_monotonic = int(Z'80000000', kind=omp_sched_kind)
 
-        integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
-        integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
-        integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
-        integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
-        integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
+        integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_false = 0
+        integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_true = 1
+        integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_master = 2
+        integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_close = 3
+        integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_spread = 4
 
-        integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
-        integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
-        integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
-        integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
+        integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_parallel = 1
+        integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_loop = 2
+        integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_sections = 3
+        integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_taskgroup = 4
 
-        integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_none           = 0
-        integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_uncontended    = 1
-        integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_contended      = 2
-        integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_nonspeculative = 4
-        integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_speculative    = 8
-        integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = omp_sync_hint_none
-        integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = omp_sync_hint_uncontended
-        integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = omp_sync_hint_contended
-        integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = omp_sync_hint_nonspeculative
-        integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = omp_sync_hint_speculative
-        integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle         = 65536
-        integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm         = 131072
-        integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive    = 262144
+        integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_none           = 0
+        integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_uncontended    = 1
+        integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_contended      = 2
+        integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_nonspeculative = 4
+        integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_speculative    = 8
+        integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_none = omp_sync_hint_none
+        integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_uncontended = omp_sync_hint_uncontended
+        integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_contended = omp_sync_hint_contended
+        integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_nonspeculative = omp_sync_hint_nonspeculative
+        integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_speculative = omp_sync_hint_speculative
+        integer (kind=omp_lock_hint_kind), parameter, public :: kmp_lock_hint_hle         = 65536
+        integer (kind=omp_lock_hint_kind), parameter, public :: kmp_lock_hint_rtm         = 131072
+        integer (kind=omp_lock_hint_kind), parameter, public :: kmp_lock_hint_adaptive    = 262144
 
-        integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_start = 1
-        integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_pause = 2
-        integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_flush = 3
-        integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_end = 4
+        integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_start = 1
+        integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_pause = 2
+        integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_flush = 3
+        integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_end = 4
 
-        integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_notool = -2
-        integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_nocallback = -1
-        integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_success = 0
-        integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_ignored = 1
+        integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_notool = -2
+        integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_nocallback = -1
+        integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_success = 0
+        integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_ignored = 1
 
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_sync_hint = 1
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_alignment = 2
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_access = 3
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pool_size = 4
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fallback = 5
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fb_data = 6
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pinned = 7
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_partition = 8
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_sync_hint = 1
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_alignment = 2
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_access = 3
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_pool_size = 4
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_fallback = 5
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_fb_data = 6
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_pinned = 7
+        integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_partition = 8
 
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default = -1
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_false = 0
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_true = 1
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_contended = 3
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_uncontended = 4
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_serialized = 5
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_sequential = omp_atv_serialized
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_private = 6
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_all = 7
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_thread = 8
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_pteam = 9
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_cgroup = 10
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default_mem_fb = 11
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_null_fb = 12
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_abort_fb = 13
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_allocator_fb = 14
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_environment = 15
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_nearest = 16
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_blocked = 17
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_interleaved = 18
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_default = -1
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_false = 0
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_true = 1
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_contended = 3
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_uncontended = 4
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_serialized = 5
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_sequential = omp_atv_serialized
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_private = 6
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_all = 7
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_thread = 8
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_pteam = 9
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_cgroup = 10
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_default_mem_fb = 11
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_null_fb = 12
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_abort_fb = 13
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_allocator_fb = 14
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_environment = 15
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_nearest = 16
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_blocked = 17
+        integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_interleaved = 18
 
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_null_allocator = 0
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_default_mem_alloc = 1
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_large_cap_mem_alloc = 2
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_const_mem_alloc = 3
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_high_bw_mem_alloc = 4
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_low_lat_mem_alloc = 5
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_cgroup_mem_alloc = 6
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_pteam_mem_alloc = 7
-        integer (kind=omp_allocator_handle_kind), parameter :: omp_thread_mem_alloc = 8
-        integer (kind=omp_allocator_handle_kind), parameter :: llvm_omp_target_host_mem_alloc = 100
-        integer (kind=omp_allocator_handle_kind), parameter :: llvm_omp_target_shared_mem_alloc = 101
-        integer (kind=omp_allocator_handle_kind), parameter :: llvm_omp_target_device_mem_alloc = 102
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_null_allocator = 0
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_default_mem_alloc = 1
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_large_cap_mem_alloc = 2
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_const_mem_alloc = 3
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_high_bw_mem_alloc = 4
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_low_lat_mem_alloc = 5
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_cgroup_mem_alloc = 6
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_pteam_mem_alloc = 7
+        integer (kind=omp_allocator_handle_kind), parameter, public :: omp_thread_mem_alloc = 8
+        integer (kind=omp_allocator_handle_kind), parameter, public :: llvm_omp_target_host_mem_alloc = 100
+        integer (kind=omp_allocator_handle_kind), parameter, public :: llvm_omp_target_shared_mem_alloc = 101
+        integer (kind=omp_allocator_handle_kind), parameter, public :: llvm_omp_target_device_mem_alloc = 102
 
-        integer (kind=omp_memspace_handle_kind), parameter :: omp_default_mem_space = 0
-        integer (kind=omp_memspace_handle_kind), parameter :: omp_large_cap_mem_space = 1
-        integer (kind=omp_memspace_handle_kind), parameter :: omp_const_mem_space = 2
-        integer (kind=omp_memspace_handle_kind), parameter :: omp_high_bw_mem_space = 3
-        integer (kind=omp_memspace_handle_kind), parameter :: omp_low_lat_mem_space = 4
-        integer (kind=omp_memspace_handle_kind), parameter :: llvm_omp_target_host_mem_space = 100
-        integer (kind=omp_memspace_handle_kind), parameter :: llvm_omp_target_shared_mem_space = 101
-        integer (kind=omp_memspace_handle_kind), parameter :: llvm_omp_target_device_mem_space = 102
+        integer (kind=omp_memspace_handle_kind), parameter, public :: omp_default_mem_space = 0
+        integer (kind=omp_memspace_handle_kind), parameter, public :: omp_large_cap_mem_space = 1
+        integer (kind=omp_memspace_handle_kind), parameter, public :: omp_const_mem_space = 2
+        integer (kind=omp_memspace_handle_kind), parameter, public :: omp_high_bw_mem_space = 3
+        integer (kind=omp_memspace_handle_kind), parameter, public :: omp_low_lat_mem_space = 4
+        integer (kind=omp_memspace_handle_kind), parameter, public :: llvm_omp_target_host_mem_space = 100
+        integer (kind=omp_memspace_handle_kind), parameter, public :: llvm_omp_target_shared_mem_space = 101
+        integer (kind=omp_memspace_handle_kind), parameter, public :: llvm_omp_target_device_mem_space = 102
 
-        integer (kind=omp_pause_resource_kind), parameter :: omp_pause_resume = 0
-        integer (kind=omp_pause_resource_kind), parameter :: omp_pause_soft = 1
-        integer (kind=omp_pause_resource_kind), parameter :: omp_pause_hard = 2
+        integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_resume = 0
+        integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_soft = 1
+        integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_hard = 2
 
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_cuda = 1
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_cuda_driver = 2
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_opencl = 3
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_sycl = 4
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_hip = 5
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_level_zero = 6
-        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_last = 7
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_cuda = 1
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_cuda_driver = 2
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_opencl = 3
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_sycl = 4
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_hip = 5
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_level_zero = 6
+        integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_last = 7
 
-        integer (kind=omp_interop_kind), parameter :: omp_interop_none = 0
+        integer (kind=omp_interop_kind), parameter, public :: omp_interop_none = 0
 
         interface
 
@@ -392,82 +429,102 @@
           end subroutine omp_fulfill_event
 
           subroutine omp_init_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_init_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_lock_kind) svar
           end subroutine omp_init_lock
 
           subroutine omp_destroy_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_destroy_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_lock_kind) svar
           end subroutine omp_destroy_lock
 
           subroutine omp_set_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_set_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_lock_kind) svar
           end subroutine omp_set_lock
 
           subroutine omp_unset_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_unset_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_lock_kind) svar
           end subroutine omp_unset_lock
 
           function omp_test_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_test_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             logical (kind=omp_logical_kind) omp_test_lock
             integer (kind=omp_lock_kind) svar
           end function omp_test_lock
 
           subroutine omp_init_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_init_nest_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_nest_lock_kind) nvar
           end subroutine omp_init_nest_lock
 
           subroutine omp_destroy_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_nest_lock_kind) nvar
           end subroutine omp_destroy_nest_lock
 
           subroutine omp_set_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_set_nest_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_nest_lock_kind) nvar
           end subroutine omp_set_nest_lock
 
           subroutine omp_unset_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_unset_nest_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_nest_lock_kind) nvar
           end subroutine omp_unset_nest_lock
 
           function omp_test_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_test_nest_lock
 !DIR$ ENDIF
+#endif
             use omp_lib_kinds
             integer (kind=omp_integer_kind) omp_test_nest_lock
             integer (kind=omp_nest_lock_kind) nvar
@@ -568,20 +625,20 @@
           end subroutine omp_display_env
 
           function omp_target_alloc(size, device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
             type(c_ptr) omp_target_alloc
             integer(c_size_t), value :: size
             integer(c_int), value :: device_num
           end function omp_target_alloc
 
           subroutine omp_target_free(device_ptr, device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_int
             type(c_ptr), value :: device_ptr
             integer(c_int), value :: device_num
           end subroutine omp_target_free
 
           function omp_target_is_present(ptr, device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_int
             integer(c_int) omp_target_is_present
             type(c_ptr), value :: ptr
             integer(c_int), value :: device_num
@@ -589,7 +646,7 @@
 
           function omp_target_memcpy(dst, src, length, dst_offset, src_offset, &
               dst_device_num, src_device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
             integer(c_int) omp_target_memcpy
             type(c_ptr), value :: dst, src
             integer(c_size_t), value :: length, dst_offset, src_offset
@@ -599,7 +656,7 @@
           function omp_target_memcpy_rect(dst, src, element_size, num_dims,    &
               volume, dst_offsets, src_offsets, dst_dimensions,                &
               src_dimensions, dst_device_num, src_device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
             integer(c_int) omp_target_memcpy_rect
             type(c_ptr), value :: dst, src
             integer(c_size_t), value :: element_size
@@ -612,6 +669,7 @@
               src_offset, dst_device_num, src_device_num, depobj_count,        &
               depobj_list) bind(c)
             use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
             integer(c_int) omp_target_memcpy_async
             type(c_ptr), value :: dst, src
             integer(c_size_t), value :: length, dst_offset, src_offset
@@ -625,6 +683,7 @@
               src_dimensions, dst_device_num, src_device_num, depobj_count,    &
               depobj_list) bind(c)
             use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
             integer(c_int) omp_target_memcpy_rect_async
             type(c_ptr), value :: dst, src
             integer(c_size_t), value :: element_size
@@ -646,8 +705,8 @@
 
           function omp_target_memset_async(ptr, val, count, device_num, &
                                            depobj_count, depobj_list) bind(c)
-            use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
             use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
             type(c_ptr) :: omp_target_memset_async
             type(c_ptr), value :: ptr
             integer(c_int), value :: val
@@ -659,7 +718,7 @@
 
           function omp_target_associate_ptr(host_ptr, device_ptr, size,        &
               device_offset, device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
             integer(c_int) omp_target_associate_ptr
             type(c_ptr), value :: host_ptr, device_ptr
             integer(c_size_t), value :: size, device_offset
@@ -667,21 +726,20 @@
           end function omp_target_associate_ptr
 
           function omp_get_mapped_ptr(ptr, device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_int
             type(c_ptr) omp_get_mapped_ptr
             type(c_ptr), value :: ptr
             integer(c_int), value :: device_num
           end function omp_get_mapped_ptr
 
           function omp_target_disassociate_ptr(ptr, device_num) bind(c)
-            use omp_lib_kinds
+            use, intrinsic :: iso_c_binding, only: c_ptr, c_int
             integer(c_int) omp_target_disassociate_ptr
             type(c_ptr), value :: ptr
             integer(c_int), value :: device_num
           end function omp_target_disassociate_ptr
 
           function omp_target_is_accessible(ptr, size, device_num) bind(c)
-            use omp_lib_kinds
             use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t, c_int
             integer(c_int) omp_target_is_accessible
             type(c_ptr), value :: ptr
@@ -900,4 +958,124 @@
 
         end interface
 
+        ! make the above routine definitions public
+        public :: omp_set_num_threads
+        public :: omp_set_dynamic
+        public :: omp_set_nested
+        public :: omp_get_num_threads
+        public :: omp_get_max_threads
+        public :: omp_get_thread_num
+        public :: omp_get_num_procs
+        public :: omp_in_parallel
+        public :: omp_in_final
+        public :: omp_get_dynamic
+        public :: omp_get_nested
+        public :: omp_get_thread_limit
+        public :: omp_set_max_active_levels
+        public :: omp_get_max_active_levels
+        public :: omp_get_level
+        public :: omp_get_active_level
+        public :: omp_get_ancestor_thread_num
+        public :: omp_get_team_size
+        public :: omp_set_schedule
+        public :: omp_get_schedule
+        public :: omp_get_proc_bind
+        public :: omp_get_num_places
+        public :: omp_get_place_num_procs
+        public :: omp_get_place_proc_ids
+        public :: omp_get_place_num
+        public :: omp_get_partition_num_places
+        public :: omp_get_partition_place_nums
+        public :: omp_get_wtime
+        public :: omp_get_wtick
+        public :: omp_get_default_device
+        public :: omp_set_default_device
+        public :: omp_get_num_devices
+        public :: omp_get_num_teams
+        public :: omp_get_team_num
+        public :: omp_get_cancellation
+        public :: omp_is_initial_device
+        public :: omp_get_initial_device
+        public :: omp_get_device_num
+        public :: omp_pause_resource
+        public :: omp_pause_resource_all
+        public :: omp_get_supported_active_levels
+        public :: omp_fulfill_event
+        public :: omp_init_lock
+        public :: omp_destroy_lock
+        public :: omp_set_lock
+        public :: omp_unset_lock
+        public :: omp_test_lock
+        public :: omp_init_nest_lock
+        public :: omp_destroy_nest_lock
+        public :: omp_set_nest_lock
+        public :: omp_unset_nest_lock
+        public :: omp_test_nest_lock
+        public :: omp_get_max_task_priority
+        public :: omp_init_lock_with_hint
+        public :: omp_init_nest_lock_with_hint
+        public :: omp_control_tool
+        public :: omp_init_allocator
+        public :: omp_destroy_allocator
+        public :: omp_set_default_allocator
+        public :: omp_get_default_allocator
+        public :: omp_set_affinity_format
+        public :: omp_get_affinity_format
+        public :: omp_display_affinity
+        public :: omp_capture_affinity
+        public :: omp_set_num_teams
+        public :: omp_get_max_teams
+        public :: omp_set_teams_thread_limit
+        public :: omp_get_teams_thread_limit
+        public :: omp_display_env
+        public :: omp_target_alloc
+        public :: omp_target_free
+        public :: omp_target_is_present
+        public :: omp_target_memcpy
+        public :: omp_target_memcpy_rect
+        public :: omp_target_memcpy_async
+        public :: omp_target_memcpy_rect_async
+        public :: omp_target_memset
+        public :: omp_target_memset_async
+        public :: omp_target_associate_ptr
+        public :: omp_get_mapped_ptr
+        public :: omp_target_disassociate_ptr
+        public :: omp_target_is_accessible
+        public :: omp_alloc
+        public :: omp_aligned_alloc
+        public :: omp_calloc
+        public :: omp_aligned_calloc
+        public :: omp_realloc
+        public :: omp_free
+        public :: omp_in_explicit_task
+        public :: kmp_set_stacksize
+        public :: kmp_set_stacksize_s
+        public :: kmp_set_blocktime
+        public :: kmp_set_library_serial
+        public :: kmp_set_library_turnaround
+        public :: kmp_set_library_throughput
+        public :: kmp_set_library
+        public :: kmp_set_defaults
+        public :: kmp_get_stacksize
+        public :: kmp_get_stacksize_s
+        public :: kmp_get_blocktime
+        public :: kmp_get_library
+        public :: kmp_set_disp_num_buffers
+        public :: kmp_set_affinity
+        public :: kmp_get_affinity
+        public :: kmp_get_affinity_max_proc
+        public :: kmp_create_affinity_mask
+        public :: kmp_destroy_affinity_mask
+        public :: kmp_set_affinity_mask_proc
+        public :: kmp_unset_affinity_mask_proc
+        public :: kmp_get_affinity_mask_proc
+        public :: kmp_malloc
+        public :: kmp_aligned_malloc
+        public :: kmp_calloc
+        public :: kmp_realloc
+        public :: kmp_free
+        public :: kmp_set_warnings_on
+        public :: kmp_set_warnings_off
+        public :: kmp_get_cancellation_status
+
       end module omp_lib
diff --git a/runtime/src/include/omp_lib.h.var b/runtime/src/include/omp_lib.h.var
index 617f232..a709a2f 100644
--- a/runtime/src/include/omp_lib.h.var
+++ b/runtime/src/include/omp_lib.h.var
@@ -486,82 +486,102 @@
         end subroutine omp_fulfill_event
 
         subroutine omp_init_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_init_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_lock_kind) svar
         end subroutine omp_init_lock
 
         subroutine omp_destroy_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_destroy_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_lock_kind) svar
         end subroutine omp_destroy_lock
 
         subroutine omp_set_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_set_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_lock_kind) svar
         end subroutine omp_set_lock
 
         subroutine omp_unset_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_unset_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_lock_kind) svar
         end subroutine omp_unset_lock
 
         function omp_test_lock(svar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_test_lock
 !DIR$ ENDIF
+#endif
           import
           logical (kind=omp_logical_kind) omp_test_lock
           integer (kind=omp_lock_kind) svar
         end function omp_test_lock
 
         subroutine omp_init_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_init_nest_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_nest_lock_kind) nvar
         end subroutine omp_init_nest_lock
 
         subroutine omp_destroy_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_nest_lock_kind) nvar
         end subroutine omp_destroy_nest_lock
 
         subroutine omp_set_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_set_nest_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_nest_lock_kind) nvar
         end subroutine omp_set_nest_lock
 
         subroutine omp_unset_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_unset_nest_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_nest_lock_kind) nvar
         end subroutine omp_unset_nest_lock
 
         function omp_test_nest_lock(nvar) bind(c)
+#ifdef __INTEL_COMPILER
 !DIR$ IF(__INTEL_COMPILER.GE.1400)
 !DIR$ attributes known_intrinsic :: omp_test_nest_lock
 !DIR$ ENDIF
+#endif
           import
           integer (kind=omp_integer_kind) omp_test_nest_lock
           integer (kind=omp_nest_lock_kind) nvar
@@ -990,6 +1010,7 @@
         end subroutine kmp_set_warnings_off
       end interface
 
+#ifdef __INTEL_COMPILER
 !DIR$ IF DEFINED (__INTEL_OFFLOAD)
 
 !DIR$ IF(__INTEL_COMPILER.LT.1900)
@@ -1158,3 +1179,4 @@
 !$omp declare target(omp_init_nest_lock_with_hint )
 !DIR$ ENDIF
 !DIR$ ENDIF
+#endif