[GE dev] How to compile on windows?

opoplawski orion at cora.nwra.com
Fri Dec 18 23:59:48 GMT 2009

On 12/17/2009 11:41 AM, pollinger wrote:
> If you don't have the Microsoft VisualStudio 7, you still can build all
> Interix binaries, but not the Win32 binaries. You will have to comment
> out the WIN32_APPLICATIONS section in the aimk script. Perhaps there
> should be added a "-no-win32" option.
> You can get gcc and gmake from
> http://www.suacommunity.com/tool_warehouse.aspx
> Get the sources to a shared directory and follow the normal build
> instructions on a UNIX host. When everything compiles successfully on
> the UNIX host, go to the Windows host and run in the same shared directory:
> # aimk -no-java -debug -no-opt


Here's what I ran into with Visual Studio Express 2008 and SUA 6.1 on 
Windows Server 2008 R2 x64 (nothing like your build machine I suppose, 
but it's what I have):

Building in directory: /dev/fs/Z/src/gridengine/source
making in WIN32_X86/ for WIN32_X86 at host font1
env TMP=C:\\TEMP cl.exe /Od /D WIN32 /D _DEBUG /MTd /Zi /D WINDOWS /D 
-I'C:\VisualStudio\Vc7\atlmfc\include' -I'..\\common' -I'..\\utilbin' 
-I'..\\libs\\juti' -c ../utilbin/windows/qloadsensor/qloadsensor.c
c1 : fatal error C1083: Cannot open compiler intermediate file: 
'C:\TEMP\_CL_9637a79cex': No such file or directory
gmake: *** [qloadsensor.obj] Error 2
not done

Okay, removed the TMP=..  from WINCC.  No C:\TEMP in Windows 2008.

Changed include and library paths to:
    set WINCFLAGS = "${WINCFLAGS} -I'C:\Program Files\Microsoft 
    set WINCFLAGS = "${WINCFLAGS} -I'C:\Program Files (x86)\Microsoft 
Visual Studio 9.0\VC\include'"

    set WINLFLAGS = "${WINLFLAGS} /LIBPATH:'C:\Program Files\Microsoft 
    set WINLFLAGS = "${WINLFLAGS} /LIBPATH:'C:\Program Files 
(x86)\Microsoft Visual Studio 9.0\VC\lib'"

Couldn't compile SGE_Helper_Service/Communication.cpp because I seem to 
be missing afxtempl.h.

Okay -no-win32 -> comment out set MAKEWINGRIDAPP = 1 in aimk. 
Interestingly, -only-core and other -only-* options set MAKEWINGRIDAPP = 
0, but before the case WIN32_X86 sets it back to 1.

ar rscv libwingrid.a wingrid.o windows_gui.o sge_passwd_lib.o
ar: invalid option 's'
     ar [-m x86 | amd64 | ia64 ]-d|r[u]|t|x  -[cv] archive file...
gmake: *** [libwingrid.a] Error 2
not done

Looks like it's picking up /bin/ar before /opt/gcc.3.3/bin/ar, fix PATH.

gcc -DSGE_ARCH_STRING=\"win32-x86\" -Wall -Werror -O0 -pipe -DWIN32_X86 
-DLOAD_OPENSSL -I/usr/include/../include -DTARGET_32BIT 
-D__SGE_NO_USERMAPPING__ -I../common -I../libs -I../libs/uti 
-I../libs/juti -I../libs/gdi -I../libs/japi -I../libs/sgeobj 
-I../libs/cull -I../libs/rmon -I../libs/comm -I../libs/comm/lists 
-I../libs/sched -I../libs/evc -I../libs/evm -I../libs/mir -I../libs/lck 
-I../daemons/common -I../daemons/qmaster -I../daemons/execd 
-I../daemons/schedd -I../clients/common -I. -I../libs/wingrid  -c 
../libs/sgeobj/sge_jsv.c: In function `jsv_create':
../libs/sgeobj/sge_jsv.c:128: warning: long int format, int arg (arg 3)
../libs/sgeobj/sge_jsv.c: In function `jsv_get_pid':
../libs/sgeobj/sge_jsv.c:179: warning: long int format, pid_t arg (arg 3)
../libs/sgeobj/sge_jsv.c: In function `jsv_set_pid':
../libs/sgeobj/sge_jsv.c:190: warning: long int format, pid_t arg (arg 3)
gmake: *** [sge_jsv.o] Error 1

Drop -Werror for now....

gcc -DSGE_ARCH_STRING=\"win32-x86\" -Wall -O0 -pipe -DWIN32_X86 
-DLOAD_OPENSSL -I/usr/include/../include -DTARGET_32BIT 
-DSPOOLING_dynamic -DSECURE -I/usr/local/ssl/include -DNO_JNI 
-DCOMPILE_DC -D__SGE_NO_USERMAPPING__ -I../common -I../libs 
-I../libs/uti -I../libs/juti -I../libs/gdi -I../libs/japi 
-I../libs/sgeobj -I../libs/cull -I../libs/rmon -I../libs/comm 
-I../libs/comm/lists -I../libs/sched -I../libs/evc -I../libs/evm 
-I../libs/mir -I../libs/lck -I../daemons/common -I../daemons/qmaster 
-I../daemons/execd -I../daemons/schedd -I../clients/common -I. 
-I../libs/wingrid -o test_sge_object -g  -DSGE_LOCK_DEBUG 
-L/usr/lib/../lib -L. -L/dev/fs/Z/src/gridengine/source/WIN32_X86 
-L/usr/local/ssl/lib test_sge_object.o libsgeobj.a libsgeobjd.a 
libcull.a libcomm.a libcommlists.a libuti.a -lwingrid -ldl librmon.a 
-ldl liblck.a  -lm -lpthread
collect2: ld terminated with signal 11 [Segmentation fault]


Okay, apparently ld is not permitted to write executables to shared 
network drives.  So, copy the source tree to the local disk....  Nope, 
still the same.

That's where I'm stuck at the moment.  Could be a 32-bit/64-bit issue...

- Orion

Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion at cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com


To unsubscribe from this discussion, e-mail: [dev-unsubscribe at gridengine.sunsource.net].

More information about the gridengine-users mailing list