Problem with HDF5 1.10 and compatibility macros

Hi folks,
  I have a little problem with HDF5 1.10 and its compatibility macros. I
have a local installation
of the HDF5 (1.10) library and want to link a legacy application with it.
The application requires the 1.8 API so I use -DH5_USE_18_API. However,
I always get the
same error during the build

hdf5/1.10/include/H5version.h:25:4: error: #error "Can't choose old API
versions when deprecated APIs are disabled"
   #error "Can't choose old API versions when deprecated APIs are disabled"

though the HDF5 library is compiled and installed with deprecated
symbols enabled.

        SUMMARY OF THE HDF5 CONFIGURATION

···

=================================

General Information:
-------------------
                   HDF5 Version: 1.10.0
                  Configured on: Thu May 19 15:03:49 CEST 2016
                  Configured by: wintersb@haso228w1
                    Host system: x86_64-unknown-linux-gnu
              Uname information: Linux haso228w1 3.16.0-4-amd64 #1 SMP
Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
                       Byte sex: little-endian
             Installation point: /home/wintersb/Development/hdf5/1.10

Compiling Options:
------------------
                     Build Mode: production
              Debugging Symbols: no
                        Asserts: no
                      Profiling: no
             Optimization Level: high

Linking Options:
----------------
                      Libraries: static, shared
  Statically Linked Executables:
                        LDFLAGS:
                     H5_LDFLAGS:
                     AM_LDFLAGS:
                Extra libraries: -lz -ldl -lm
                       Archiver: ar
                         Ranlib: ranlib

Languages:
----------
                              C: yes
                     C Compiler: /usr/bin/gcc
                       CPPFLAGS:
                    H5_CPPFLAGS: -D_GNU_SOURCE
-D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API
                    AM_CPPFLAGS:
                        C Flags:
                     H5 C Flags: -std=c99 -pedantic -Wall -Wextra
-Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual
-Wcast-align -Wwrite-strings -Wconversion -Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wredundant-decls -Wnested-externs -Winline -Wfloat-equal
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked
-Wdisabled-optimization -Wformat=2 -Wunreachable-code -Wendif-labels
-Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch
-Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default
-Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat
-Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand
-Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5
-Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion
-Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192
-Wvector-operation-performance -Wsuggest-attribute=pure
-Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wdate-time
-Wopenmp-simd -s -O3
                     AM C Flags:
               Shared C Library: yes
               Static C Library: yes

                        Fortran: yes
               Fortran Compiler: /usr/bin/gfortran
                  Fortran Flags:
               H5 Fortran Flags: -pedantic -Wall -Wextra -Wunderflow
-Wimplicit-interface -Wsurprising -Wno-c-binding-type -s -O2
               AM Fortran Flags:
         Shared Fortran Library: yes
         Static Fortran Library: yes

                            C++: yes
                   C++ Compiler: /usr/bin/g++
                      C++ Flags:
                   H5 C++ Flags: -pedantic -Wall -Wextra -Wundef
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Wconversion -Waggregate-return -Wredundant-decls -Winline -Wsign-promo
-Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder
-Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi -Wfloat-equal
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked
-Wdisabled-optimization -Wformat=2 -Wendif-labels -Winvalid-pch
-Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default
-Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations
-Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand
-Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5
-Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines
-Wstack-usage=8192 -Wvector-operation-performance
-Wsuggest-attribute=pure -Wsuggest-attribute=noreturn
-Wsuggest-attribute=format -Wdate-time -Wopenmp-simd -s -O3
                   AM C++ Flags:
             Shared C++ Library: yes
             Static C++ Library: yes

                           Java: no

Features:
---------
                  Parallel HDF5: no
             High-level library: yes
                   Threadsafety: no
            Default API mapping: v110
With deprecated public symbols: yes
         I/O filters (external): deflate(zlib)
                            MPE: no
                     Direct VFD: no
                        dmalloc: no
Packages w/ extra debug output: none
                    API tracing: no
           Using memory checker: no
Memory allocation sanity checks: no
            Metadata trace file: no
         Function stack tracing: no
      Strict file format checks: no
   Optimization instrumentation: no

Any idea what I am doing wrong?
Best regards and thanks in advance.

Eugen

--
Dr. Eugen Wintersberger

FS-EC
DESY
Notkestr. 85
D-22607 Hamburg
Germany

E-Mail: eugen.wintersberger@desy.de
Telefon: +49-40-8998-1917

Hi Eugen,

Sorry… No clue. We will need to reproduce it here. The report is timely because we were going to release patch1 in a two weeks.

If you don’t use -DH5_USE_18_API when building the application, how the build will fail?

Thank you!

Elena

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On May 19, 2016, at 8:05 AM, Eugen Wintersberger <eugen.wintersberger@desy.de> wrote:

Hi folks,
I have a little problem with HDF5 1.10 and its compatibility macros. I
have a local installation
of the HDF5 (1.10) library and want to link a legacy application with it.
The application requires the 1.8 API so I use -DH5_USE_18_API. However,
I always get the
same error during the build

hdf5/1.10/include/H5version.h:25:4: error: #error "Can't choose old API
versions when deprecated APIs are disabled"
  #error "Can't choose old API versions when deprecated APIs are disabled"

though the HDF5 library is compiled and installed with deprecated
symbols enabled.

       SUMMARY OF THE HDF5 CONFIGURATION
       =================================

General Information:
-------------------
                  HDF5 Version: 1.10.0
                 Configured on: Thu May 19 15:03:49 CEST 2016
                 Configured by: wintersb@haso228w1
                   Host system: x86_64-unknown-linux-gnu
             Uname information: Linux haso228w1 3.16.0-4-amd64 #1 SMP
Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
                      Byte sex: little-endian
            Installation point: /home/wintersb/Development/hdf5/1.10

Compiling Options:
------------------
                    Build Mode: production
             Debugging Symbols: no
                       Asserts: no
                     Profiling: no
            Optimization Level: high

Linking Options:
----------------
                     Libraries: static, shared
Statically Linked Executables:
                       LDFLAGS:
                    H5_LDFLAGS:
                    AM_LDFLAGS:
               Extra libraries: -lz -ldl -lm
                      Archiver: ar
                        Ranlib: ranlib

Languages:
----------
                             C: yes
                    C Compiler: /usr/bin/gcc
                      CPPFLAGS:
                   H5_CPPFLAGS: -D_GNU_SOURCE
-D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API
                   AM_CPPFLAGS:
                       C Flags:
                    H5 C Flags: -std=c99 -pedantic -Wall -Wextra
-Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual
-Wcast-align -Wwrite-strings -Wconversion -Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wredundant-decls -Wnested-externs -Winline -Wfloat-equal
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked
-Wdisabled-optimization -Wformat=2 -Wunreachable-code -Wendif-labels
-Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch
-Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default
-Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat
-Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand
-Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5
-Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion
-Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192
-Wvector-operation-performance -Wsuggest-attribute=pure
-Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wdate-time
-Wopenmp-simd -s -O3
                    AM C Flags:
              Shared C Library: yes
              Static C Library: yes

                       Fortran: yes
              Fortran Compiler: /usr/bin/gfortran
                 Fortran Flags:
              H5 Fortran Flags: -pedantic -Wall -Wextra -Wunderflow
-Wimplicit-interface -Wsurprising -Wno-c-binding-type -s -O2
              AM Fortran Flags:
        Shared Fortran Library: yes
        Static Fortran Library: yes

                           C++: yes
                  C++ Compiler: /usr/bin/g++
                     C++ Flags:
                  H5 C++ Flags: -pedantic -Wall -Wextra -Wundef
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Wconversion -Waggregate-return -Wredundant-decls -Winline -Wsign-promo
-Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder
-Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi -Wfloat-equal
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked
-Wdisabled-optimization -Wformat=2 -Wendif-labels -Winvalid-pch
-Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default
-Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations
-Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand
-Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5
-Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines
-Wstack-usage=8192 -Wvector-operation-performance
-Wsuggest-attribute=pure -Wsuggest-attribute=noreturn
-Wsuggest-attribute=format -Wdate-time -Wopenmp-simd -s -O3
                  AM C++ Flags:
            Shared C++ Library: yes
            Static C++ Library: yes

                          Java: no

Features:
---------
                 Parallel HDF5: no
            High-level library: yes
                  Threadsafety: no
           Default API mapping: v110
With deprecated public symbols: yes
        I/O filters (external): deflate(zlib)
                           MPE: no
                    Direct VFD: no
                       dmalloc: no
Packages w/ extra debug output: none
                   API tracing: no
          Using memory checker: no
Memory allocation sanity checks: no
           Metadata trace file: no
        Function stack tracing: no
     Strict file format checks: no
  Optimization instrumentation: no

Any idea what I am doing wrong?
Best regards and thanks in advance.

Eugen

--
Dr. Eugen Wintersberger

FS-EC
DESY
Notkestr. 85
D-22607 Hamburg
Germany

E-Mail: eugen.wintersberger@desy.de
Telefon: +49-40-8998-1917

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Eugen,

I cannot reproduce the behavior.

Could you please check H5pubconf.h in your installation and confirm that the H5_NO_DEPRECATED_SYMBOLS symbol is not defined.
If it is not, would you be able to share your application or create a short program to reproduce the issue?

