'cmake' is not recognised as an internal or external command - Polaris - c++

My clone project path from github "C:\Users\Addy\Documents\polaris\"
I have created build directory "C:\Users\Addy\Documents\polaris\build"
From cmd.exe I access build directory path "C:\Users\Addy\Documents\polaris\build"
And run this command
"cmake -G "Visual Studio 10 Win64" -DCMAKE_CONFIGURATION_TYPES=Release;Debug .."
I am running this command on windows7 cmd. But it gives me the error.
**'cmake' is not recognised as an internal or external command**
As per the steps given in the
website(https://github.com/anl-polaris/polaris/wiki/Getting-Started)

It sounds like you don't have cmake in your path variables. Simple test, type 'echo %PATH%' in the command prompt, this will list all paths your OS will look for the executable in. If you can't see a path to your cmake executable then you need to add it.
Control Panel >> System >> Advanced System settings (left side on windows 10), too bring up the 'System Properties' window. In this window select 'Environmental Variables' to bring up a new window, then scroll down to PATH and enter the path to cmake.exe, click OK and close all windows to secure new settings.
On some versions of Windows this operation requires a restart before it takes affect, others you just need to open a new command prompt. I would start my opening a new command prompt and reentering 'echo %PATH%' command, looking for the new cmake path, if it's not here then restart Windows.

Related

Visual Studio cross platform makefile project, command not found

I'm trying to build a cross platform project for Ubuntu. In my makefile I have the line
"PSPSDK=$(shell psp-config --pspsdk-path)"
which gives the error "psp-config: Command not found."
psp-config is in my path and running make from the Ubuntu system on the files that get copied over from Visual Studio works fine. It also works if I manually ssh into the Ubuntu system from windows and run the command from there.
Why can't it find the command when run through Visual Studio?
You should update PATH at the beginning of "~/.bashrc" file (and not at the end) because it starts with somethign like:
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
Also, if you add code before these lines, it will be invoked for every subshell execution, so it is better to add a guard for it as well so it is invoked only once per session:
if [ -z $HOME_OPT_PATH_SET ]; then
export PATH=$PATH:$HOME/opt
export HOME_OPT_PATH_SET=1
fi
# If not running interactively, don't do anything
...

GDB on eclipse debug mode can't find stdlib/rand.c

I am trying to put the gdb to run with eclipse cdt on ubuntu to start debugging some simple programs. So I did the steps I reckon as necessary to get it running:
1. Create an executable project
2. Compile
3. Run
4. Create the file .gdbinit and place it on the main project folder
5. Set some of the debugger configuration:
5. I also tried to find a .gdbinit file that would look some like this:
set schedule-multiple
dir ~/gcc_build/4.7.2/build/gcc
dir ~/gcc_build/4.7.2/gcc
dir ~/gcc_build/4.7.2/gcc/cp
dir ~/gcc_build/4.7.2/gcc/lto
source ~/gcc_build/4.7.2/build/gcc/gdbinit.in
But I didn't find anything similar in my computer, even after doing a:
# find / -name .gdbinit
So, my file .gdbinit end up with the simple content - yes only that:
set new-console on
Then I clicked on Apply and Debug:
The gdb starts working nicely as expected. I press the button "step over / F6" and the debugger goes jumping through the code step by step. Until the point it reaches the command rand() and the gdb hangs with the message:
Can't find a source file at "/build/buildd/eglibc-2.19/stdlib/rand.c"
Locate the file or edit the source lookup path to include its location.
Thus I also tried unsuccessfully to find the rand.c to update this path to include its location:
# find / -name rand.c
# find / -name stdlib
After the error message from GDB complaining that rand.c is missing, then I tried to keep stepping... since then the stepping mode is disable when I restart the debug:
Is this problem happening because some setting for my file .gdbinit is missing? Or some how GDB is not able to find the rand.c from stdlib from c99? When I compile and run the program it runs nicely. Only when I try to launch the debugger is when GDB crashes.
Update: I got the missing rand.c problem after running the commands:
# apt-get install libc6-dbg
# apt-get source libc6
But now a different error appears:
Can't find a source file at "/build/buildd/eglibc-2.19/csu/libc-start.c"
Locate the file or edit the source lookup path to include its location.
Should I also install that library for gdb?
All suggestions are highly appreciated.
From what I saw on your description... looking to the 4th and 5th image you posted, you did right all the required steps.
However, it seems to me that your GDB is attached to several projects. That means that unless you really need that, I would strongly advise you to select all project that you are not currently debugging and delete them from the debugger mode. So, my suggestion is that after you have done all the steps you did so far, then go on:
Debug Configurations > C/C++ Applications: (drop down it)
... then click on each project you are not compiling, with right button from the mouse select "delete" - but don't worry, it will not delete your project, but only the attachment of that project to your debugger mode.
Then restart the eclipse. When you again try to run in the debugger mode, everything will run much smoother than before.
Step1:
Go to https://www.gnu.org/software/libc/ to download glibc.
Step2:
unzip it locally and whenever the eclipse prompts "Can't find ... xxx.c", just load the file into eclipse. It will work.

gdbinit "no such file or directory" Eclipse c

I'm using Xming to connect to a Linux (enterprise edition) server on which I'm trying to debug a C++ project in Eclipse Galileo. The following errors occurred:
Reading symbols from ../workspace/myfile ..(no debugging symbols found) ... done.
.gdbinit : No such file or directory
Setting environment variable "LS_COLORS " to null value
(.gdbinit is on the server (in root), my account has rights)
If i try to run gmake on the same file from the terminal I get the following error :
gmake ** No rule to make target /workspace/myfile' . Stop.
//I have exported the path (including the library path), and gmake exists.
My project has 3 subprojects (proj1 , proj2 and proj 3). In order to debug proj3 I have to build projs 1 and 2 . I created make targets for projects 1 and 2, and I obtained .so files for which i made softlinks to corresponding files in my_project/libs folder.
My Eclipse debug configuration is as follows (tab order):
Main
  Project: My Project
  Build Configuration: UseActive
  C++ Application: path to my project/myproject
  Environment: path to libs on server (my user rights)
Debugger
  Debugger: gdb/mi
  (Checked) Stop startup at main
  GDB debugger: gdb
  GDB command line .gdbinit
  GDB command set: standard
  Protocol mi
Project Properties:
  Builders CDT Builder
  Scanner Configuration Builder
  C/C++ Build
  Build command gmake -k
Behaviour
  build incremental build : all ( sometimes i get the error no rule for make all)
  Clean: clean
  Discovery options:
    (Checked) Automatic discovery path
    (checked) Report path detection problems
    Discovery profile GCC per project
    (checked ) Enable build output
    Compile invocation comand gcc
    Toolchain
    No toolchain
    Correct builder GNU make builder
This Eclipse debug configuration works on another account (on the same server using the same Eclipse). The gdbinit and gmake files are on the server and work, I'm not supposed to update the versions (this was one solution I found online).
Has anyone seen this error before? Does anyone have a clue what I'm doing wrong?

Eclipse CDT 4.2 debug remote external program

I'd like to debug to debug a remote application with GDB.
My target system is a FreeBSD 8.3 box with gdbserver running. The application has been compiled successfully on that box. My Eclipse CDT 4.2 runs on Windows 7 with recent MinGW installed.
This is an external program I'd like to debug. It is neither written by me nor I do have it as a library. I do not intend to write my own program. In this case it is Subversion 1.8.0-dev which I want to debug.
I have created a simple C project, attached the source of Subversion. Created a remote debug config and attached the sources to the running thread in gdbserver.
Now, eclipse enters the main function of Subversion but when I set a breakpoint in another attached source file, Eclipse says: No source file named ra_loader.c or it simply says "No source available".
Then It simply exists the application.
What am I missing here?
Try the suggestion made on this thread
Quote :
1) run a debug session and open the gdb console inside Eclipse
('Console' tab -> 'Display Selected Console' button -> choose the one
ending with 'gdb')
2) use command 'pwd' in the console to print
gdb's current working dir
3) use command 'info line main' to get
the source file where gdb expect to find of my "int main(...)"
function
4) concatenate the result of step 2 with result of step
3 (which should be a relative path) to see if it matches the
correct source file I want
5) use the 'cd' command in gdb (to
change the current working dir) till I get the correct match in
step 4
Knowing the initial working directory (2) and the correct working directory (5) for gdb , I had 2 options: 1) Use gdb's 'cd'
command every time I launch a debug session (I could setup a
.gdbinit file in the gdb initial working directory to do this
automatically) or 2) Setup the 'Source' tab, in 'Debug
Configurations', to make Eclipse use paths that match with gdb's
initial working dir ('Project - Path Relative to Source Folders'
worked for me)

How to create a Linux desktop icon cross desktop (KDE, GNOME) with xdg-desktop-icon?

I'd like to use the xdg-desktop-icon tool because it can be scripted and works cross desktop (at least on Linux with Gnome and KDE). At least it is supposed to do so according to freedesktop.org. 1
Made a minimal file: test.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=test
Icon=test
Name=test
Used xdg-desktop-icon...
xdg-desktop-icon install --novendor test.desktop
Exit code is 0. (Success.) But... I do not see any new icons on my desktop. Also not after reboot. This failed on Ubuntu Precise 12.04 with KDE and on Debian Wheezy with KDE.
How to use the xdg-desktop-icon tool correctly?
The problem on KDE has something to do with the desktop settings. Folder view, Newspaper view and so on.
xdg-desktop-icon relies on xdg-user-dir to determine the user desktop directory. You can check either against that command and the settings of your file manager (or program handling the desktop).
Assuming by default it would be /home/user/Desktop, then you have to check the file name there. If the file is there, then xdg-desktop-icon is working as expected.
You have to consider that the icon (test in your case) has to be installed separately using xdg-icon-resource. That is, if you are not using a stock icon or custom icon already installed or you are not using an absolute path for the icon.
Do not forget that xdg-desktop-icon only copies the .desktop file in a specific directory. No more no less.
If I am working on ~/myapp directory, I would check by doing:
$ xdg-user-dir
/home/user/Desktop
$ ls `xdg-user-dir`/test.desktop
ls: cannot access /home/user/Desktop/test.desktop: No such file or directory
$ xdg-desktop-icon install --novendor test.desktop
$ ls `xdg-user-dir`/test.desktop
/home/user/Desktop/test.desktop
Eventually, you can run with any xdg- script with:
$ XDG_DEBUG_LEVEL=1 xdg-desktop-icon ...
Which will give you an extra line telling you where the desktop file was installed. At this point, if the icon has not been installed, it might appear an ugly default icon.