From: <and...@us...> - 2008-08-14 13:09:01
|
Revision: 8649 http://plplot.svn.sourceforge.net/plplot/?rev=8649&view=rev Author: andrewross Date: 2008-08-14 13:09:10 +0000 (Thu, 14 Aug 2008) Log Message: ----------- Add in new files for fortran isnan support. Added Paths: ----------- trunk/cmake/modules/TestFortranIsnan.cmake trunk/cmake/modules/TestFortranIsnan.f trunk/examples/f77/plf77demos.inc.cmake trunk/examples/f95/plf95demos.inc.cmake Added: trunk/cmake/modules/TestFortranIsnan.cmake =================================================================== --- trunk/cmake/modules/TestFortranIsnan.cmake (rev 0) +++ trunk/cmake/modules/TestFortranIsnan.cmake 2008-08-14 13:09:10 UTC (rev 8649) @@ -0,0 +1,44 @@ +# cmake/modules/TestFortranIsnan.cmake +# +# Fortran bindings - check is isnan function is available +# +# Copyright (C) 2008 Andrew Ross +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; version 2 of the License. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with the file PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# Check if isnan function is available in fortran +IF(NOT DEFINED CMAKE_FORTRAN_HAVE_ISNAN) + MESSAGE(STATUS "Check if isnan function is available in fortran") + TRY_COMPILE(CMAKE_FORTRAN_HAVE_ISNAN + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/cmake/modules/TestFortranIsnan.f + OUTPUT_VARIABLE OUTPUT) + IF (CMAKE_FORTRAN_HAVE_ISNAN) + MESSAGE(STATUS "Check for isnan in fortran - found") + SET (FORTRAN_HAVE_ISNAN 1 CACHE INTERNAL + "Does fortran have isnan function") + FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + "Determining if fortran has isnan function passed with " + "the following output:\n${OUTPUT}\n\n") + ELSE (CMAKE_FORTRAN_HAVE_ISNAN) + MESSAGE(STATUS "Check for isnan in fortran - not found") + SET (FORTRAN_HAVE_ISNAN 0 CACHE INTERNAL + "Does fortran have isnan function") + FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Determining if fortran has isnan function failed with " + "the following output:\n${OUTPUT}\n\n") + ENDIF (CMAKE_FORTRAN_HAVE_ISNAN) +ENDIF(NOT DEFINED CMAKE_FORTRAN_HAVE_ISNAN) Property changes on: trunk/cmake/modules/TestFortranIsnan.cmake ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/cmake/modules/TestFortranIsnan.f =================================================================== --- trunk/cmake/modules/TestFortranIsnan.f (rev 0) +++ trunk/cmake/modules/TestFortranIsnan.f 2008-08-14 13:09:10 UTC (rev 8649) @@ -0,0 +1,9 @@ + program testisnan + +c external isnan + + if (isnan(0.0/0.0)) then + print *,"NaN" + endif + + end program testisnan Property changes on: trunk/cmake/modules/TestFortranIsnan.f ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/examples/f77/plf77demos.inc.cmake =================================================================== --- trunk/examples/f77/plf77demos.inc.cmake (rev 0) +++ trunk/examples/f77/plf77demos.inc.cmake 2008-08-14 13:09:10 UTC (rev 8649) @@ -0,0 +1,12 @@ + function myisnan(x) + + implicit none + logical myisnan + real*8 x + +@HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) +@HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) + + return + + end function Property changes on: trunk/examples/f77/plf77demos.inc.cmake ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/examples/f95/plf95demos.inc.cmake =================================================================== --- trunk/examples/f95/plf95demos.inc.cmake (rev 0) +++ trunk/examples/f95/plf95demos.inc.cmake 2008-08-14 13:09:10 UTC (rev 8649) @@ -0,0 +1,12 @@ + function myisnan(x) + + implicit none + logical myisnan + real*8 x + +@HAVE_F77_ISNAN_FALSE@ myisnan = (x.ne.x) +@HAVE_F77_ISNAN_TRUE@ myisnan = isnan(x) + + return + + end function Property changes on: trunk/examples/f95/plf95demos.inc.cmake ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |