Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Suppose you were brand new to Linux and you were trying to write the program for your math thesis on a Gentoo cluster running BASH, using OpenMPI (I think - ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    25

    What tools to use for noob doing C development in Gentoo?


    Suppose you were brand new to Linux and you were trying to write the program for your math thesis on a Gentoo cluster running BASH, using OpenMPI (I think - the command is to start it is "mpirun") and a specialized, sophisticated math library called CVODE. Also, the Gentoo system doesn't have a graphical UI (I'm pretty sure). What tools would you use, which you can learn quickly and use easily, to do your conding and debugging?

    If it was me - and it is me - I have seen that emacs can do code highlighting, and some rudimentary debugging using gdb (maybe 'rudimentary' is the wrong word - I think I should say 'text-interface debugging').

    Note that I have PuTTY and Cygwin installed on my laptop. I know how to use PuTTY. I know little else.

    I also tried, in Cygwin, the command "ssh -x myusernameATthetargetmachinesURL" and was able to secure shell in - just like PuTTY. But I was told that "-x" would get me a more graphical interface (it didn't).

    Note that learning C is not the issue. The real issue is learning what tools to use, so I can learn to use those tools (and also learning make and BASH and gcc and other such tools).

    So, this is a (very) longwinded way of asking for your recommendation on tools I can use to code and debug parallel (OpenMPI) code on a Gentoo cluster which will get me up and running fast.

    Thank you.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,527
    Trying to fly before you can walk is not a good idea...

    1. Gentoo supports most all GUI front-ends.
    2. OpenMPI is not trivial to master.
    3. Connecting via Cygwin to a Linux system using SSH is not a problem. Using X passthru requires that you have installed the Cygwin xorg/X11 server. You probably did not do that (it is not a default install with cygwin).

    As for tools, my recommendation is that if you are running Windows as your host OS, that you install VirtualBox, and create a Linux virtual machine to do your Linux development on. I do this professionally on my company-provided laptop/workstation. I run Red Hat Enterprise Linux 6.2 in a VirtualBox VM to build/test most of my code that has to run on our 1000+ production Linux servers.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    25
    Nice avatar!

    Quote Originally Posted by Rubberman View Post
    Trying to fly before you can walk is not a good idea...
    Tis true! But I do have some programming background. But not the kind that helps me set up complicated development environments.

    Quote Originally Posted by Rubberman View Post
    1. Gentoo supports most all GUI front-ends.
    I don't have any control (or influence) over what is installed on the Gentoo cluster (my adviser may make changes to his Gentoo system -I have to log into his system, then ssh to the cluster).

    Quote Originally Posted by Rubberman View Post
    2. OpenMPI is not trivial to master.
    3. Connecting via Cygwin to a Linux system using SSH is not a problem. Using X passthru requires that you have installed the Cygwin xorg/X11 server. You probably did not do that (it is not a default install with cygwin).
    I have installed all of Cygwin's packages using the Cygwin setup utility. Is the xorg/X11 server called "xorg-server: X.Org X servers"? That package is listed as "Keep" in the installer (that is, it's installed).

    Is it possible that my adviser's server (which I have to TTY into and then rsh to the cluster) doesn't have what's needed for me to get the X-interface?

    Quote Originally Posted by Rubberman View Post
    As for tools, my recommendation is that if you are running Windows as your host OS, that you install VirtualBox, and create a Linux virtual machine to do your Linux development on. I do this professionally on my company-provided laptop/workstation. I run Red Hat Enterprise Linux 6.2 in a VirtualBox VM to build/test most of my code that has to run on our 1000+ production Linux servers.
    I have Ubuntu setup in a VirtualBox on my laptop. However, I don't think open mpi works on it, and I don't know how to install it. When I tried "apt-get install open-mpi", *something* installed. But I followed that by trying to install CVODE, and the parallel examples would not install (the serial examples did), leading me to believe mpi was not installed correctly, does not work on a single chip laptop (quad core, though), or I installed the wrong thing (I don't know much about *which* MPI is on the cluster.

    I think I want to stick to as basic as possible - i.e., learn to walk. Since my original post, I can TTY into my adviser's PC, then ssh to the cluster and do development there using emacs. I wish there was a better way, but I need to focus on some solution and start learning this.

    Thanks for your reply. I appreciate any more advice you have, or if you know of a particularly good, specific tutorial for doing C development on Gentoo using emacs and gdb that would actually be the most helpful to me right now.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,527
    Good reply. Myself, I use either eclipse, or just gcc/g++ and make files. At least eclipse lets you run gdb in a windowing environment. There are plugins for emacs that can do that also, but I haven't used them for about 20 years. Normally, I just use gdb on the command line. Clunky, but effective. My preferred source code editor is nedit, provided I have an X-Windows server to display it on.

    So, assuming that, as you state, that you have the xorg/X11 server installed on your Windows/cygwin system, and are starting SSH correctly, then if you have started the server, you should be able to see if the remote system is configured properly by trying to run xterm. The output should show up on your local display, or you should get some sort of error message. Depending upon the network bandwidth, it may take from a few seconds to a minute or more for the xterm window to be displayed on your local system.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    25
    Quote Originally Posted by Rubberman View Post
    ...So, assuming that, as you state, that you have the xorg/X11 server installed on your Windows/cygwin system, and are starting SSH correctly, then if you have started the server, you should be able to see if the remote system is configured properly by trying to run xterm. The output should show up on your local display, or you should get some sort of error message. Depending upon the network bandwidth, it may take from a few seconds to a minute or more for the xterm window to be displayed on your local system.
    So I think my adviser's server (I'll call it 'passthrough') does not have what is necessary. Maybe it's blocking me from using a graphical UI on the cluster (which I'll call 'cluster'). Here's what I did (note, not real usernames or URLs):

    Opened Cygwin Terminal:

    Jeff@Jeff-PC~] ssh -x jeff@passthroughs.url.edu
    password:

    Jeff@passthruough~] xterm
    -bash: xterm: command not found
    Jeff@passthruough~] ssh -x jeff@clusters.url.edu
    password:

    Jeff@cluster~] xterm
    xterm Xt error: Can't open display:
    xterm: DISPLAY is not set

    I've been trying to find out what I can about those errors on the web, but can't find anything that's meaningful (to me). Any idea what that means? Note that I can't go directly to the cluster unless I'm on campus (I'm at home - off campus - now). Note also that I cannot 'rsh' into either of those servers (probably I'm not supposed to be able to).

    I suspect it means that I cannot get a graphical UI via Cygwin while at home (while rsh'ing through 'passthrough'), but I might be able to do so on campus. Is that right?

    Edit: Also, if I try to directly run XWin Server on my laptop, a command window flashes and closes real quick, but nothing else happens.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,527
    Ok. You are trying a two-level pass-thru on the X11 protocols via ssh - won't work. In the first level, they don't have the basic X11 stuff installed, which is why (most likely) you see the "-bash: xterm: command not found" error. If you can directly login via ssh from your cygwin environment to jeff@clusters.url.edu with the -x option, you should be able to run xterm and other X11 applications. When you are logged in there, execute the command "echo $DISPLAY" to see what it thinks your X11 display ID is. This is a virtual display ID that will display back to the system you logged it from. When it is more than one level deep, that points back to a virtual display on the last system you logged it from. Clear as mud yet?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Jul 2010
    Posts
    25
    Quote Originally Posted by Rubberman View Post
    Ok. You are trying a two-level pass-thru on the X11 protocols via ssh - won't work. In the first level, they don't have the basic X11 stuff installed, which is why (most likely) you see the "-bash: xterm: command not found" error. If you can directly login via ssh from your cygwin environment to jeff@clusters.url.edu with the -x option, you should be able to run xterm and other X11 applications. When you are logged in there, execute the command "echo $DISPLAY" to see what it thinks your X11 display ID is. This is a virtual display ID that will display back to the system you logged it from. When it is more than one level deep, that points back to a virtual display on the last system you logged it from. Clear as mud yet?
    Just about as clear as mud.

    I think you were telling me two different things: 1) This can't work from home (or as long as I'm going through 'passthrough'), and 2) When I do get to campus (on Tuesday), sign onto 'cluster' and do an "echo $DISPLAY" (I tried that command now, just for fun, on passthrough and on cluster, and both returned blank lines).

    I'll have to pick this up Tuesday. For now, I'll have to learn to use emacs, which isn't ideal, but can be done.

    Have you heard of something called ddd? Do you know where I can find it, or how I can start it? So I can take a look at that, too.

    Thanks.
    J

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,527
    Glad to be of (no) help...

    When you login with ssh and the -x option, that actually DISABLES the X-forwarding option. Try the -X (upper case X) to enable it. Then you should see something like ":10.0" when you echo $DISPLAY...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Jul 2010
    Posts
    25
    First, just in case you were not joking, you haven't been no help. In fact, you've been more helpful than anyone else. I've been trying this for some time now and most people give me too much info, or give me answers which are ahead of where I am, etc. You've been giving me simple, straightforward answers and only a little at a time (edit or they yell at me for asking stupid questions - problem is, I don't know enough to ask good questions).

    Quote Originally Posted by Rubberman View Post
    Glad to be of (no) help...

    When you login with ssh and the -x option, that actually DISABLES the X-forwarding option. Try the -X (upper case X) to enable it. Then you should see something like ":10.0" when you echo $DISPLAY...
    I changed it to upper case X, but got the exact same results on both servers (I also used "set|more" to find any similar names). Maybe it just doesn't set that value if it knows the middle server is doesn't have that ability.

  10. #10
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,527
    I do my best! If upper case -X doesn't work, then I am still clueless. It works on my VPN+ssh connections at work. Been doing that for over 6 years now, without problems (in more than one environment). So, either the servers aren't set up right, or the firewall's are filtering out X11 protocol streams.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •