atom feed3 messages in net.sunsource.gridengine.devRe: [GE dev] Compiling Grid Engine un...
FromSent OnAttachments
Ian R. ChesalJan 19, 2003 9:28 pm.gz, .gz
Andy SchwierskottJan 20, 2003 1:57 am.bat
stoneFeb 20, 2003 11:37 pm 
Subject:Re: [GE dev] Compiling Grid Engine under Cygwin
From:Andy Schwierskott (andy@sun.com)
Date:Jan 20, 2003 1:57:36 am
List:net.sunsource.gridengine.dev
Attachments:

Ian,

What follows are the changes necessary to your Cygwin environment and the latest CVS tree of Grid Engine to COMPILE all the binaries under Cygwin. Note: I have not tested anything yet aside from a few quick command line calls to make sure things don't SegFault right away. And they don't. which I think is promising. I will launch more detailed tests this week. And now follows a rather lengthy text.

I'm looking for comments/suggestions/criticisms of this work. I've never worked with Grid Engine before so it's all educational for me to hear what you have to say.

Oh, and if someone can tell me the equivalent of a 'make clean' with ./aimk I'd be most appreciative. I've just been deleting the source/LINUX6 and source/3rdparty/sge_depend/LINUX6 directories before recompiling and assuming that was a compile from scratch. A -clean option would be nice....

aimk clean

When the 'port' to the Cygwin environment was done a couple of years ago only the CLI client commands have been ported. There was no attempt to compile the SGE daemons. I'm attaching an really outdated 'aimk.bat' (unfortunately with German comments), which might contain some ideas useful for your porting efforts. As you can see the "-DRMONLIGHT" define is a default define in 'aimk.bat'

We'd be glad to get your contribution back in the SGE source code. There is the possibility to get developer status in the SGE project (more details in our project site).

Please keep us updated about your progress!

Andy

Thanks! Ian Chesal

=======

After after a long Sunday and a wee bit 'o tweaking I was able to get Grid Engine to compile under Cygwin 1.3.18. To begin with the following non-standard packages are required for the compilation:

Sun's Cygwin RPC library port: http://www.mail-archive.com/cygwin-apps@cy@ The deprecated Cygwin IPC library: http://www.neuro.gatech.edu/users/cwilson/cygutils/cygipc/

I installed the RPC stuff into /usr and the IPC stuff in to /usr/local (using the precompiled tarball from that site).

You will have to install those before even attempting these steps. I have all the latest Cygwin packages installed on my Windows XP box as of 8:00 am January 19, 2003. And all this is happening on an AMD XP 1900+ running Windows XP. Email if you want more hardware details. I will be testing the binaries on XP and Windows 2000.

The following steps need to be undertaken to "fix" the Cygwin installation to compile Grid Engine:

1. Link /usr/lib/librpc.a to /usr/lib/librpclib.a 2. Link /usr/lib/libcygwin.a to /usr/lib/libdl.a 3. Link /usr/lib/libcygwin.a to /usr/lib/libg.a 4. Link /usr/X11R6/include/X11 to /usr/include/X11/

There are some tweaks to the source you will need to make to get Grid Engine to compile. 99% of the work revolves around defining a sub-target of LINUX6 called CYGWIN and adding the appropriate #if-type macros all over the place. I'm including a diff of the source module that describes all the changes. Make them and you're all set. I'd really like to hear people's comments on my approach to modifying the source for this port; never having touched the Grid Engine source before and all I'm not sure my style is the Grid Engine style.

The compilation process is done in two steps:

1. ./aimk -only-depend -no-intl 2. ./aimk -only-core -no-intl

I couldn't get I18N support going. Someone else can take a whack at that if they really want it.

That's it. The results end up in the source/LINUX6 directory. I'm also attaching a dump of the compile. There are a few warnings. If anyone thinks they need to go away, let me know.

@echo off

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::

:: Erst mal 'ne Dumm-User-Abfrage :)

if NOT "%1%"=="" goto OK

:HELP_MSG

echo.

echo USAGE: %0 [-debug] [-normon] [-noqmon] [-NoWerror] [-help] MakeTarget

echo -help: This message

echo -debug: Compile with debug-info

echo -normon: Don't include remote-monitoring

:: echo -RmonLight: Just build a skeleton monotoring (no remote)

echo -moqmon: Just for compatibility. Actually doesn't do anything

echo since CODINE on NT hasn't a GUI.

echo -NoWerror: Treat warnings as warnings, not as errors

echo MakeTarget: Target to compile. Mandatory! Only one target!

echo.

goto EOF

:: OK, let's get some real work done

:OK

echo setting environment-variables

set SDIR=../src

set DCDIR=../dc

set MSDIR=

set MAKEFILE=%SDIR%/Makefile

:: set QMON_MAKEFILE=../qmon/src/Makefile

:: set DC_MAKEFILE=%DCDIR%/Makefile

set INP_CFLAGS=

set CFLAGS=-I../src -I../utilib -I../apilib -I../cull/src
-I../rmon/src -I../commd -I../history -I../schedd -I../pw -I../shepherd -I../cw3
-I../pvm -I../dc %INP_CFLAGS%

set DEBUG_FLAG=

set STRIP=strip

set CC=gcc

set LFLAGS=

set LIBS=

set RANLIB=echo .

set AR=ar

:: #suns: /usr/bin/ar (no s option) and /usr/5bin/ar (s
option)

set ARFLAGS=rscv

set MAKE=make

set MAKEOPT=

set RMONINC=../rmon/src/rmon.h ../src/codrmon.h

set RMONLIB=librmon.a

set CFLAGS=-DRMONLIGHT %CFLAGS%

set CPROTOCPP=

set WERROR=-Werror

:: -----------------------------------------------------------------------

::

:: Known Bugs:

:: (im Parameter-Parsing)

:: Wird als Argument nur ein Parameter angegeben, so wird dieser

:: als Make-Target anesehen, auch wenn er die Form '-debug' oder

:: aehnlich hat. Das liegt in der Hauptsache daran, dass die NT-

:: Shell keine Stringbearbeitung zulaesst. Ich kann nicht testen,

:: das erste Zeichen ein '-' ist.

::

:: Es wird nur ein Make-Target unterstuetzt, und dieses ist auch

:: noch zwingend.

::

:: Begin LOOP Abfrage der Kommandozeilen-Parameter

:START_CMD_PARAMS

echo parsing commandline parameters

:: Falls keine Params (ausser dem Make-Target) mehr vorhanden,

:: dann Loop abbrechen

:: (Vorlaeufig wird nur ein Make-Target unterstuetzt)

::

if "%2%"=="" goto NO_MORE_PARAMS

:: -debug : Binaries mit Debug-Infos versehen

::

if NOT "%1%"=="-debug" goto NO_DEBUG

set DEBUG_FLAG=%DEBUG_FLAG% -g

set STRIP=echo

:: restart LOOP

SHIFT

GOTO START_CMD_PARAMS

:NO_DEBUG

:: -normon : Keine rmon-Funktionalitaet dazulinken

::

if NOT "%1%"=="-normon" goto NO_NORMON

set CFLAGS=-DNO_COD_COMPILE_DEBUG %CFLAGS%

set RMONINC=

set RMONLIB=

:: restart LOOP

SHIFT

GOTO START_CMD_PARAMS

:NO_NORMON

:: -RmonLight : wenig rmon-Funktionalitaet dazulinken

::

:: if NOT "%1%"=="-RmonLight" goto NO_RMONLIGHT

::

:: set CFLAGS=-DRMONLIGHT %CFLAGS%

::

:: :: restart LOOP

:: SHIFT

:: GOTO START_CMD_PARAMS

::

:: :NO_RMONLIGHT

:: -noqmon : nur Kommandozeilenversion

::

if NOT "%1%"=="-noqmon" goto NO_NOQMON

:: Der Parameter wird einfach nur rausgefiltert, unter

:: NT gibt es nur die Kommandozeilenversion

:: restart LOOP

SHIFT

GOTO START_CMD_PARAMS

:NO_NOQMON

:: -NoWerror : Warnings nur als Warnings und nicht als Errors interpretieren

::

if NOT "%1%"=="-NoWerror" goto NO_NOWERROR

set WERROR=

:: restart LOOP

SHIFT

GOTO START_CMD_PARAMS

:NO_NOWERROR

:: -help : Kurze Syntaxbeschreibubg

::

if NOT "%1%"=="-help" goto NO_HELP

:: restart LOOP

SHIFT

GOTO HELP_MSG

:NO_HELP

:: Es wurde ein Parameter angegeben, der (noch) nicht unterstuetzt wird

::

echo.

echo *** AIMK: Fatal Error, %1% not (yet) supported ***

echo.

goto EOF

:: Hier endet die Abfrage der Kommandozeilen-Paraneter

:NO_MORE_PARAMS

:: -----------------------------------------------------------------------

:: Falls kein Make-Target vorhanden, dann abbrechen

:: (Vorlaeufig wird nur ein Make-Target unterstuetzt)

::

if NOT "%1%"=="" goto MAKE_SOMETHING

echo.

echo *** AIMK: Fatal Error, no Make-Target specified

echo.

goto EOF

::

:: begin section that may need to be tuned.

::

:MAKE_SOMETHING

echo defining Make options

set ARCH=WIN32

::

:: Systemspezifisches fuer Win32

::

:: paralleles make

:: set MAKEOPT=-j 2

set MAKEOPT=

:: set CFLAGS=-O -Wall -Werror -Wstrict-prototypes -DWIN32
%DEBUG_FLAG% %CFLAGS%

:: set CFLAGS=-O -Wall -Wno-char-subscripts -Werror
-Wstrict-prototypes -DWIN32 %DEBUG_FLAG% %CFLAGS%

set CFLAGS=-O -Wall -Wno-char-subscripts %WERROR%
-Wstrict-prototypes -DWIN32 %DEBUG_FLAG% %CFLAGS%

set LFLAGS=%DEBUG_FLAG%

set LIBS=%BMON_LIBS%

set LFLAGS=-static %LFLAGS%

set MAKE=make

set COD_NPROCS_CFLAGS=%CFLAGS%

echo.

echo making %1 in %ARCH%/ for %ARCH%

echo.

echo.

cd %ARCH%

echo ________C_O_R_E__S_Y_S_T_E_M_________

MAKE %MAKEOPT% -f %MAKEFILE% "MAKE=%MAKE%" "CC=%CC%" "CFLAGS=%CFLAGS%"
"SDIR=%SDIR%" "MSDIR=%MSDIR%" "LIBS=%LIBS%" "LFLAGS=%LFLAGS%" "STRIP=%STRIP%"
"RANLIB=%RANLIB%" "AR=%AR%" "ARFLAGS=%ARFLAGS%" "FLOWFLAG=%FLOWFLAG%"
"COD_NPROCS_CFLAGS=%COD_NPROCS_CFLAGS%" "COMPILE_DC=%COMPILE_DC%" %1 %2 %3

if ERRORLEVEL 1 echo *** *** *** not done *** *** ***

goto exit

:DONE

cd ..

echo.

echo done.

echo.

if "%WERROR%"=="-Werror" goto DONT_WARN

echo.

echo *** V O R S I C H T ***

echo *** Warnings wurden _NICHT_ als Errors interpretiert

echo.

:DONT_WARN

:EXIT

cd ..

:: exit 0

:EOF