Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • T Trilinos
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 936
    • Issues 936
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • James Willenbring
  • Trilinos
  • Issues
  • #1272
Closed
Open
Issue created Apr 27, 2017 by James Willenbring@jmwilleOwner

Trilinos config problem in FiniteValue.cmake and GCC 5.4.0

Created by: raovgarimella

Trilinos 12.6.1 and 12.10.1 configuration fails with gcc 5.4.0 and cmake 3.5.1 because of an issue with trilinos/cmake/tribits/core/config_tests/FiniteValue.cmake. The complaint is that "isnan was not declared in this scope".

Upon investigating further, it seems that FiniteValue.cmake tries to test for existence of 'isnan' within the global namespace and the std:: namespace but in both cases uses the <cmath> header.

According to the following post on StackOverflow, it seems however that one should include <math.h> when calling 'isnan' and <cmath> when calling 'std::isnan'

http://stackoverflow.com/questions/18128899/is-isnan-in-the-std-namespace-more-in-general-when-is-std-necessary-optio

Making this change allows the configuration to proceed. I checked and this problem persists in the HEAD version of the master as well.

Here is a trivial patch file for fixing the problem in 12.10.1 release

--- cmake/tribits/core/config_tests/FiniteValue.cmake   2016-11-22 15:43:07.000000000 -0700
+++ cmake/tribits/core/config_tests/FiniteValue.cmake.new       2017-04-26 22:27:08.016402800 -0600
@@ -58,7 +58,7 @@ INCLUDE(CheckCXXSourceCompiles)

 SET(SOURCE_GLOBAL_ISNAN
   "
-#include <cmath>
+#include <math.h>
 int main()
 {
   double x = 1.0;
@@ -105,7 +105,7 @@ ENDIF()

 SET(SOURCE_GLOBAL_ISINF
   "
-#include <cmath>
+#include <math.h>
 int main()
 {
   double x = 1.0;
Assignee
Assign to
Time tracking