Commit 2cb2dbbb authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding cmake tests for headers for time and system resources.

Fixing timers.
parent e6f771cd
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -104,6 +104,32 @@ if( MPI_FOUND )
    set( BUILD_MPI TRUE )
endif()

####
# Check for some system header
#
find_path( SYS_TIME_INCLUDE_DIR sys/time.h  
           DOC "System timer headers." )
if( ${SYS_TIME_INCLUDE_DIR} STREQUAL "SYS_TIME_INCLUDE_DIR-NOTFOUND" )
    message(  "Missing header file sys/time.h" )
    set( HAVE_SYS_TIME_H "//#define HAVE_SYS_TIME_H" )
else()
    include_directories( ${SYS_TIME_INCLUDE_DIR}/tnl-${tnlVersion} )
    set( HAVE_SYS_TIME_H "#define HAVE_SYS_TIME_H" )
endif()

find_path( SYS_RESOURCE_INCLUDE_DIR sys/resource.h  
           DOC "System resources headers." )
if( ${SYS_RESOURCE_INCLUDE_DIR} STREQUAL "SYS_RESOURCE_INCLUDE_DIR-NOTFOUND" )
    message( "Missing header file sys/time.h" )
    set( HAVE_SYS_RESOURCE_H "//#define HAVE_SYS_RESOURCE_H" )
else()
    include_directories( ${SYS_RESOURCE_INCLUDE_DIR}/tnl-${tnlVersion} )
    set( HAVE_SYS_RESOURCE_H "#define HAVE_SYS_RESOURCE_H" )
endif()

  


####
# Check for cppunit
#
+3 −3
Original line number Diff line number Diff line
@@ -15,10 +15,10 @@
 *                                                                         *
 ***************************************************************************/

//#include "config.h"
//#ifdef HAVE_SYS_RESOURCE_H TODO: fix this by testing the header in cmake
#include "tnlConfig.h"
#ifdef HAVE_SYS_RESOURCE_H
   #include <sys/resource.h>
//#endif
#endif
#include "tnlTimerCPU.h"

tnlTimerCPU default_mcore_cpu_timer;
+8 −8
Original line number Diff line number Diff line
@@ -16,14 +16,14 @@
 ***************************************************************************/

#include "tnlTimerRT.h"
//#include "config.h"
//#ifdef HAVE_STDDEF_H TODO: fix this
//   #ifdef HAVE_SYS_TIME_H
#include "tnlConfig.h"

#ifdef HAVE_SYS_TIME_H
   #include <stddef.h>
   #include <sys/time.h>
   #define HAVE_TIME
//   #endif
//#endif
#endif


tnlTimerRT default_mcore_rt_timer;
//--------------------------------------------------------------------------
+6 −6
Original line number Diff line number Diff line
@@ -560,10 +560,10 @@ do
         rm $file         
      done
   fi
done

write_closing sparse-matrix-benchmark-float.log.html
write_closing sparse-matrix-benchmark-double.log.html
write_closing sparse-matrix-benchmark-amd-float.log.html
write_closing sparse-matrix-benchmark-amd-double.log.html   
done
+4 −0
Original line number Diff line number Diff line
@@ -2,4 +2,8 @@

@HAVE_CUSP@

@HAVE_SYS_TIME_H@

@HAVE_SYS_RESOURCE_H@

#define TNL_CONFIG_DIRECTORY @configDirectory@