E2Studio/gitlab/make questione2studio

Don't know which is the correct forum for this but I have recently imported a project from HEW to e2studio.  Manually rather than use the import function as we have lots of special processes involved.

The project builds fine but I would like to run the makefile it generates from the command line so that I can use a gitlab runner to compile the project.

So far I have checked into gitlab all the makefile, the makefile.init objects.mk, source.mk and any subdir.mk files.


If I run the makefile from the HardwareDebug directory using the following command

>c:\Renesas\e2_studio\Utilities\make -j4 all 

everything build fine.

In gitlab I have registered a runner to execute the following script to build

  - cd HardwareDebug
  - c:\\renesas\\e2_studio\\utilities\\make -j4 all

this almost works but finishes with the following error



rx-elf-gcc -T "C:/WorkSpace/90460_SmartCell_CIE_Eclipse/generate/linker_script.ld" -L"C:\WorkSpace\90460_SmartCell_CIE_Eclipse\HardwareDebug" -Wl,-M=90460_SmartCell_CIE_Eclipse.map -Wl,--start-group -l90460_SmartCell_CIE_Eclipse -lgcc -Wl,--end-group -nostartfiles -Wl,-e_PowerON_Reset -o "90460_SmartCell_CIE_Eclipse.elf"

c:/program files (x86)/kpit/gnurxv16.01-elf/rx-elf/rx-elf/bin/../lib/gcc/rx-elf/4.8-GNURX_v16.01/../../../../rx-elf/bin/ld.exe: cannot find -90460_SmartCell_CIE_Eclipse

collect2.exe: error: ld returned 1 exit status
makefile:88: recipe for target '90460_SmartCell_CIE_Eclipse.elf' failed
make: *** [90460_SmartCell_CIE_Eclipse.elf] Error 1



Here is the correct ending when running from the command line

rx-elf-gcc -T "C:/WorkSpace/90460_SmartCell_CIE_Eclipse/generate/linker_script.ld" -L"C:\WorkSpace\90460_SmartCell_CIE_Eclipse\HardwareDebug" -Wl,-M=90460_SmartCell_CIE_Eclipse.map -Wl,--start-group -l90460_SmartCell_CIE_Eclipse -lgcc -Wl,--end-group -nostartfiles -Wl,-e_PowerON_Reset -o "90460_SmartCell_CIE_Eclipse.elf"
'Finished building target: 90460_SmartCell_CIE_Eclipse.elf'
' '
'Invoking Object Copy'
rx-elf-objcopy "90460_SmartCell_CIE_Eclipse.elf" -O srec -I elf32-rx-be-ns "90460_SmartCell_CIE_Eclipse.mot"
'Finished building: 90460_SmartCell_CIE_Eclipse.mot'
' '



