From 51ba171ed2d2a7c81bb0d548ecd426a278d555db Mon Sep 17 00:00:00 2001 From: stansmith Date: Mon, 10 Dec 2007 20:40:31 +0000 Subject: [PATCH] [WinOF] IBSDK git-svn-id: svn://openib.tc.cornell.edu/gen1@916 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- .../WinOF/WIX/SDK_Samples/VS/Makefile.x64 | 97 +++++++++++++++++++ .../WinOF/WIX/SDK_Samples/VS/Makefile.x86 | 97 +++++++++++++++++++ branches/WinOF/WIX/SDK_Samples/VS/README.txt | 67 ++++++++++--- 3 files changed, 249 insertions(+), 12 deletions(-) create mode 100644 branches/WinOF/WIX/SDK_Samples/VS/Makefile.x64 create mode 100644 branches/WinOF/WIX/SDK_Samples/VS/Makefile.x86 diff --git a/branches/WinOF/WIX/SDK_Samples/VS/Makefile.x64 b/branches/WinOF/WIX/SDK_Samples/VS/Makefile.x64 new file mode 100644 index 00000000..0bc70cc0 --- /dev/null +++ b/branches/WinOF/WIX/SDK_Samples/VS/Makefile.x64 @@ -0,0 +1,97 @@ +# +#********************************************************************* +# +# NMAKE Options (passed as macro) +# +# Select a Visual Studio 2005 command window from the start menu +# vcvarsall X64 - sets X64 processor compilation env, X86 | IA64 +# +#*********************************************************************/ + + +#********************************************************************* +# +# Dot Directives +# +#*********************************************************************/ + +.SUFFIXES : # clear the .SUFFIXES list +.SUFFIXES : .c # initialize .SUFFIXES list + + +#********************************************************************* +# +# Macros +# +#*********************************************************************/ + +SRC=cmtest + +LIB_PATH=C:\IBSDK\Lib +INC_PATH=C:\IBSDK\Inc + +IB_LIBS=ibal.lib complib.lib + +DEFS= /D_WIN64 /D_X64_ /D_AMD64_ + +ARCH=x64 + +OBJS = $(SRC).obj +EXEC = $(SRC).exe + +# +# Compiler +# + +CC = cl + +INC_FLAGS = /I $(INC_PATH) + +UNUSED_CL=/Zp1 /Od +UNUSED_LINKER= /DEBUG /incremental:no + +CC_FLAGS= /nologo /Gy /W3 /Gm- \ + /GR- /GF /O2 /Oi /Oy- /D_CRT_SECURE_NO_WARNINGS \ + $(DEFS) $(INC_FLAGS) + +# +# Linker +# + +LINK = link + +LIBS = ws2_32.lib advapi32.lib User32.lib bufferoverflowU.lib + +LINK_FLAGS = /nologo /subsystem:console /machine:$(ARCH) $(LIBS) \ + /libpath:$(LIB_PATH) $(IB_LIBS) + +# +# System Utilities +# + +RM = del /Q + + +#********************************************************************* +# Inference Rules +# +#*********************************************************************/ + +.c.obj: + $(CC) $(CC_FLAGS) /Fo$@ /c $< + + +#********************************************************************* +# +# Description Blocks +# +#*********************************************************************/ + +all : $(EXEC) + + +$(EXEC) : $(OBJS) $0 + $(LINK) $(LINK_FLAGS) /out:$(EXEC) $(OBJS) + +clean: + -$(RM) *.exe *.pdb *.obj diff --git a/branches/WinOF/WIX/SDK_Samples/VS/Makefile.x86 b/branches/WinOF/WIX/SDK_Samples/VS/Makefile.x86 new file mode 100644 index 00000000..64070763 --- /dev/null +++ b/branches/WinOF/WIX/SDK_Samples/VS/Makefile.x86 @@ -0,0 +1,97 @@ +# +#********************************************************************* +# +# NMAKE Options (passed as macro) +# +# Select a Visual Studio command window from the start menu +# vcvarsall X86 - sets X86 processor compilation env, X64 | IA64 +# +#*********************************************************************/ + + +#********************************************************************* +# +# Dot Directives +# +#*********************************************************************/ + +.SUFFIXES : # clear the .SUFFIXES list +.SUFFIXES : .c # initialize .SUFFIXES list + + +#********************************************************************* +# +# Macros +# +#*********************************************************************/ + +SRC=cmtest + +LIB_PATH=C:\IBSDK\Lib +INC_PATH=C:\IBSDK\Inc + +IB_LIBS=ibal.lib complib.lib + +DEFS= /D_WIN32 + +ARCH=x86 + +OBJS = $(SRC).obj +EXEC = $(SRC).exe + +# +# Compiler +# + +CC = cl + +INC_FLAGS = /I $(INC_PATH) + +UNUSED_CL=/Zp1 /Od +UNUSED_LINKER= /DEBUG /incremental:no + +CC_FLAGS= /nologo /Gy /W3 /Gm- \ + /GR- /GF /O2 /Oi /Oy- /D_CRT_SECURE_NO_WARNINGS \ + $(DEFS) $(INC_FLAGS) + +# +# Linker +# + +LINK = link + +LIBS = ws2_32.lib advapi32.lib User32.lib bufferoverflowU.lib + +LINK_FLAGS = /nologo /subsystem:console /machine:$(ARCH) $(LIBS) \ + /libpath:$(LIB_PATH) $(IB_LIBS) + +# +# System Utilities +# + +RM = del /Q + + +#********************************************************************* +# Inference Rules +# +#*********************************************************************/ + +.c.obj: + $(CC) $(CC_FLAGS) /Fo$@ /c $< + + +#********************************************************************* +# +# Description Blocks +# +#*********************************************************************/ + +all : $(EXEC) + + +$(EXEC) : $(OBJS) $0 + $(LINK) $(LINK_FLAGS) /out:$(EXEC) $(OBJS) + +clean: + -$(RM) *.exe *.pdb *.obj diff --git a/branches/WinOF/WIX/SDK_Samples/VS/README.txt b/branches/WinOF/WIX/SDK_Samples/VS/README.txt index 8eccc330..99d41736 100644 --- a/branches/WinOF/WIX/SDK_Samples/VS/README.txt +++ b/branches/WinOF/WIX/SDK_Samples/VS/README.txt @@ -4,6 +4,20 @@ Visual Studio 8/5.0 (C++) Build Environment [12-06-07] Install Microsoft Visual Studio 8/5.0 (C++ env) + +**** WARNING - win32 application building **** + +The Visual Studio default calling convention is '__cdecl' (/Gd). +The 32-bit versions of ibal32.lib & complib32.lib are built using '__stdcall' +as the default calling convention (AL_API & CL_API). +Make _sure_ 'all' user-defined ibal and complib callback routines match the +callback function declaration [AL_API or CL_API calling conventions]. +The VS compiler will note a C-style cast is required if the calling conventions +do not match. +The other option is to force __stdcall (/Gz) as the 'default' calling +convention for your 'win32' InfiniBand application. + + Building CM test example ------------------------ @@ -22,11 +36,7 @@ vcvarsall X64 - sets X64 processor compilation env, X86 | IA64 nmake -f Makefile.x64 If building a win32 application on a 64-bit platform then link with -lbal32.lib & complib32.libs. - -Make _sure_ you specify __stdcall (/Gz) as the 'default' calling convention for -'win32' InfiniBand applications!!! - +lbal32[d].lib & complib32[d].lib. @@ -42,17 +52,20 @@ Salient Solution points: compile as a C program set additional Include path as C:\IBSDK\Inc set additional Resource Include path as C:\IBSDK\Inc - Set additional Library path as C:\IBSDK\Lib - Link with additional libraries ibal.lib & complib.lib - If building a win32 application on a 64-bit platform then link with lbal32.lib & complib32.lib - Make _sure_ (__stdcall /Gz) is set for win32 InfiniBand application builds! + Set additional Library path as C:\IBSDK\Lib . + Link with additional libraries ibal.lib & complib.lib . + If building a win32 application on a 64-bit platform then link with + lbal32[d].lib & complib32[d].lib Executing cmtest.exe -------------------- -cmtest.exe passes messages between the server and client over a reliable IB queue-pair connection (RC). -Connection end-points (hosts) are identified by IB port LID (hex integer, as displayed by the vstat command). +cmtest.exe passes messages between the server and client over a reliable +IB queue-pair connection (RC). +Connection end-points (hosts) are identified by IB port LID (hex integer, +as displayed by the vstat command). + Note: are not allowed between command line switch and it's argument. Server side: cmtest -s -l0xlll -r0xrrr -m1024 -n100 @@ -61,8 +74,38 @@ Client side: cmtest.exe -l0xlll -r0xrrr -m1024 -n100 where: lll == local port lid as displayed by vstat command. - rrr == Remote port lid as displayed by vstat; lll == rrr for local loopback operation. + rrr == Remote port lid as displayed by vstat; lll == rrr for local loopback + operation. -m == bytes per message -n == number of messages to send. -c == number of connections (default is -c1) cmtest -h reveals all... + +Example cmtest invocation: local loopback test + +cmdWin> vstat + + hca_idx=0 + uplink={BUS=UNRECOGNIZED (33)} + vendor_id=0x02c9 + vendor_part_id=0x6278 + hw_ver=0xa0 + fw_ver=4.08.0200 + PSID=_00A0000001 + node_guid=0002:c902:0020:1d74 + num_phys_ports=2 + port=1 + port_state=PORT_ACTIVE (4) <==== Must be active! + link_speed=2.5Gbps (1) + link_width=4x (2) + rate=10 + sm_lid=0x0001 + port_lid=0x0020 <=== -l0x20 + port_lmc=0x0 + max_mtu=2048 (4) + + +Separate processes for server & client (different cmd windows). + +server: cmtest -s -l0x20 -r0x20 -m8192 -n400 +client: cmtest -l0x20 -r0x20 -m8192 -n400 -- 2.41.0