This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,588 Users
  • 2,269,776 Discussions
  • 7,916,825 Comments

Discussions

12.6beta tested for compatibility with Howard Hinnant's date and time library

user13420336
user13420336 Member Posts: 9

Has 12.6beta been tested in building Howard Hinnant's date and time library?

I tried building the library using 12.5 without success.

Answers

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited May 25, 2017 10:21AM

    We do not test with that library.

    I can't speak about that library in particular, but most problems building open source with Studio are due to Studio not being recognized, or being used with incorrect command-line options, or using workarounds for old Studio compilers that are no longer appropriate.

    Look for conditional code like

    #if <apple>

    ...

    #elif <gnu>

    ...

    #elif <microsoft>

    ...

    #endif // Studio is none of the above

    Also look for conditional code like

    #If <studio>

    ... non-standard code that doesn't work with modern Studio compilers

    #else

    ... standard code

    #endif

    If you post specific problems, I might be able to help.

  • user13420336
    user13420336 Member Posts: 9
    edited May 25, 2017 10:22PM

    Hi,

    Howard Hinnant's date and time library is a proposed extension to the std::chrono library which enables C++ to handle calendars and timezones.

    The one I'm using is his proof-of-concept implementation which is reliant on a compiler which has high C++14 compliance.

    I was attempting to build the library with Developer Studio 12.5 in C++14 mode and providing feedback to Howard Hinnant himself.  However, I got stuck and unable to figure out the issues the compiler was complaining about.  I'm hoping that a newer version of the compiler with better C++14 compliance will resolve the issues.

    BTW, my own library is dependent on C++14 features thus I decided to wait until Developer Studio's C++14 compliance gets better thus I will get back to it once you release Developer Studio 12.6.

  • user13420336
    user13420336 Member Posts: 9
    edited Aug 2, 2017 10:05PM

    Hi,

    I have tried building Howard Hinnant's date and time library again with Developer Studio 12.6.

    According to the built-in macros with the C++ compiler in this version of Developer Studio, it is C++14 compliant however it still unsuccessfully builds the said library.

    This library checks the value of __cplusplus to determine its constexpr awareness and it seems to be picking up the correct branch in the code.

    I would love to supply a .tar.gz file that contains everything I'm using to do the abovementioned build but could not figure out how to attach it to this message.

    Kind regards,

    Leo

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Aug 3, 2017 10:19AM

    As shown in the "What's New" document for Studio 12.5,

    https://docs.oracle.com/cd/E60778_01/html/E60742/gncix.html#scrolltoc

    support was available only for only a few minor C++14 features.

    Studio 12.6 nominally provides full support for C++14, but some features have bugs. Some bugs did not show up until it was too late to fix them for the release. You might be running into a one of them. Or this library might trigger a bug we haven't yet seen.

    I'll talk with Howard directly and see what we can find out.

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Aug 3, 2017 12:44PM

    You didn't say what parts of the library you tried, so I downloaded the current master version and tried two simple test cases, with the following results.

    1. Oracle Developer Studio compilers predefine by default some nonstandard macros, "sun" in particular, which conflicts with an identifier in the source code.

    Solution: Compile with the "+p" option, which prevents macros in the user's namespace from being predefined.

    2. "date.h" seems to work in C++11 mode, but not in C++14 mode, due to bugs in the compiler's handling of constexpr. We plan to fix the constexpr bugs.

    3. Compiling tz.cpp in C++11 mode ran into an error with one of the standard C++ headers. Either we have an issue with our version of the g++ headers, or there is a compiler bug. Due to this problem, I did not try C++14 mode. I will file an internal bug for the header problem.

  • user13420336
    user13420336 Member Posts: 9
    edited Aug 3, 2017 5:56PM

    I was trying to build tz.cpp into a shared library using C++14 mode and as you mentioned, my build was having constexpr issues in relation to the weekday constants in date.h and in some other areas.

    When I try C++11 mode, another issue shows up to do with std::enable_if_t.

    You mentioned the sun macro.  This was why I couldn't figure out why my build was having issues with the definition of the constant for Sunday.

  • user13420336
    user13420336 Member Posts: 9
    edited Aug 3, 2017 6:10PM

    Forget my comment concerning std::enable_if_t.  That was me making the wrong changes in the source code.

    However, I tried +p option and compiled in C++11 mode and the only issue I found is to do with tuple/unique_ptr in tz.cpp.

    I hope we had observed the same issue.

    Will the fixes be issued as a patch or will go into the next release?

  • Steve.Clamage-Oracle
    Steve.Clamage-Oracle Oracle Studio C++ Project Lead Santa Clara, CA, USAMember Posts: 775
    edited Aug 4, 2017 12:11PM

    Compiling tz.cpp in C++11 mode, I found 3 errors similar to this one:

    "/.../CC-gcc/include/c++/5.4.0/tuple", line 62: Error: Using deleted function 'date::{lambda at tz.cpp,2620:33}::<constructor>()'.

    These errors are due to a compiler bug not previously seen.

    I did not try C++14 mode, since tz won't compile anyway, and we have known constexpr issues to fix.

    If you have a Studio service contract with Oracle, you can request via your support channel that all bugs preventing compilation of the date library be fixed in a patch.

    We hope to fix these bugs anyway, but Oracle policy does not allow me to be more specific.

  • user13420336
    user13420336 Member Posts: 9
    edited Aug 6, 2017 12:20AM

    FYI, Howard Hinnant has made the necessary changes to the library based on feedback supplied to him to allow the library to build correctly in either C++11 or C++14 modes with Developer Studio 12.6 on Oracle 11.3 x86_64.

This discussion has been closed.