Has anyone successfully run the make process from gitlab or come across the error above.



  • . The instructions are misleading. When you build the project using the IDSE, E2 Studio generates a makefile for the computer that is running the build. This means that all compiler variables, e.g. {workspace_loc} is resolved to the absolute path. This means that the makefiles generated are usually only good for the computer they are running on. If you have to check in a makefile, you're doing it wrong.

    Instead, you're going to have to use e2studio.exe and run a headless build. Go to Help > Search in E2 Studio and search "headless build." These instructions are misleading. Instead, here in an example of the command line call I'm calling with our Jenkins server:

    C:\Renesas\e2_studio\eclipse\e2studio.exe -nosplash -debug -consolelog -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data c:\work\project\MyE2StudioProjectFolder -import C:\Temp\APathForATemporaryWorkspace -build all

    Also, if your builds requires a license to build, you need to set up an environment variable "AMS_LICENSE_PATH" with the value being the location of the .xml license file. This license file gets imported while compiling.

    FWIW, the latest E2 Studio version has produced better results (less error windows) than when I was using Try this out and see how far you get.
  • KL thanks for the input, this would seem to be how I need to go to be more portable between projects, however I still have issues.

    If I specify the exact paths of the project then the command works, however what actually happens is that gitlab checks out the project to the runner file system directory but performs the build on the original workspace, which works while the project is also on my local machine but once moved to the dedicated build machine it won't actually be there.

    I tried modifying the command so that the -import used ..\my_project_name as the parameter and it has no -data option (there isn't any info on this parameter in the help)

    This works when it is in the actual build directory, however if the project is checked out to a separate space, as it is when gitlab-runner executes then it does not build.

    Could there be any settings within the project that also need changing.

    Any suggestions greatfully received.
  • More information.

    I thought that the issue might be the lack of workspace in the area where the project was being built, so I created a new workspace in a separate area and imported the project into it. This gave me what looked like 2 identical areas and inside e2studio I can build each project within it own workspace. If I then use the same command format with relative paths or the same command but with any paths specified in full for each project/workspace then it still only works in the original workspace and project area.
  • Paul,

    FWIW, you cannot create a workspace inside of a project folder, so remember not to do something like -import ./tempWorkspace, rather it should be something like ../tempWorkspace. This is a limitation of E2 Studio.

    I'm actually not entirely sure the build would be possible using Gitlab. Are you allowed to installed E2 Studio and SSP (if used) on the file runner machine? In order to automate builds, the software is required to be on the build machines.

    If you are able to install the software on the build machine, be sure that you "Generate Project Files" and have all those files checked into git--it sounds like you do. But kicking off a build won't generate the files when using the headlessbuild I'm pretty sure.

    Also, I suppose you should check your license into your git repo. In the build script, you should do something like "set AMS_LICENSE_PATH=./MyLicenseFile.xml" to get the environment variable loaded into the build machine.

    Sorry, I'm sort of all over the place as I'm not exactly sure of your setup at this time. Keep asking questions and I'll try to address them the best I can.
  • Your first point makes sense and I was using double .\

    The annoying thing was that I just copied the workspace and project directory from one place to another and the same command in the original place works but in the new place says that the project already exists in the workspace.

    I am able to install e2studio and gcc on the build machine so that isn;t a problem. I'm developing for RX600 using GCC so the AMS_LICENSE_PATH is required, and in fact when I was using the make files I successfully built using git runner and used the artifacts to store the resulting .mot file with the build. As you say though using this method means having to maintain the makefiles in git which I'd rather not do.

    I get the feeling that its all to do with getting the right references and everything. Does the -import add a project outside of a workspace into the workspace, if so this may be what I need to do but it won't be as easy to manage. Maybe I need to execute from the workspace directory.

    It's so frustrating because I'm so close and its taken a while to get our project successfully transfered from HEW to eclipse so that we can use the runners rather than our own custom (and fiddly) build scripts.
  • You specify a temporary workspace location (i.e. -data C:\Temp\APathForATemporaryWorkspace) and E2 Studio will create that location (assuming it has admin rights/write access) and it will import the project (i.e. -import c:\work\project\MyE2StudioProjectFolder) into your temporary workspace and build.

    One thing to remember to do is, you shouldn't check in your workspace files into GitHub/lab, and the objective is to only put required source code in your repo (along with .project, .cproject, .settings, etc.) and eventually be able to clone the repo, import it into E2 Studio, and click Build and have it build successfully. The "creating the workspace" portion should be done either 1) manually using "Import" in menu bar or 2) using the headlessbuild process in which you give it a directory location that doesn't already have a workspace created for it.

    Stay persistent, you'll get it :)

  • Almost there now, your suggestions are definitely helping. The options you specify are I think the wrong way around, -import specifies the project to import -data specifies the temporary workspace path.

    I have managed to build from the command line, now to edit the .yml file to complete the build automatically.
  • Good catch--I had poor variable names in my scripting that caused that. Fixed it and marked it as proposed answer. Let me know if you get it! Good luck!
  • OK, I've got it to a state where it is working. Git-Runner checks out the project file and creates a .tmp directory as well. I use that directory to host the workspace. The .yml looks like this

    - cd ..
    - dir
    - c:\\Renesas\\e2_studio\\eclipse\\e2studio.exe -nosplash -debug -consolelog -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import .\\ProjectName -data .\\ProjectName.tmp -build all

    The only issue now is that the -build all does all configurations and I only want the release build.

    I have tried replacing the all with Release, .\ProjectName\Release .\ProjectName.tmp\Release and all that happens when executing from the command line is that the build finishes prematurely with no indication of why.

    Any Clues on where to look for the resolution of this.
  • more information, If I specify ProjectName as the -build option with a build configuration then it builds the default configuration for the project
  • Good information Paul. Glad you got it working!

    I have a ticket open with the E2 Studio team, hoping to make it a much easier to work with in the future. One of the items is, being able to specify which configuration you want to build, amongst many others.
  • Some additional information:

    1. Directories that don't need to be added to git: build configuration folders (Debug & Release), synergy, src/synergy_gen, synergy_cfg
    2. You can specify which configuration to build by using "-build <projectName>/<buildConfigurationName>"
    3. With e2 studio version (I'm not sure about newer), you should check-in the (usually) hidden ".module_description" directory into git. If you don't see this folder, you can generate it by opening the configuration.xml in e2 studio.
  • Bearing in mind I am not using synergy in this project.

    The -build does not work as specified even from command line.
    The .module_description directory doesn't exist and the configuration.xml file doesn't exist.

    There is a .launch file for the build configuration which looks like xml but this is already in .git and opening it causes nothing else to be generated
  • When doing an automated "headless" build, is it possible to perform the equivalent of e2 studio's "Generate Project Content" ?


  • From what I could tell, after deleting all the synergy generated directories (src/synergy_gen, synergy_cfg, synergy), and running the headless build command, all files are regenerated--this would be equivalent to clicking "Generate Project Content."

    I would ask yourself if you really want to do that. I ***THINK*** doing this means you're regenerating project files every time and therefore you won't know when files actually change, also meaning build output could change from build to build without your knowledge. I think we may check all our generated files in so we don't have to regenerate after every build and we know whats going into our firmware images.