Skip to content

Commit

Permalink
Changes for building TAU with minGW.
Browse files Browse the repository at this point in the history
Former-commit-id: 4cf231da409dbef68cac6cd0f3cc2fc47098960f
  • Loading branch information
Scott Biersdorff committed May 23, 2011
1 parent f86efb5 commit 68e339d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
14 changes: 13 additions & 1 deletion include/Profile/tau_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@
#define _TAU_TYPES_H_

#ifdef TAU_WINDOWS
//#include <inttypes.h>
#ifdef TAU_MINGW
#include <inttypes.h>

typedef int16_t x_int16;
typedef int32_t x_int32;
typedef int64_t x_int64;

typedef uint16_t x_uint16;
typedef uint32_t x_uint32;
typedef uint64_t x_uint64;

#else
typedef char x_int8;
typedef short x_int16;
typedef int x_int32;
Expand All @@ -29,6 +40,7 @@ typedef unsigned char x_uint8;
typedef unsigned short x_uint16;
typedef unsigned int x_uint32;
typedef unsigned __int64 x_uint64;
#endif
#else /* TAU_WINDOWS */

/* everything except windows */
Expand Down
2 changes: 1 addition & 1 deletion src/Profile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ STATIC_OBJS = Comp_gnu.o $(PGIACC_STATIC_O)
SHARED_OBJS = $(PGIACC_O)
#SICORTEX#SHARED_OBJS = Comp_gnu.o #ENDIF#
#TAU_BFDSHAREDLINK#SHARED_OBJS = Comp_gnu.o #ENDIF#
#TAU_BFDSHAREDLINK#SHARED_LIBS = $(BFDLINK) -lbfd -liberty #ENDIF#
#TAU_BFDSHAREDLINK#SHARED_LIBS = $(BFDLINK) $(BFDLIBS) -liberty #ENDIF#

#CUPTI#SHARED_LIBS = -lcuda -L$(TAU_CUPTI_INC)/../lib -lcupti #ENDIF#

Expand Down
4 changes: 4 additions & 0 deletions src/Profile/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,11 @@ int TauProfiler_writeData(int tid, const char *prefix, bool increment, const cha

} else {
int flags = O_CREAT | O_EXCL | O_WRONLY;
#ifdef TAU_DISABLE_SIGUSR
int mode = 0;
#else
int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
#endif
int node = RtsLayer::myNode();
sprintf(dumpfile,"%s/%s%s.%d.%d.%d", profileLocation, selectivePrefix, prefix,
node, RtsLayer::myContext(), tid);
Expand Down
4 changes: 2 additions & 2 deletions src/Profile/RtsLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ using namespace std;

#ifdef TAU_WINDOWS
//include the header for windows time functions.
#include <Windows.h> //Various defines needed in Winbase.h.
#include <Winbase.h> //For QueryPerformanceCounter/Frequency function (down to microsecond
#include <windows.h> //Various defines needed in Winbase.h.
#include <winbase.h> //For QueryPerformanceCounter/Frequency function (down to microsecond
//resolution depending on the platform.
#include <sys/timeb.h> //For _ftime function (millisecond resolution).
//Map strncasecmp and strcasecmp to strnicmp and stricmp.
Expand Down
9 changes: 9 additions & 0 deletions src/Profile/TauInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ static void TauInitialize_kill_handlers() {
}

extern int tauPrintAddr(int i, char *token1, unsigned long addr);

#ifndef TAU_DISABLE_SIGUSR

//static void tauBacktraceHandler(int sig) {
void tauBacktraceHandler(int sig, siginfo_t *si, void *context) {

Expand Down Expand Up @@ -167,6 +170,7 @@ static void tauToggleInstrumentationHandler(int sig) {
}
}

#endif //TAU_DISABLE_SIGUSR

static int tau_initialized = 0;

Expand Down Expand Up @@ -198,6 +202,7 @@ int Tau_init_epilog(void) {
}
#endif /* TAU_EPILOG */

#ifndef TAU_DISABLE_SIGUSR

int Tau_add_signal(int alarmType) {
int ret = 0;
Expand Down Expand Up @@ -244,6 +249,8 @@ int Tau_signal_initialization() {
} /* TAU_TRACK_SIGNALS=1 */
}

#endif // TAU_DISABLE_SIGUSR

extern "C" int Tau_init_initializeTAU() {
static int initialized = 0;

Expand Down Expand Up @@ -310,7 +317,9 @@ extern "C" int Tau_init_initializeTAU() {
/* initialize the metrics we will be counting */
TauMetrics_init();

#ifndef TAU_DISABLE_SIGUSR
Tau_signal_initialization();
#endif // TAU_DISABLE_SIGUSR

/* TAU must me marked as initialized BEFORE Tau_compensate_initialize is called
Otherwise re-entry to this function will take place and bad things will happen */
Expand Down
4 changes: 0 additions & 4 deletions utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
include ../include/Makefile
########### Automatically modified by the configure script ############
CONFIG_ARCH=default
CONFIG_CC=gcc
CONFIG_CXX=g++
PDT_CXX=
USER_OPT=-g
TAU_PREFIX_INSTALL_DIR=
VTFDIR=
OTFDIR=
Expand Down Expand Up @@ -162,7 +159,6 @@ INSTALL_OTF_TOOLS = $(INSTALL_EBS2OTF)
#OPARI#INSTALLTAUOMPCHECK = $(INSTALLPDTOMPCHECK) #ENDIF#
#DYNINST#INSTALLTAURUN = $(INSTALLDEST)/tau_run #ENDIF#
#DYNINST#INSTALLTAURUN = $(INSTALLDEST)/tau_run #ENDIF#
#TAU_LARGEFILE#LARGEFILEOPT = -DTAU_LARGEFILE -D_LARGEFILE64_SOURCE #ENDIF#
#SP1#LARGEFILEOPT = -DTAU_LARGEFILE -D_LARGEFILE64_SOURCE -D_LARGE_FILE_API #ENDIF#

CFLAGS = $(USER_OPT) -I../include $(CEXTRA) $(CWARNING) $(COMPSPECIFIC) $(COMPILEROPT) $(PKGOPT) $(LARGEFILEOPT) $(DEBUGOPT) $(GNUOPT)
Expand Down
2 changes: 0 additions & 2 deletions utils/trace2profile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ include ../../include/Makefile
########### Automatically modified by the configure script ############

CONFIG_ARCH=default
CONFIG_CC=gcc
CONFIG_CXX=g++
CXX=$(CONFIG_CXX) $(ABI) $(ISA)
#CRAYXMT#CC = $(TAU_CC_FE) $(ABI) $(ISA) #ENDIF#
#CRAYXMT#CXX = $(TAU_CXX_FE) $(ABI) $(ISA) #ENDIF#
Expand Down

0 comments on commit 68e339d

Please sign in to comment.