MantisBT - CMake
View Issue Details
0015576CMakeCMakepublic2015-05-20 10:412015-11-02 09:15
Michael Scott 
Brad King 
normalblockalways
closedfixed 
HP-UX IA64HP-UXB.11.23
CMake 3.2.2 
CMake 3.3CMake 3.3 
0015576: cannot build CMake on old versions of HP-UX IA64
Cannot build CMake 3.2.2 on old versions of HP-UX (IA64), as isfinite, used in cmjsoncpp/json_writer.cpp, is not defined for this platform.

I can see a fix is proposed in the following commit http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b1cdb00 [^] , however this commit doesn't work for IA64 HP-UX platforms, in this case isfinite should be defined as _Isfinite I believe. A quick test with that change allows me to get past that section.

Download CMake version 3.2.2 source, attempt to build on a HP-UX IA64 machine running version B.11.23
No tags attached.
Issue History
2015-05-20 10:41Michael ScottNew Issue
2015-05-20 10:51Brad KingNote Added: 0038779
2015-05-20 10:53Brad KingNote Added: 0038781
2015-05-20 12:14Michael ScottNote Added: 0038783
2015-05-20 12:52Brad KingNote Added: 0038784
2015-05-21 16:20Michael ScottNote Added: 0038793
2015-05-24 04:56Michael ScottNote Added: 0038795
2015-05-24 05:24Michael ScottNote Edited: 0038795bug_revision_view_page.php?bugnote_id=38795#r1785
2015-05-26 10:13Brad KingNote Added: 0038801
2015-05-26 10:13Brad KingAssigned To => Brad King
2015-05-26 10:13Brad KingStatusnew => resolved
2015-05-26 10:13Brad KingResolutionopen => fixed
2015-05-26 10:13Brad KingFixed in Version => CMake 3.3
2015-05-26 10:13Brad KingTarget Version => CMake 3.3
2015-11-02 09:15Robert MaynardNote Added: 0039823
2015-11-02 09:15Robert MaynardStatusresolved => closed

Notes
(0038779)
Brad King   
2015-05-20 10:51   
FYI, we are only able to support platforms for which nightly testing submits to our dashboard:

 https://open.cdash.org/index.php?project=CMake [^]

Instructions to run a testing dashboard client are here:

 http://www.cmake.org/Wiki/CMake/Git/Dashboard [^]

Currently a few HP-UX versions and architecture combinations are submitting and are clean as of commit 594dd9b3 in 'master':

  B.11.11 9000/785 gcc
  B.11.11 9000/785 aCC
  B.11.23 ia64 aCC
  B.11.31 ia64 aCC

Some of these were only recently added and some post-3.2 fixes were made for them. Does our Git 'master' build for you? Do you have a different os/arch/compiler combination?
(0038781)
Brad King   
2015-05-20 10:53   
> B.11.11 9000/785 aCC

Actually this submission is only running the test suite but uses the gcc-built cmake binary because that compiler can no longer build CMake itself.
(0038783)
Michael Scott   
2015-05-20 12:14   
The compiler is HP gcc version 4.7.0. Uname reports "HP-UX B.11.23 U ia64" for the OS/Arch.

Building from the Git master gives me the same problem, with the error "'finite' was not declared in this scope".
(0038784)
Brad King   
2015-05-20 12:52   
Re 0015576:0038783: I don't have access to any of these system. Will you please propose a specific modification/patch to the preprocessor logic?
(0038793)
Michael Scott   
2015-05-21 16:20   
Sure I'll try and come up with a patch proposal over the next couple of days.

I've been trying to determine if it's an issue with HP-UX itself (the c/c++ library I guess?) or the GCC we're using, but the documentation available isn't great and the behaviour is odd (using isfinite with gcc is fine, but using it with g++ isn't).

Thanks for the quick replies by the way, great support for CMake!
(0038795)
Michael Scott   
2015-05-24 04:56   
(edited on: 2015-05-24 05:24)
Looking at the math.h which its including from /usr/include/math.h, I can see why its not picking up isfinite...

# if defined(_PA_RISC) || !defined(__cplusplus)
...
# define isfinite(x) _ISFINITE(x)

I'm guessing its a bug and it assumes that c++ code will use cmath (which works on this server) instead of math.h.

Could the following change be made to the CMake cpp file?

BEFORE:
// HP-UX
#if defined(__hpux)
# if !defined(isfinite)
# define isfinite finite
# endif
#endif

AFTER:
// HP-UX
#if defined(__hpux)
# if !defined(isfinite)
// Some versions of HP-UX don't define isfinite in math.h for C++ Itanium, so we
// have to use the internal version instead
# if defined(__ia64) && !defined(finite)
# define isfinite(x) (sizeof(x) == sizeof(float) ? _Isfinitef(x) : _Isfinite(x))
# else
# define isfinite finite
# endif
# endif
#endif

(0038801)
Brad King   
2015-05-26 10:13   
Re 0015576:0038795: Thanks. Applied:

 jsoncpp: Provide 'isfinite' impl on more HP-UX versions
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9217b678 [^]
(0039823)
Robert Maynard   
2015-11-02 09:15   
Closing resolved issues that have not been updated in more than 4 months.