From 649c95c0025b4d41d8de7461059e72737fb3cea5 Mon Sep 17 00:00:00 2001 From: Stan Smith Date: Fri, 9 Apr 2010 22:28:30 +0000 Subject: [PATCH] [WIX] IB SDK examples updated git-svn-id: svn://openib.tc.cornell.edu/gen1@2774 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/OFED/WIX/SDK_Samples/DDK/README.txt | 45 ++++++++++++---------- trunk/OFED/WIX/SDK_Samples/DDK/SOURCES | 6 +-- trunk/OFED/WIX/SDK_Samples/DDK/makefile | 2 +- trunk/OFED/WIX/SDK_Samples/VS/Makefile.x64 | 8 ++-- trunk/OFED/WIX/SDK_Samples/VS/Makefile.x86 | 11 ++++-- trunk/OFED/WIX/SDK_Samples/VS/README.txt | 20 +++++----- 6 files changed, 50 insertions(+), 42 deletions(-) diff --git a/trunk/OFED/WIX/SDK_Samples/DDK/README.txt b/trunk/OFED/WIX/SDK_Samples/DDK/README.txt index d3f55fee..9c5257d2 100644 --- a/trunk/OFED/WIX/SDK_Samples/DDK/README.txt +++ b/trunk/OFED/WIX/SDK_Samples/DDK/README.txt @@ -1,48 +1,51 @@ -DDK (Driver Development Kit) Build Environment Example [12-06-07] +WDK (Windows Driver Kit) Build Environment Example [4-08-10] ----------------------------------------------------------------- -Install the Windows Server 2003 (SP1) DDK see -http://www.microsoft.com/whdc/devtools/ddk/default.mspx . +Install the Windows WDK see + http://www.microsoft.com/whdc/Devtools/wdk/default.mspx -Why use the DDK? Windows Server 2003 DDK (SP1) is what's used to build the WinOF +Why use the WDK? WDK (600.16385.0) is what's used to build the OFED for Windows distribution. -Installing the DDK first requires burning a CD of the downloaded DDK - sigh... +Installing the WDK first requires burning a CD of the downloaded WDK - sigh... -Due to the problematic nature of spaces in path names, Windows Server 2003 DDK -does not allow spaces in pathnames; this is why IBSDK is not installed under -WinOF. +Due to the problematic nature of spaces in path names, the Windows Driver Kit +does not allow spaces in pathnames; Due to the spaces in %ProgramFiles%\OFED +path, the OFED_SDK is not installed under %ProgramFiles%\OFED. +See %SystemDrive%\OFED_SDK\ Building CM test example ------------------------ -Start a 'Free/Release' type DDK command prompt for you respective architecture [x86,amd64,ia64]. +Start a 'Free/Release' type WDK command window for you respective architecture +[x86,amd64,ia64]; assumed OS is Windows Server 2008 R2 (aka win7). -cd to C:\IBAL\Sampes\DDK +cd to %SystemDrive%\OFED_SDK\Samples\DDK -Set the 'OPENIB_REV' env variable to the svn version number. -Hold the mouse-point over the file 'C:\Program Files (x86)\WinOF\opensm.exe'. +Set the 'OPENIB_REV' env variable to the svn version number; any # will work. +Hold the mouse-point over the file 'C:\Program Files\OFED\opensm.exe'. The last field of the 'File Version' field is the svn revision number. -set OPENIB_REV=917 +example: set OPENIB_REV=917 -If building an 32-bit cmtest version on an x64 platform, edit Sources file by adding '32' to -ibal.lib and complib.lib, resulting in 'ibal32.lib' and 'complib32.lib'. -Note - executable will be appear as 'objfre_wnet_x86\i386\cmtest.exe'. +If building an 32-bit cmtest version on an x64 platform, edit Sources file by +adding '32' to ibal.lib and complib.lib, resulting in 'ibal32.lib' and +'complib32.lib'. +Note - executable will be appear as 'objfre_win7_x86\i386\cmtest.exe'. -build -wg +build /wg The executable will be created in a processor specific directory: x64 (Release/Free) example: - C:\IBAL\Sampes\DDK\objfre_wnet_amd64\amd64\cmtest.exe + %SystemDrive%\OFED_SDK\Samples\DDK\objfre_win7_amd64\amd64\cmtest.exe x64 (Checked/Debug)) example: - C:\IBAL\Sampes\DDK\objchk_wnet_amd64\amd64\cmtest.exe + %SystemDrive%\OFED_SDK\Samples\DDK\objchk_win7_amd64\amd64\cmtest.exe x86 (Release/Free) example: - C:\IBAL\Sampes\DDK\objfre_wnet_x86\i386\cmtest.exe + %SystemDrive%\OFED_SDK\Samples\DDK\objfre_win7_x86\i386\cmtest.exe Executing cmtest.exe -------------------- @@ -54,7 +57,7 @@ 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 +Server side: cmtest -s -l0xlll -r0xrrr -m1024 -n100 Client side: cmtest.exe -l0xlll -r0xrrr -m1024 -n100 diff --git a/trunk/OFED/WIX/SDK_Samples/DDK/SOURCES b/trunk/OFED/WIX/SDK_Samples/DDK/SOURCES index 99254f96..160f23fd 100644 --- a/trunk/OFED/WIX/SDK_Samples/DDK/SOURCES +++ b/trunk/OFED/WIX/SDK_Samples/DDK/SOURCES @@ -2,12 +2,12 @@ TARGETNAME=cmtest TARGETPATH=obj$(BUILD_ALT_DIR) TARGETTYPE=PROGRAM UMTYPE=console -USE_CRTDLL=1 -_LIBS=..\..\Lib +USE_MSVCRT=1 +_LIBS=C:\OFED_SDK\Lib SOURCES=cmtest.c cmtest.rc -INCLUDES=..\..\Inc; +INCLUDES=C:\OFED_SDK\Inc; TARGETLIBS= \ !if $(FREEBUILD) diff --git a/trunk/OFED/WIX/SDK_Samples/DDK/makefile b/trunk/OFED/WIX/SDK_Samples/DDK/makefile index f86adf81..46abe2e5 100644 --- a/trunk/OFED/WIX/SDK_Samples/DDK/makefile +++ b/trunk/OFED/WIX/SDK_Samples/DDK/makefile @@ -4,4 +4,4 @@ # that is shared by all the driver components of the OpenIB Windows project. # -!INCLUDE C:\IBSDK\Inc\openib.def +!INCLUDE C:\OFED_SDK\Inc\openib.def diff --git a/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x64 b/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x64 index 0bc70cc0..a09bb5e1 100644 --- a/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x64 +++ b/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x64 @@ -3,7 +3,7 @@ # # NMAKE Options (passed as macro) # -# Select a Visual Studio 2005 command window from the start menu +# Select a Visual Studio command window from the start menu # vcvarsall X64 - sets X64 processor compilation env, X86 | IA64 # #*********************************************************************/ @@ -27,8 +27,8 @@ SRC=cmtest -LIB_PATH=C:\IBSDK\Lib -INC_PATH=C:\IBSDK\Inc +LIB_PATH=C:\OFED_SDK\Lib +INC_PATH=C:\OFED_SDK\Inc IB_LIBS=ibal.lib complib.lib @@ -60,7 +60,7 @@ CC_FLAGS= /nologo /Gy /W3 /Gm- \ LINK = link -LIBS = ws2_32.lib advapi32.lib User32.lib bufferoverflowU.lib +LIBS = ws2_32.lib advapi32.lib User32.lib LINK_FLAGS = /nologo /subsystem:console /machine:$(ARCH) $(LIBS) \ /libpath:$(LIB_PATH) $(IB_LIBS) diff --git a/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x86 b/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x86 index 64070763..3631e063 100644 --- a/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x86 +++ b/trunk/OFED/WIX/SDK_Samples/VS/Makefile.x86 @@ -27,10 +27,13 @@ SRC=cmtest -LIB_PATH=C:\IBSDK\Lib -INC_PATH=C:\IBSDK\Inc +LIB_PATH=C:\OFED_SDK\Lib +INC_PATH=C:\OFED_SDK\Inc -IB_LIBS=ibal.lib complib.lib +# For x86 on x64 system: IB_LIBS=ibal32.lib complib32.lib +# For x86 on x86 system: IB_LIBS=ibal.lib complib.lib + +IB_LIBS=ibal32.lib complib32.lib DEFS= /D_WIN32 @@ -60,7 +63,7 @@ CC_FLAGS= /nologo /Gy /W3 /Gm- \ LINK = link -LIBS = ws2_32.lib advapi32.lib User32.lib bufferoverflowU.lib +LIBS = ws2_32.lib advapi32.lib User32.lib LINK_FLAGS = /nologo /subsystem:console /machine:$(ARCH) $(LIBS) \ /libpath:$(LIB_PATH) $(IB_LIBS) diff --git a/trunk/OFED/WIX/SDK_Samples/VS/README.txt b/trunk/OFED/WIX/SDK_Samples/VS/README.txt index 99d41736..67e901bc 100644 --- a/trunk/OFED/WIX/SDK_Samples/VS/README.txt +++ b/trunk/OFED/WIX/SDK_Samples/VS/README.txt @@ -1,13 +1,15 @@ -Visual Studio 8/5.0 (C++) Build Environment [12-06-07] +Visual Studio (C++) Build Environment [4-07-10] ----------------------------------------------------------------- -Install Microsoft Visual Studio 8/5.0 (C++ env) +Install Microsoft Visual Studio 10 (C++ env) **** WARNING - win32 application building **** -The Visual Studio default calling convention is '__cdecl' (/Gd). +Disregard if building x64 application. + +The Visual Studio default x86 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 @@ -18,11 +20,11 @@ The other option is to force __stdcall (/Gz) as the 'default' calling convention for your 'win32' InfiniBand application. -Building CM test example ------------------------- +Building CM test example from a cmd.exe window +---------------------------------------------- -cd to C:\IBAL\Samples\VS +cd to %SystemDrive%\OFED_SDK\Samples\VS Makefile Solution @@ -50,9 +52,9 @@ Select a C++ console application project. 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 . + set additional Include path as C:\OFED_SDK\Inc + set additional Resource Include path as C:\OFED_SDK\Inc + Set additional Library path as C:\OFED_SDK\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 -- 2.41.0