[emos] 14/37: Add shared libs patch; remove emosnum

Alastair McKinstry mckinstry at moszumanska.debian.org
Sat Jun 27 08:14:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch master
in repository emos.

commit 31ee117e042e5641a928952cfbf662c588b852e4
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Mon May 25 11:00:00 2015 +0100

    Add shared libs patch; remove emosnum
---
 debian/patches/emosnum.patch | 145 -------------------------------------------
 debian/patches/series        |   2 +-
 debian/patches/shared.patch  | 104 +++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 146 deletions(-)

diff --git a/debian/patches/emosnum.patch b/debian/patches/emosnum.patch
deleted file mode 100644
index 0b9239e..0000000
--- a/debian/patches/emosnum.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-Author: Alastair McKinstry <mckinstry at debian.org>
-Description: An emosnum function is required for the shared library to work.
- Referred to elsewhere in the code
-Last-Updated: 2015-05-17
-Forwarded: no
-
-Index: emoslib-000403+dfsg.1/gribex/emosnum.F
-===================================================================
---- /dev/null
-+++ emoslib-000403+dfsg.1/gribex/emosnum.F
-@@ -0,0 +1,122 @@
-+C Copyright 1981-2007 ECMWF
-+C 
-+C Licensed under the GNU Lesser General Public License which
-+C incorporates the terms and conditions of version 3 of the GNU
-+C General Public License.
-+C See LICENSE and gpl-3.0.txt for details.
-+C
-+
-+      INTEGER FUNCTION EMOSNUM(KONOFF)
-+C
-+C---->
-+C**** EMOSNUM
-+C
-+C     Purpose
-+C     -------
-+C
-+C     Returns current EMOSLIB version number.
-+C
-+C
-+C     Interface
-+C     ---------
-+C
-+C     INUM = EMOSNUM(KONOFF)
-+C
-+C     Input
-+C     -----
-+C
-+C     KONOFF - switch for displayed message
-+C              = 0 if display is required on the first call
-+C              = non-zero if display is not required
-+C
-+C
-+C     Output
-+C     ------
-+C
-+C     Returns a 6-digit version number, aaabbc, where:
-+C       aaa = 3-digit major number
-+C       bb  = 2-digit minor number
-+C       c   = 1-digit spare number (normally 0)
-+C     
-+C
-+C     Method
-+C     ------
-+C
-+C     Reads a 6-digit version number from the environment variable
-+C     EMOS_CYCLE. If this does not give a 6-digit number, an internal
-+C     hard-coded default value is used.
-+C
-+C     On the first call, the function (optionally) displays a message:
-+C
-+C       ***********************************
-+C       * EMOSLIB version number = aaabbc *
-+C       ***********************************
-+C     
-+C
-+C     Externals
-+C     ---------
-+C
-+C     None.
-+C     
-+C
-+C     Author
-+C     ------
-+C
-+C     J.D.Chambers     ECMWF     May 1998
-+C
-+C
-+C----<
-+C ------------------------------------------------------------------
-+C*    Section 0.   Variables.
-+C ------------------------------------------------------------------
-+C
-+C
-+      IMPLICIT NONE
-+C
-+#include "grprs.h"
-+C
-+C     Function arguments
-+C
-+      INTEGER KONOFF
-+C
-+C     Local variables
-+C
-+      INTEGER INUMBER, ICOUNT, IOFFSET
-+      SAVE INUMBER, ICOUNT
-+      CHARACTER*35 CMESS
-+      CHARACTER*20 YNUMBER
-+C
-+      DATA INUMBER/000382/, ICOUNT/0/
-+      DATA CMESS/'* EMOSLIB version number = ****** *'/
-+C
-+C ------------------------------------------------------------------
-+C*    Section 1.   Initialise
-+C ------------------------------------------------------------------
-+C
-+  100 CONTINUE
-+C
-+      IF( ICOUNT.EQ.0 ) THEN
-+C
-+C       See if the environment variable has an override value
-+C
-+        CALL GETENV( 'EMOS_CYCLE', YNUMBER)
-+        IOFFSET = INDEX( YNUMBER, ' ')
-+        IF( IOFFSET.EQ.7 ) THEN
-+          READ(YNUMBER,'(I6.6)') INUMBER
-+        ENDIF
-+C
-+C       First time through, display the message if required
-+C
-+        IF( KONOFF.EQ.0 ) THEN
-+          WRITE(CMESS(28:33),'(I6.6)') INUMBER
-+          WRITE(GRPRSM,*) '***********************************'
-+          WRITE(GRPRSM,*) CMESS
-+          WRITE(GRPRSM,*) '***********************************'
-+        ENDIF
-+        ICOUNT = 1
-+      ENDIF
-+C
-+      EMOSNUM = INUMBER
-+C
-+      RETURN
-+      END
-Index: emoslib-000403+dfsg.1/gribex/CMakeLists.txt
-===================================================================
---- emoslib-000403+dfsg.1.orig/gribex/CMakeLists.txt
-+++ emoslib-000403+dfsg.1/gribex/CMakeLists.txt
-@@ -125,6 +125,7 @@ list( APPEND gribex_src_files
-   eshsec2.F
-   esvsec2.F
-   emoscyc.F # not used anywhere and creates unref symbol
-+  emosnum.F
-   exscal.F
-   extmap.F
-   ftn1cr.F
diff --git a/debian/patches/series b/debian/patches/series
index a26bc6b..8674bd6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,4 +3,4 @@ bufrnum.patch
 pkgconfig.patch
 little_endian.patch
 wvqlid2.patch
-emosnum.patch
+shared.patch
diff --git a/debian/patches/shared.patch b/debian/patches/shared.patch
new file mode 100644
index 0000000..a15f668
--- /dev/null
+++ b/debian/patches/shared.patch
@@ -0,0 +1,104 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Description: Enable building shared libs in emoslib (cmake)
+ Build shared libs for emos. Significant changes needed for cmake-build,
+ but a cleaner patch than before.
+ Needs to build -fpic, -mcmodel=medium for shared, but preferably don't
+ for static, so build in separate dirs.
+Last-Update: 2015-05-25
+Forwarded: no
+
+Index: emoslib-000403+dfsg.1/libemos-sp-shared/CMakeLists.txt
+===================================================================
+--- /dev/null
++++ emoslib-000403+dfsg.1/libemos-sp-shared/CMakeLists.txt
+@@ -0,0 +1,24 @@
++foreach( _src ${libemos_srcs} )
++  add_custom_command(
++    OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/${_src}
++    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIBEMOS_BASE_DIR}/${_src} ${CMAKE_CURRENT_BINARY_DIR}/${_src}
++    COMMENT "copying ${_src} from emos (sp)"
++    DEPENDS ${LIBEMOS_BASE_DIR}/${_src} )
++  list( APPEND emos_sp_shared_srcs ${CMAKE_CURRENT_BINARY_DIR}/${_src} )
++endforeach()
++
++# excluding double-precision specific definitions
++
++list( REMOVE_ITEM LIBEMOS_DEFINITIONS REAL_8 REAL_BIGGER_THAN_INTEGER )
++
++# library
++
++set( CMAKE_Fortran_MODULE_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR} )
++include_directories( ${LIBEMOS_BASE_DIR}/interpolation ${LIBEMOS_BASE_DIR}/bufrdc_wmo )
++ecbuild_add_library(
++  TYPE SHARED
++  TARGET      emos_sp_shared
++  OUTPUT_NAME "emos"
++  DEFINITIONS ${LIBEMOS_DEFINITIONS}
++  SOURCES     ../libemos_version.c ${emos_sp_shared_srcs}
++  GENERATED   ../libemos_version.c )
++
++install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
++             libemos.so ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/libemos.R32.D64.I32.so)" )
+Index: emoslib-000403+dfsg.1/libemos-dp-shared/CMakeLists.txt
+===================================================================
+--- /dev/null
++++ emoslib-000403+dfsg.1/libemos-dp-shared/CMakeLists.txt
+@@ -0,0 +1,24 @@
++# configure Fortran-based targets for double precision (compilation & linking)
++
++set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${emos_double_precision_flags}")
++
++# library
++
++foreach( _src ${libemos_srcs} )
++  list( APPEND emos_dp_srcs ../${_src} )
++endforeach()
++
++set( CMAKE_Fortran_MODULE_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR} )
++
++include_directories( ${LIBEMOS_BASE_DIR}/interpolation ${LIBEMOS_BASE_DIR}/bufrdc_wmo )
++
++ecbuild_add_library(
++  TYPE SHARED
++  TARGET      emos_shared
++  OUTPUT_NAME "emosR64"
++  DEFINITIONS ${LIBEMOS_DEFINITIONS}
++  SOURCES     ../libemos_version.c ${emos_dp_shared_srcs}
++  GENERATED   ../libemos_version.c )
++
++install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
++              libemosR64.so ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/libemos.R64.D64.I32.so)" )
+Index: emoslib-000403+dfsg.1/CMakeLists.txt
+===================================================================
+--- emoslib-000403+dfsg.1.orig/CMakeLists.txt
++++ emoslib-000403+dfsg.1/CMakeLists.txt
+@@ -235,6 +235,8 @@ if( HAVE_SINGLE_PRECISION)
+   add_subdirectory( libemos-sp )
+ endif()
+ add_subdirectory( libemos-dp )
++add_subdirectory( libemos-sp-shared )
++add_subdirectory( libemos-dp-shared )
+ 
+ ecbuild_add_executable(
+   TARGET      libemos_version
+ install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
+Index: emoslib-000403+dfsg.1/cmake/ecbuild_add_library.cmake
+===================================================================
+--- emoslib-000403+dfsg.1.orig/cmake/ecbuild_add_library.cmake
++++ emoslib-000403+dfsg.1/cmake/ecbuild_add_library.cmake
+@@ -119,6 +119,15 @@ function( ecbuild_add_library_impl )
+ 
+ 		get_property( _target_pic TARGET ${_PAR_TARGET} PROPERTY POSITION_INDEPENDENT_CODE )
+ 		if( _target_pic )
++			if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
++				set( _PAR_CFLAGS "-fpic -mcmodel=medium  ${_PAR_CFLAGS}" )
++			endif()
++			if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
++				set( _PAR_CXXFLAGS "-fpic -mcmodel=medium  ${_PAR_CXXFLAGS}" )
++			endif()
++			if( "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" )
++				set( _PAR_FFLAGS "-fpic -mcmodel=medium  ${_PAR_FFLAGS}" )
++			endif()
+ 			if( "${CMAKE_C_COMPILER_ID}" STREQUAL "Cray" )
+ 				set( _PAR_CFLAGS "-fPIC -h PIC ${_PAR_CFLAGS}" )
+ 			endif()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/emos.git



More information about the debian-science-commits mailing list