Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1896 - in trunk/Core: . Math Thread


Chronological Thread 
  • From: boulos@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1896 - in trunk/Core: . Math Thread
  • Date: Mon, 3 Dec 2007 14:58:20 -0700 (MST)

Author: boulos
Date: Mon Dec  3 14:58:16 2007
New Revision: 1896

Modified:
   trunk/Core/CMakeLists.txt
   trunk/Core/Math/SSEDefs.h
   trunk/Core/Thread/Thread_win32.cc
   trunk/Core/Thread/Time_win32.cc
Log:
Making Manta/Core build and link under Win32 (tested on winxp 64)

Fixing SSEDefs.h check for MSC_VER without checking version number (Visual 
Studio 2008 has the casting intrinsics now)

Adding Win32 thread and timing functions to the CORE_SOURCES when appropriate.

Linking against windows timing library when appropriate.

Modified: trunk/Core/CMakeLists.txt
==============================================================================
--- trunk/Core/CMakeLists.txt   (original)
+++ trunk/Core/CMakeLists.txt   Mon Dec  3 14:58:16 2007
@@ -130,9 +130,20 @@
     SET(CORE_SOURCES ${CORE_SOURCES}
                        Thread/Time_unix.cc)
   ENDIF(EXISTS /usr/include/sn/mmtimer.h)
-
+ELSE(CMAKE_USE_PTHREADS_INIT)
+  IF(WIN32)
+    SET (CORE_SOURCES ${CORE_SOURCES}
+                Exceptions/StackWalker.h
+                Exceptions/StackWalker.cc
+         Thread/Thread_win32.cc
+         Thread/Time_win32.cc
+         Thread/Time.h
+         )         
+  ENDIF(WIN32)
 ENDIF (CMAKE_USE_PTHREADS_INIT)
 
+
+
 SET (CORE_SOURCES ${CORE_SOURCES}
      Util/AlignedAllocator.h
      Util/AlignedAllocator.cc
@@ -160,12 +171,24 @@
 
 ADD_LIBRARY (Manta_Core ${CORE_SOURCES})
 
-TARGET_LINK_LIBRARIES(Manta_Core ${LIBXML2_LIBRARY})
+IF(LIBXML2_LIBRARY)
+  TARGET_LINK_LIBRARIES(Manta_Core ${LIBXML2_LIBRARY})
+ENDIF(LIBXML2_LIBRARY)
+
+
 TARGET_LINK_LIBRARIES(Manta_Core
   ${THREAD_LIBRARY}  
   ${TRACEBACK_LIB} 
   ${SEMAPHORE_LIBRARY}
 )
+
+IF (CMAKE_USE_PTHREADS_INIT)
+  # no need for Win32 timer (we'll use Cygwin version)
+ELSE(CMAKE_USE_PTHREADS_INIT)
+  IF(WIN32)
+       TARGET_LINK_LIBRARIES(Manta_Core Winmm.lib)
+  ENDIF(WIN32)
+ENDIF (CMAKE_USE_PTHREADS_INIT)
 
 IF(MANTA_ENABLE_X11)
   # The Manta_Core_XUtils library

Modified: trunk/Core/Math/SSEDefs.h
==============================================================================
--- trunk/Core/Math/SSEDefs.h   (original)
+++ trunk/Core/Math/SSEDefs.h   Mon Dec  3 14:58:16 2007
@@ -101,7 +101,7 @@
 #endif
 
   //#ifdef __CYGWIN__
-#if (defined(__GNUC__) && __GNUC__ < 4 && !defined(__INTEL_COMPILER)) || 
defined(_MSC_VER)
+#if (defined(__GNUC__) && __GNUC__ < 4 && !defined(__INTEL_COMPILER)) || 
(defined(_MSC_VER) && (_MSC_VER < 1500))
   // Intel casting intrinsics.
   static inline __m128i _mm_castps_si128(__m128  val) { union { __m128 f; 
__m128i i;} c; c.f = val; return c.i; }
   static inline __m128  _mm_castsi128_ps(__m128i val) { union { __m128 f; 
__m128i i;} c; c.i = val; return c.f; }

Modified: trunk/Core/Thread/Thread_win32.cc
==============================================================================
--- trunk/Core/Thread/Thread_win32.cc   (original)
+++ trunk/Core/Thread/Thread_win32.cc   Mon Dec  3 14:58:16 2007
@@ -49,7 +49,7 @@
 #include <Core/Thread/Thread.h>
 #include <Core/Thread/Thread_unix.h>
 #include <Core/Thread/ThreadGroup.h>
-#include <Core/Malloc/Allocator.h>
+//#include <Core/Malloc/Allocator.h>
 #include <Core/Thread/ThreadError.h>
 
 // version of windows
@@ -181,7 +181,7 @@
 
 Mutex::Mutex(const char* name)
 {
-       priv_ = scinew Mutex_private;
+       priv_ = new Mutex_private;
        priv_->lock = CreateMutex(NULL,0,0);
        if (priv_->lock == 0)
        {
@@ -237,7 +237,7 @@
 
 Semaphore::Semaphore(const char* name,int count)
 {
-       priv_ = scinew Semaphore_private;
+       priv_ = new Semaphore_private;
        priv_->hSema = 
CreateSemaphore(NULL,count,MAX(1000,MIN(2*count,100)),0);
        if (priv_->hSema == 0)
        {

Modified: trunk/Core/Thread/Time_win32.cc
==============================================================================
--- trunk/Core/Thread/Time_win32.cc     (original)
+++ trunk/Core/Thread/Time_win32.cc     Mon Dec  3 14:58:16 2007
@@ -40,6 +40,8 @@
 static bool initialized=false;
 static DWORD start_time; // measured in milliseconds
 
+using namespace Manta;
+
 void
 Time::initialize()
 {




  • [Manta] r1896 - in trunk/Core: . Math Thread, boulos, 12/03/2007

Archive powered by MHonArc 2.6.16.

Top of page