[vtkusers] VTK on HP UX

R K Shyam Prakash ramakrishna.prakash at quest-global.com
Tue May 25 06:20:05 EDT 2004


Hi,
        I was trying to build VTK 4.2.2 on HP UX 11.0 with Java
bindings. The build failed at the following code fragment in
vtkJavaUtil.cxx
 
#define VTK_GET_MUTEX()  vtk_get_mutex()
#define VTK_RELEASE_MUTEX() vtk_release_mutex()
#elif defined(__FreeBSD__) || defined(__linux__) || defined(sgi) ||
defined(__APPLE_CC__)
#include <pthread.h>
pthread_mutex_t vtkGlobalMutex;
static void vtk_get_mutex() {
    static int inited = 0;
    if (!inited)
      {
      inited = 1;
      pthread_mutex_init ( &vtkGlobalMutex, NULL );
      }
    pthread_mutex_lock(&vtkGlobalMutex);
}
// #define VTK_GET_MUTEX()  pthread_mutex_lock(&vtkGlobalMutex)
#define VTK_GET_MUTEX()  vtk_get_mutex()
#define VTK_RELEASE_MUTEX() pthread_mutex_unlock(&vtkGlobalMutex)
#else
// for solaris
#include <thread.h>
#include <synch.h>
mutex_t vtkGlobalMutex;
#define VTK_GET_MUTEX()  mutex_lock(&vtkGlobalMutex)
#define VTK_RELEASE_MUTEX() mutex_unlock(&vtkGlobalMutex)
#endif
#endif
 
Now, when changed the code as follows it compiled OK
 
#define VTK_GET_MUTEX()  vtk_get_mutex()
#define VTK_RELEASE_MUTEX() vtk_release_mutex()
//#elif defined(__FreeBSD__) || defined(__linux__) || defined(sgi) ||
defined(__APPLE_CC__)
#else
#include <pthread.h>
pthread_mutex_t vtkGlobalMutex;
static void vtk_get_mutex() {
    static int inited = 0;
    if (!inited)
      {
      inited = 1;
      pthread_mutex_init ( &vtkGlobalMutex, NULL );
      }
    pthread_mutex_lock(&vtkGlobalMutex);
}
// #define VTK_GET_MUTEX()  pthread_mutex_lock(&vtkGlobalMutex)
#define VTK_GET_MUTEX()  vtk_get_mutex()
#define VTK_RELEASE_MUTEX() pthread_mutex_unlock(&vtkGlobalMutex)
/*
#else
// for solaris
#include <thread.h>
#include <synch.h>
mutex_t vtkGlobalMutex;
#define VTK_GET_MUTEX()  mutex_lock(&vtkGlobalMutex)
#define VTK_RELEASE_MUTEX() mutex_unlock(&vtkGlobalMutex)
*/
#endif
#endif
 
Is my approach right. If yes, can somebody make the changes (to identify
HP UX as well along with linux and others) and commit to the CVS. By the
way, how is HP-UX OS is defined?
 
Thanks
Shyam

 
Disclaimer: 

This electronic message and all attachments contain information from
QuEST, which may be confidential or otherwise protected from disclosure.
The information is intended for the addressee only. If you are not the
addressee, any disclosure, copy, distribution or use of the contents of
this message is prohibited. If you have received this electronic message
in error, please notify the sender immediately and destroy the message.

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040525/7f9c4041/attachment.htm>


More information about the vtkusers mailing list