Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1059 - in trunk: . include


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1059 - in trunk: . include
  • Date: Fri, 12 May 2006 05:12:50 -0600 (MDT)

Author: bigler
Date: Fri May 12 05:12:47 2006
New Revision: 1059

Modified:
   trunk/CMakeLists.txt
   trunk/include/CMakeLists.txt
Log:

CMakeLists.txt

  Use the C++ compiler instead of the C compiler for testing for sse.
  This is because we use the C++ compiler and its flags more than the
  C one and I want it to be more consistent for our use.

  There's more logic with regard to the setting of the the MANTA_SSE.
  It will attempt to turn it on the first pass.  If the user attempts
  to turn it on and it doesn't work it forces it off with a warning
  and compiler output.
  
include/CMakeLists.txt

  Moved MANTA_REAL logic based on MANTA_SSE to here, so there is a
  single location and conflicts removed.

  If you have MANTA_SSE enabled, and MANTA_REAL is not float, a
  warning is issued and automatically fixed for you.


Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt        (original)
+++ trunk/CMakeLists.txt        Fri May 12 05:12:47 2006
@@ -170,14 +170,22 @@
 # Check to see if the system supports SSE2.
 FILE(WRITE ${CMAKE_BINARY_DIR}/test/sse_test.c "#include 
<emmintrin.h>\nstatic __m128 foo;\n\n")
 
-EXEC_PROGRAM(${CMAKE_C_COMPILER}
-  ARGS -c -o /dev/null ${CMAKE_BINARY_DIR}/test/sse_test.c
+EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+  ARGS -c ${CMAKE_CXX_FLAGS} -o /dev/null ${CMAKE_BINARY_DIR}/test/sse_test.c
   OUTPUT_VARIABLE OUTPUT
   RETURN_VALUE NOT_MANTA_SSE )
 
 IF(NOT NOT_MANTA_SSE)
-  FIRST_TIME_SET(MANTA_SSE TRUE BOOL "Compile SSE code.")
-  FIRST_TIME_SET(MANTA_REAL float STRING "Typedef for Real")
+  SET(MANTA_SSE TRUE CACHE BOOL "Compile SSE code.")
+ELSE(NOT NOT_MANTA_SSE)
+  IF(MANTA_SSE)
+    # We tried to turn it on and it isn't available
+    MESSAGE("Couldn't compile with sse.  Try adding -msse -msse2 to 
CMAKE_CXX_FLAGS compiler flags.")
+    MESSAGE("compiler: " ${CMAKE_CXX_COMPILER})
+    MESSAGE("compiler flags: " ${CMAKE_CXX_FLAGS})
+    MESSAGE(${OUTPUT})
+  ENDIF(MANTA_SSE)
+  SET(MANTA_SSE FALSE CACHE BOOL "Couldn't compile SSE code." FORCE)
 ENDIF(NOT NOT_MANTA_SSE)
 
 ##################################################################

Modified: trunk/include/CMakeLists.txt
==============================================================================
--- trunk/include/CMakeLists.txt        (original)
+++ trunk/include/CMakeLists.txt        Fri May 12 05:12:47 2006
@@ -1,6 +1,17 @@
 ##################################################################
 ## Configure MantaTypes.h
-SET(MANTA_REAL double CACHE STRING "Typedef for Real")
+
+IF(MANTA_SSE)
+  # If we want to use sse we need to have MANTA_REAL be float
+  IF(MANTA_REAL STREQUAL "double")
+    MESSAGE("For SSE, MANTA_REAL must be double.  Changing...")
+  ENDIF(MANTA_REAL STREQUAL "double")
+  SET(MANTA_REAL float CACHE STRING "Typedef for Real" FORCE)
+ELSE(MANTA_SSE)
+  # Set a default
+  SET(MANTA_REAL double CACHE STRING "Typedef for Real")
+ENDIF(MANTA_SSE)
+
 SET(MANTA_COLOR_COMPONENT float CACHE STRING "Typedef for ColorComponent")
 
 CONFIGURE_FILE(




  • [MANTA] r1059 - in trunk: . include, bigler, 05/12/2006

Archive powered by MHonArc 2.6.16.

Top of page