Failing to build Xilinx project from command line only - eclipse

I have been tasked with creating a build server for a Xilinx project. The developer for the project provided me with the steps he manually takes to do a build, and those work fine. I am now trying to do the build via the command line, so I can set up a script to do the build. From my understanding, the command:
ECLIPSECPATH\eclipsec.exe -nosplash -vm “JAVAVMPATH\jvm.dll” -application org.eclipse.cdt.managedbuilder.core.headlessbuild -build all -data WORKSPACE -vmargs -Dorg.eclipse.cdt.core.console=org.eclipse.cdt.core.systemConsole
Should be the correct command to perform the build (the all caps names being file paths to the various files needed). I use the same command for importing (except -import instead of -build), which does work correctly. But when I run the command, it returns a bunch of errors that are either "Cannot run program "make": Launching failed" or "Error: Program "make" not found in PATH".
The build works just fine when building from the GUI, and I didn't have to use the Tool Change Editor to change anything (it worked by default). Am I missing something from my command, or is there something else I need to set? Are the projects just missing something needed? I'm not a developer, but I would think if it builds from the GUI, the projects have everything they need to build.

I have a project where I run a Xilinx eclipse project in headless mode. It is on a Linux system, but I think what I am about to say applies to windows too.
When one of the Xilinx GUI apps run the first thing they do is source some environment settings. If you are not sourcing this before you run the command line above then you may be missing some paths in the environment, in particular the path to "make" which is not part of windows.
There is a batch file under C:\Xilinx\SDK\2014.4\ (or whichever version you have installed) called settings64.bat.
Running this before the eclipse command line should setup the tool environment you require.
C:\Xilinx\SDK\2014.4\settings64.bat
As part of the setup I also run this to help setup the workspace.
xsdk -wait -script sdk.xml -workspace WORKSPACE

Related

Eclipse Makefile project to be built within a Cygwin environment

We have a project (C) (not a Cygwin exe project, but some embedded cross-compiled one), which has a Makefile designed to be used from within a Cygwin environment. That is the intended use is to open a Cygwin terminal, go t the project directory and run make from there.
I can import this project in Eclipse as a Makefile project, but apparently the regular build command from within Eclipse won't work as it is trying to invoke make in the native (Windows) environment. Is there a way to make Eclipse to run the Cygwin, invoke a make command in it and have the regular CDT error parsers to work? Perhaps by creating a custom builder?
I have managed to work around this problem by using a build script invoking some cygwin commands:
build.bat:
#echo off
c:\cygwin64\bin\bash --login -c "cd %cd:\=/%; make %*"
Breakdown:
c:\cygwin64\bin\bash --login -c "<command>" - used to invoke a command from within cygwin environment
cd %cd:\=/%; - is a "dos" %cd% variable (current path) with backslashes replaced by slashes - to avoid these to be stripped down as unescaped.
make %* - invoke the cygwin make command with all of the arguments passed to this batch file - this is to let Eclipse pass the build target and/or build flags.
Now in "project build" tab in eclipse I replace the make command with build.bat and it is working like a charm. The only drawback i to have this file in addition to the other project files, but since it is pretty generic it can be reused in any project with these restrictions.

Eclipse CDT Headless build hangs after build is finished

I am in the process of implementing a Continuous Integration Server for our embedded application built with the GNU-ARM toolchain with the GNU-ARM-ECLIPSE plugin. Therefore, I need to compile our CDT project from the command line on the server (I want to compile the Debug, Release and UnitTests builds, and then run the tests).
I was planning to use the Eclipse Headless builds (see here).
The problem I am getting is that after building, I don't get the prompt back (on windows CMD or Powershell), and so I cannot run the tests. And also, the CI server complains that the build was not successful, but everything builds fine. If I kill the command after it is completed, I can run the tests, but there is no acceptable way I could do that with a script or batch file when on the server.
It turns out that this is a Windows only problem, because on the mac or on linux, I don't have that problem. Our server is a TFS server, therefore it has to work on Windows.
Also, it might be related to how the eclipse project is setup because I tried it with a basic Hello-World project, and it works fine. Any hints or help would be greatly appreciated.
I had the same issue as yours and resolved it by changing options order (don't ask me why).
The cmd that have your problem :
eclipse --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data {myWorkspace} -import {myProject} -build "project/target"
the cmd that did work for me :
eclipse --launcher.suppressErrors -nosplash -data {myWorkspace} -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import {myProject} -build "project/target"

How to run mono commands in msysgit?

I am having trouble running mono CLI commands inside the msysgit console. It works fine in the windows command prompt added by the Mono installer. I have paid attention to the path env variable in the mono command prompt and added C:\Program Files (x86)\Mono\bin\; to the beginning of my system path (and restarted msysgit).
I am getting the following error when trying to run xbuild:
/c/Program Files (x86)/Mono/bin/xbuild: line 2: cygpath: command not found Cannot open assembly 'xbuild.exe': No such file or directory.
What am I missing from msysgit to help mono's CLI tools work better?
Mono for windows is built with cygwin + mingw (see Mono compile guide).
I'm not sure whether it's fully compatible with msys or not. From the error, I guess there is a problem of path. You may need cygpath.exe in your path from the following link. You should probably invoke mono either from Cygwin or cmd (through the bat provided files).
Even if mono for windows is compiled with mingw (and thus should not depend on cygwin), from your error, we can see there are still cygwin dependencies.

Can't get eclipse to run terminal command on mac

I have installed swig on my mac and it works in the console just fine. If I type swig -verison in terminal it spits out the version. Eclipse keeps telling me that it can't find swig. I am using the liquidfun library http://google.github.io/liquidfun/SWIG/html/index.html and it told me to put this export SWIG_BIN=$("which" swig) in .bashrc, which I did. This enviroment variable registers through terminal as well. Eclipse STILL won't grab swig properly. What the hell?
Bash reads .bash_profile, .bash_login or .profile. I don't expect the Eclipse process to load such a file (although I could be wrong) nor the SWIG_BIN variable to augment its search path for executables, but if you launch Eclipse from the shell, it should inherit the shell's environment variables.
Try running swig from eclipse using a full absolute path (the one that "which" returns).
The eclipse.ini file can set some startup parameters but perhaps not the path. There might be other eclipse startup files.
Another possibility is to add swig's directory to the path in a login script. (To test that, log out and back in, then start eclipse.)

Failing to run command in makefile project in Eclipse

I have a problem when i try to build my makefile project within Eclipse on Linux OS. Whole makefile executes fine except for the last command which is unsimgcr -pd input output. I get an error /bin/bash: unsimgcr: command not found.
The weirdest thing is that if i run make command from linux terminal the makefile executes fine no problems. I think I should set something within Eclipse IDE, but I don't know how and help would be appreciated.
Likely unsimgcr is in your path when you run it from the command line but not in the path when run from eclipse. Either fix the path issues, or put an absolute path to unsimgcr in the make file.