Wednesday 5 September 2012

debugging compile and link problems for JDE on linux

The compilation & link process on linux for JD Edwards is pretty simple at the end of the day.

The package build process on the deployment server (or thick client) sends over all of the C and include files into $EVRHOME/packages/<packagename> folder.  All of the source files are separated by DLL name, this is handy when linking source files back to DLL name.

Once this is done, the deployment server instructs the package build kernel to start compiling and then linking.

JDE.INI file settings are read for these commands, so it gives you a chance to add in your own libraries if you are compiling them in on the server – nice!

[BSFN BUILD]
BuildArea=/u01/jdedwards/e900/packages
OptimizationFlags=-O3 -fno-strict-aliasing
DebugFlags=-g -D_DEBUG -DJDEDEBUG
InliningFlags=
DefineFlags=-DKERNEL -DPRODUCTION_VERSION -DNATURAL_ALIGNMENT -D_GNU_SOURCE
#CompilerFlags=-fPIC -Wall -m32 -c
CompilerFlags=-fPIC -m32 -c
OSReleaseLevel=
LinkFlags=-melf_i386 -shared -L/u01/jdedwards/e900/system/lib -ljdesaw -z muldefs
LinkLibraries=
SimultaneousBuilds=5

 

Sample INI file section above

All Compile logs are written to $EVRHOME/packages/<packagename>/CompileLogs/DLLNAME/source.err

To view all of the errors at compile time, enter a command like “find $EVRHOME/packages/packagename  –name *.err –exec more {} \;

Note that if you use package build history, they’ll be appended too – which is sometimes a pain. change the –exec more {} \; to rm –f {} \; to delete them all for a a retry.

You generally get problems with includes or missing DSTR items in these logs.

A compile command in JDE looks something like:

cc -fPIC -m32 -c -O3 -fno-strict-aliasing  -DKERNEL -DPRODUCTION_VERSION -DNATURAL_ALIGNMENT -D_GNU_SOURCE -DUSESPECIALGPA4BB -DUSETABLEHEADERFROMINCLUDEA   -I/u01/jdedwards/e900/packages/PD900FB/include/  -I/u01/jdedwards/e900/system/include  -I/u01/jdedwards/e900/system/include/xml  -I/u01/jdedwards/e900/system/includev '

Then

'cc -E -fPIC -m32    -O3 -fno-strict-aliasing  -DKERNEL -DPRODUCTION_VERSION -DNATURAL_ALIGNMENT -D_GNU_SOURCE -DUSESPECIALGPA4BB -DUSETABLEHEADERFROMINCLUDEA   -I/u01/jdedwards/e900/packages/PD900FB/include/  -I/u01/jdedwards/e900/system/include  -I/u01/jdedwards/e900/system/include/xml  -I/u01/jdedwards/e900/system/includev '.

Linking

This is more problematic on linux.  There are quite a few issues on support.oracle.com about this. 

At the end of the day, JDE runs a command like the following to kick off the compile and link, you can do this yourself to QUICKLY test changes that you make to the ini or includes on the server.  Note that any changes to the JDE.INI will be read immediately by this command, because it’s a new process.

builddll /u01/jdedwards/e900/packages/PD900FB/text/JDBTRG3.txt

It writes status to:

/u01/jdedwards/e900/packages/PD900FB/text/JDBTRG3.sts

It writes logs to

builddll /u01/jdedwards/e900/packages/PD900FB/text/JDBTRG3.log

So, once all of the compiling is complete, it runs the link for all the .o’s that it’s created:

'ld -melf_i386 -shared -L/u01/app/jdedwards/e900/system/lib -ljdesaw -z muldefs -o /u01/jdedwards/e900/packages/PD900FB/bin32/libJDBTRG4.so *.o >> JDBTRG4.log 2>&1'

Pretty simple hey.  You can manually run any of these commands to check out which of your settings are not right in the JDE.INI and fix them

No comments: