Commit 0bed4483 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1185

omt-test now works in windows/cygwin/icc (although not through makefile)

newbrt/tests/makefile now supports icc in cygwin (more so than before)


git-svn-id: file:///svn/tokudb.1131b+1080a+1185+nostatementexprs@6494 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6a2017c7
...@@ -223,6 +223,7 @@ clean-local: ...@@ -223,6 +223,7 @@ clean-local:
rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
rm -rf test_oexcl.c.tmp *.brt rm -rf test_oexcl.c.tmp *.brt
rm -rf *.obj *.pdb *.ilk *.exe rm -rf *.obj *.pdb *.ilk *.exe
rm -rf log_code.c log_header.h logformat
# After doing (cd ../src/tests;make test_log5.recover), run these. The files should have no differences. # After doing (cd ../src/tests;make test_log5.recover), run these. The files should have no differences.
testdump: brtdump testdump: brtdump
......
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "includes.h" #include "portability.h"
#include "memory.h"
#include "toku_assert.h"
#include <string.h>
#include <malloc.h>
#include <errno.h>
int toku_memory_check=0; int toku_memory_check=0;
......
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "includes.h" #include "portability.h"
#include <ctype.h>
#include <errno.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef void *OMTVALUE;
#include "toku_assert.h"
#include "memory.h"
#include "omt.h"
#include "brttypes.h"
typedef u_int32_t node_idx; typedef u_int32_t node_idx;
static const node_idx NODE_NULL = UINT32_MAX; static const node_idx NODE_NULL = UINT32_MAX;
......
...@@ -20,34 +20,80 @@ else ...@@ -20,34 +20,80 @@ else
endif endif
endif endif
ifneq ($(CYGWIN),) #CFLAG default options
FORMAT=-Wno-format WERROR = -Werror
CYG_ADD_LIBZ=/usr/lib/libz.a WALL = -Wall -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn
else FORMAT = -Wmissing-format-attribute
VISIBILITY= -fvisibility=hidden
FPICFLAGS = -fPIC FPICFLAGS = -fPIC
# valgrind is not present on cygwin SHADOW = -Wshadow
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes --suppressions=../valgrind.suppressions SYMBOLS = -g3 -ggdb3
VISIBILITY=-fvisibility=hidden PORTABILITY=
ifneq ($(CC),icc) SKIP_WARNING=
SHADOW=-Wshadow COMBINE_C = -combine -c
FORMAT=-Wmissing-format-attribute LINK_FILES= -lz -lpthread
endif C99 = -std=c99
#Tools
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes --suppressions=../valgrind.suppressions
ifeq ($(CC),icc)
#icc only:
OPTFLAGS = -O3 -ip -ipo2
COMBINE_C = -ipo-c
FORMAT= #No argument for extra format warnings.
WALL = -Wall -Wcheck # '-Wextra' becomes '-Wcheck' in icc
SYMBOLS= -g -debug all -inline-debug-info
PORTABILITY=-diag-enable port-win
ifneq ($(CYGWIN),)
#Cygwin
ICC_NOWARN=-Qdiag-disable:
else
#Linux
ICC_NOWARN=-diag-disable #Need the space
endif
SKIP_WARNING += $(ICC_NOWARN)177 # Don't complain about static variables that are not used.
#SKIP_WARNING += $(ICC_NOWARN)188 # Don't complain about enumerated type mixed with another type.
SKIP_WARNING += $(ICC_NOWARN)589 # Don't complain about goto into a block that skips initializing variables. GCC catches the actual uninitialized variables.
SKIP_WARNING += $(ICC_NOWARN)869 # Don't complain about unused variables (since we defined __attribute__ to be nothing.)
SKIP_WARNING += $(ICC_NOWARN)981 # Don't complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call.
SKIP_WARNING += $(ICC_NOWARN)1324 # Don't complain about rdtsc clobbering its registers more than once.
endif endif
CFLAGS = -Wall $(FORMAT) $(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS) $(FPICFLAGS) $(SHADOW) $(VISIBILITY) ifneq ($(CYGWIN),)
ifneq ($(CC),icc) #Cygwin (Windows) Must override some settings
CFLAGS += -Werror -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn -g3 -ggdb3 CYG_ADD_LIBZ=/usr/lib/libz.a
else VGRIND =#No Valgrind in cygwin
CFLAGS += -Werror FPICFLAGS=#FPIC is default and not allowed as an option.
CFLAGS += -g VISIBILITY=#Not supported
CFLAGS += -diag-enable port-win SHADOW=#Not supported
CFLAGS += -diag-disable 177 # Don't complain about static variables that are not used. ifeq ($(CC),icc)
CFLAGS += -diag-disable 869 #Cygwin icc only
CFLAGS += -diag-disable 981 # Don't complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call. C99 = -Qstd=c99
CFLAGS += -ip -ipo2 OPTFLAGS = -Ox -Qip -Qipo2
COMBINE_C = -Qipo-c
WERROR = -WX # Windows icc version of -Werror
SYMBOLS= -Zi -debug:all -Qinline-debug-info
PORTABILITY=
LINK_FILES=#Not supported
SKIP_WARNING += $(ICC_NOWARN)1786 # Don't complain about 'read/write/other standards' being deprecated
else
#Cygwin gcc only
FORMAT = -Wno-format
endif
endif endif
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lpthread -lz
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I.. CFLAGS = $(WALL) $(WERROR) $(FORMAT) $(VISIBILITY) $(FPICFLAGS) $(SHADOW)
CFLAGS += $(OPTFLAGS) $(GCOV_FLAGS) $(PROF_FLAGS)
CFLAGS += $(SYMBOLS) $(SKIP_WARNING) $(C99)
LDFLAGS = $(OPTFLAGS) $(SYMBOLS) $(GCOV_FLAGS) $(PROF_FLAGS) $(LINK_FILES)
# Need XOPEN_SOURCE=600 to get strtoll()
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
CPPFLAGS += -D_GNU_SOURCE -I..
# Add -Wconversion # Add -Wconversion
...@@ -200,5 +246,6 @@ test-inc-split test-del-inorder: ../brt-test-helpers.o ...@@ -200,5 +246,6 @@ test-inc-split test-del-inorder: ../brt-test-helpers.o
clean: clean:
rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
rm -rf test_oexcl.c.tmp *.brt *.dir *.tdb *.dat *.out rm -rf test_oexcl.c.tmp *.brt *.dir *.tdb *.dat *.out
rm -rf *.exe *.pdb *.ilk *.obj
foo: ../cachetable.o ../fifo.o ../fingerprint.o ../key.o ../memory.o ../memarena.o ../mempool.o ../omt.o ../toku_assert.o ../ybt.o ../x1764.o ../trace_mem.o ../threadpool.o foo: ../cachetable.o ../fifo.o ../fingerprint.o ../key.o ../memory.o ../memarena.o ../mempool.o ../omt.o ../toku_assert.o ../ybt.o ../x1764.o ../trace_mem.o ../threadpool.o
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "includes.h" #include "portability.h"
#include <errno.h>
#include <stdio.h>
typedef void *OMTVALUE;
#include "omt.h"
#include "memory.h"
#include "toku_assert.h"
#include "brttypes.h"
static int srandom(unsigned int seed) { return 0; }
static int random() { return 0; }
//typedef struct value *OMTVALUE;
typedef OMTVALUE TESTVALUE; typedef OMTVALUE TESTVALUE;
/* Things that would go in a omt-tests.h if we split to multiple files later. */ /* Things that would go in a omt-tests.h if we split to multiple files later. */
......
#include "includes.h" #include "portability.h"
#include "toku_assert.h"
#include <stdlib.h>
#include <stdio.h>
int toku_continue_on_assert_failure=0; int toku_continue_on_assert_failure=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment