HowardHinnant / date

A date and time library based on the C++11/14/17 <chrono> header
Other
3.07k stars 669 forks source link

Missing tz.h header file when selecting compiler for ARM architecture #820

Open cdfq384903 opened 3 months ago

cdfq384903 commented 3 months ago

Hi Howard! I'm encountering an issue while compiling code for the ARM architecture. Currently, I'm using bitbake for cross-compilation. Following the steps below to build, I noticed that the tz.h file is missing under /usr/local/include. Could you please advise on what adjustments might be needed? Below are the steps I followed to reproduce the issue:

  1. wget https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.1.tar.gz
  2. tar -xvf v3.0.1.tar.gz
  3. cd date-3.0.1/
  4. Added compiler settings in CMakeLists.txt(the detail show on figure below)
  5. Build the project 5.1 mkdir build && cd build 5.2 cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ && make -j4 5.3 sudo make install 5.4 sudo ldconfig The result is as shown in the attached image.

螢幕擷取畫面 2024-03-12 163500 [the information which add on CMakeLists.txt]

S__8503374 [the result after compiler and build]

BTW the figure as show below was on X86 architecture compiler and build and the result was perfect. S__8503373

Thank you.

HowardHinnant commented 3 months ago

Hi. I'm afraid the CMake files have fallen into disrepair, and I do not have the expertise to maintain them.

Here are the build instructions I recommend: https://howardhinnant.github.io/date/tz.html#Installation

Also I recommend the master branch tip-of-trunk. It is kept in a shippable state, and will have all of the latest bug fixes.

Finally, when gcc-14 ships, and you are able to upgrade to it, I recommend migrating from this library to C++20's std::chrono.