Building and Running a New Project

You have just created a new Project as described in the tutorial on Creating a New Project.  Now you want to build and run it.

Check the Properties

It is easier if you are in the C/C++ Perspective with both the C/C++ View and the Navigator View available.

First, go to the project in the Navigator View and right click to get properties.  Look at the EPICS IDE properties.  You won't be able to see them in the C/C++ Projects View.  It should look something like this:


Check that the properties are what you expect.

Next go to the C/C++ Make Project properties.  (This is available from the C/C++ Projects View, and you could have started there if you weren't worried about EPICS IDE properties.)


Be sure the build directory is specified.  If not, you can browse for it.  It should be the project directory.  Next check the C/C++ Make Project properties.


In the Environment tab HOST_ARCH should be defined to be your host architecture.  If you are using a 3.14 base, this variable could be EPICS_HOST_ARCH, but HOST_ARCH will work for both 3.13 and 3.14 (provided only one is defined).  You might want to define this as a preference for C/C++ Make Project under Window | Preferences.  Then you won't have to change it every time.

If you are using a platform, such as Linux or Solaris, that needs LD_LIBRARY_PATH set, then you can set that on this tab also.    The directory for LD_LIBRARY_PATH  is where the shared object libraries from base are located.  It should be <your_base>/bin/<host_arch>, where your_base is the location of the base you want to use, and host_arch is the same as you set for HOST_ARCH.  Whether you choose Append environment to native environment or Replace native environment with specified environment the LD_LIBRARY_PATH specified here will override anything that was set elsewhere.  If you need other things in the LD_LIBRARY_PATH, then you need to include them all here.  The same applies to PATH if you set it here.


In the C/C++ Projects view, right click the project and choose Build Project or Rebuild Project.  Build does a "make all", and rebuild does "make clean all".  If Build Project doesn't work, try Rebuild Project.  The first time it doesn't make any difference. You can also do this in the Navigator view by choosing Build Make Target and defining a target "all".

The build output should be in the C-Build Console.  If it was not successful, you will have to troubleshoot.

Your workspace should look something like this after the build.  Notice that new directories have bneen created, and the build output is in the Console.


Note that if you are are on Windows and using Cygwin Make 3.81, then you will get an error somehting like "MakefileInclude *** multiple target patterns" instead of the nice result above. See the Cygwin Note for ways to resolve this problem.


With any luck your project is now built successfully.  To run it you need to make a launch configuration.  In the Run menu at the top of Eclipse, select Run....  Select a new C/C++ Local Application.


Select a project using the Browse button.  Then pick the C/C++ Application.   The Search Project button should help.  If not, enter something like the above. The executable should be in the bin directory under your host architecture.  (If there are no executables visible in the Search Project dialog, then you may need to configure your C/C++ Make Project settings to include more Parsers.) Next go to the Arguments tab.


Enter "st.cmd" for the C/C++ Program Arguments.  Uncheck Use default working directory.  We need to be in the directory where st.cmd is located. Then define the working directory to be where st.cmd is located (under iocBoot uder the name of your IOC).  The Workspace button should help.  If not, use something like the above.

Then select Run.  With any luck, it will run in the Console, and you will see some lines including:

iocInit: All initialization complete

and then


Enter "dbl" at the prompt to see what process variables are there.  If it doesn't work, you will have to troubleshoot.  Otherwise, you should have a working IOC.  Type "exit" to end it or use the red square on the Console