510 likes | 646 Vues
This guide provides step-by-step instructions for building GNU Electric version 8.08 from source code using Java SDK and Eclipse (Ganymede) as the development environment. It covers setting up the software environment, creating a new project, building the project, and troubleshooting errors through debugging. Key topics include configuring the default workspace, modifying the build configuration, and using the debugger to capture exceptions when processing user-defined Technology Files. References are provided for additional resources on Java, Eclipse, and GNU Electric.
E N D
by Kazzz (a Japanese engineer) May 11th, 2009 (created the original) May 30th, 2009 (modified for posting to ) June 2nd, 2009 (added information on Java 3D environment) Building and debugging GNU Electric version 8.08by Java SDK & Eclipse (Ganymede)
Objectives • To build GNU Electric 8.08 from its source code by using Java SDK and Eclipse 3.4.2 (Ganymede) • To use the source code debugger to survey different causes of exceptions thrown by Electric while processing a user-defined Technology File
Some icons used throughout this document • Set the default workspace # 02 Micro-steps to be followed sequentially • Uncheck “Build Automatically” flag # 03 Options/points to be carefully checked
References You should refer to : [1] Not available yet! [2] http://java.com/en/ for Java [3] http://www.eclipse.org/for Eclipse [4] http://www.staticfreesoft.com/productsFree.html for GNU Electric ✔
Index Part-I Setting up Software Development Environment Part-II Creating a New Project Part-III Building the New Project Part-IV Debugging GNU Electric
Part-I Setting up Software Development Environment
01. Java Runtime and SDK The images were captured on Japanese Windows throughout this document. Therefore, wherever you see a Yen mark in a file path, please understand that it corresponds to a “back slash” character in the non-Japanese world. • The tools listed below are assumed as Java development environment
Customization of Java environment made for my convenience Manually copied --- for some reasons; cannot remember ;-( The modified “build.xml” file embedded in slide #26 reflects this organization as shown below.
02. Eclipse ✔ • The tools checked below are assumed as Eclipse environment ✔ Visit http://www.eclipse.org/downloads/ ✔
Author’s Eclipse environment used in this document ※ C/C++ and Qt tools are not required for building/debugging GNU Electric.
Author’s batch file used to start Eclipse rem ----- Batch file for invoking Eclipse with Qt plug-in ----- rem ----- Qt-related environment variables set QTDIR=D:\Qt\2009.01\qt\ set QMAKESPEC=win32-g++ set MINGWDIR=D:\Qt\2009.01\mingw\ rem ----- Java SDK-related environment variable set JDKDIR=c:\Program Files\Java\jdk1.6.0_13\ rem ----- Set path to all the tools set Path=%JDKDIR%\bin;%MINGWDIR%\bin;%QTDIR%\bin;%Path% rem ----- Invoke Eclipse call eclipse.exe exit This shortcut calls the batch file.
03. Default workspace for Eclipse • Invoke Eclipse # 01 • Set the default workspace # 02
Uncheck “Build Automatically” flag # 03 This option is useful for incremental building. As I’m going to build everything from scratch, let’s suppress this feature for the time being. Otherwise, compilation will automatically start while importing a Jar file to a new Java project.
Part-II Creating a New Project
01. Create a new project for GNU Electric • Create a new Java project # 01
Select the JAR file of GNU Electric 8.08 # 03 Not “electricBinary-8.08.jar”
Configure Build Path # 04
02. Information on how-to-build • Go through “README.txt” file # 01 • Read “Building from Sources” section carefully # 02
03. Edit “build.xml” file for Ant tool • Copy then paste “build.xml” to backup the original one # 01
Edit “build.xml” according to the information described in “README.txt” file. • For example, Macintosh-related descriptions are to be removed. # 02 Modified Original : : : : Unpack and compare these two files for details The above tool is Slide #8
Delete “MacOSXInterface.java” file, which is not necessary for Windows # 03
Optionally edit a file to modify the splash image # 04 Original Modified
Part-III Building the New Project
01. Build by Ant tool • To clean, follow clean Run As Ant Build # 01
To build, follow compile Run As Ant Build # 02 Successfully built with 91 warnings
Check that the tool has started successfully; watch the console # 04 “Added Technologies” is being loaded…
02. Quickly check that the tool works • Load a library and open a layout cell # 01 Looks OK!
Run NCC # 02 Looks OK!
Run DRC # 03 Exception has been caught!
Check the console of Eclipse workbench # 04 The same exception has also been caught by Eclipse • Click a hyperlink and confirm that the source code can be loaded to the editor view # 05
The location has been correctly identified in the editor view # 06
Part-IV Debugging GNU Electric
01. Configuring the debug setup • Start Debug Configurations … # 01
Setup configuration # 02
02. Start the debugger • Change the perspective to Debug and start the debugger # 01
Load the same library and open the same layout cell as before # 03 Looks OK!
Run NCC # 04 Looks OK!
Run DRC # 05 Exception has been caught and the program has stopped at the break point.
Inspect variable(s) # 06 This is what the author wanted to do!
Resume the execution # 07 Exception has been caught!
Check the console of Eclipse debug perspective # 08 The same exception has also been caught by Eclipse