Thank you!

Elena

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On May 19, 2016, at 8:05 AM, Eugen Wintersberger <eugen.wintersberger@desy.de> wrote:

Hi folks,
I have a little problem with HDF5 1.10 and its compatibility macros. I
have a local installation
of the HDF5 (1.10) library and want to link a legacy application with it.
The application requires the 1.8 API so I use -DH5_USE_18_API. However,
I always get the
same error during the build

hdf5/1.10/include/H5version.h:25:4: error: #error "Can't choose old API
versions when deprecated APIs are disabled"
  #error "Can't choose old API versions when deprecated APIs are disabled"

though the HDF5 library is compiled and installed with deprecated
symbols enabled.

       SUMMARY OF THE HDF5 CONFIGURATION
       =================================

General Information:
-------------------
                  HDF5 Version: 1.10.0
                 Configured on: Thu May 19 15:03:49 CEST 2016
                 Configured by: wintersb@haso228w1
                   Host system: x86_64-unknown-linux-gnu
             Uname information: Linux haso228w1 3.16.0-4-amd64 #1 SMP
Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
                      Byte sex: little-endian
            Installation point: /home/wintersb/Development/hdf5/1.10

Compiling Options:
------------------
                    Build Mode: production
             Debugging Symbols: no
                       Asserts: no
                     Profiling: no
            Optimization Level: high

Linking Options:
----------------
                     Libraries: static, shared
Statically Linked Executables:
                       LDFLAGS:
                    H5_LDFLAGS:
                    AM_LDFLAGS:
               Extra libraries: -lz -ldl -lm
                      Archiver: ar
                        Ranlib: ranlib

Languages:
----------
                             C: yes
                    C Compiler: /usr/bin/gcc
                      CPPFLAGS:
                   H5_CPPFLAGS: -D_GNU_SOURCE
-D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API
                   AM_CPPFLAGS:
                       C Flags:
                    H5 C Flags: -std=c99 -pedantic -Wall -Wextra
-Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual
-Wcast-align -Wwrite-strings -Wconversion -Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wredundant-decls -Wnested-externs -Winline -Wfloat-equal
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked
-Wdisabled-optimization -Wformat=2 -Wunreachable-code -Wendif-labels
-Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch
-Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default
-Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat
-Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand
-Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5
-Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion
-Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192
-Wvector-operation-performance -Wsuggest-attribute=pure
-Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wdate-time
-Wopenmp-simd -s -O3
                    AM C Flags:
              Shared C Library: yes
              Static C Library: yes

                       Fortran: yes
              Fortran Compiler: /usr/bin/gfortran
                 Fortran Flags:
              H5 Fortran Flags: -pedantic -Wall -Wextra -Wunderflow
-Wimplicit-interface -Wsurprising -Wno-c-binding-type -s -O2
              AM Fortran Flags:
        Shared Fortran Library: yes
        Static Fortran Library: yes

                           C++: yes
                  C++ Compiler: /usr/bin/g++
                     C++ Flags:
                  H5 C++ Flags: -pedantic -Wall -Wextra -Wundef
-Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Wconversion -Waggregate-return -Wredundant-decls -Winline -Wsign-promo
-Woverloaded-virtual -Wold-style-cast -Weffc++ -Wreorder
-Wnon-virtual-dtor -Wctor-dtor-privacy -Wabi -Wfloat-equal
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked
-Wdisabled-optimization -Wformat=2 -Wendif-labels -Winvalid-pch
-Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default
-Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations
-Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand
-Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5
-Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines
-Wstack-usage=8192 -Wvector-operation-performance
-Wsuggest-attribute=pure -Wsuggest-attribute=noreturn
-Wsuggest-attribute=format -Wdate-time -Wopenmp-simd -s -O3
                  AM C++ Flags:
            Shared C++ Library: yes
            Static C++ Library: yes

                          Java: no

Features:
---------
                 Parallel HDF5: no
            High-level library: yes
                  Threadsafety: no
           Default API mapping: v110
With deprecated public symbols: yes
        I/O filters (external): deflate(zlib)
                           MPE: no
                    Direct VFD: no
                       dmalloc: no
Packages w/ extra debug output: none
                   API tracing: no
          Using memory checker: no
Memory allocation sanity checks: no
           Metadata trace file: no
        Function stack tracing: no
     Strict file format checks: no
  Optimization instrumentation: no

Any idea what I am doing wrong?
Best regards and thanks in advance.

Eugen

--
Dr. Eugen Wintersberger

FS-EC
DESY
Notkestr. 85
D-22607 Hamburg
Germany

E-Mail: eugen.wintersberger@desy.de
Telefon: +49-40-8998-1917

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5