This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Cannot execute command-line STRUCTURE software on a Linux machine

Dear All,

I would like to run the command-line software called STRUCTURE on a Linux server. I downloaded the package of the Linux command-line version (without graphical front end) available with this link: https://web.stanford.edu/group/pritchardlab/structure_software/release_versions/v2.3.4/release/structure_linux_console.tar.gz

After, I extracted the file with the command tar -zxvf structure_linux_console.tar.gz. This resulted in a folder called console inside of this, the program called structure. I navigated into the folder, so I'm exactly at the place of the structure file. Then, I tried to run it two different ways: (1) simply typing structure after (2) I tried ./structure but for some reason, I cannot execute the program. I also tried to use sudo for administrative privileges but nothing. Recently, someone suggested me to run it with sh, but in this case I receive the following error: structure: 1: structure: Syntax error: word unexpected (expecting ")")

I would like to ask for the help of experienced bioinformaticians to overcome this error. I greatly appreciate any help. Please note that I'm new to using linux/unix.

Best, Thend

software error linux unix structure

You will need to use ./structure while you're inside that directory, as it wont yet be in your $PATH.

You probably need to make it executable with chmod +x /path/to/structure.

Otherwise, you need to tell us how/why you cannot execute the program as there could be a myriad of different reasons.


General comments:

  • Don't blindly use sudo when you don't know what the code does.
  • Don't blindly use sh because someone told you to when you don't know what the code does (or is written in).

Dear Joe,

I tried: chmod +x /home/.../structure but nothing happens after I tried structure but it gives me structure: command not found after I tried ./structure but still nothing. It shows -bash: ./structure: No such file or directory

chmod +x doesn't 'visibly' do anything, it just sets the permissions on the file.

You still need to use ./structure from within the directory that the file exists.

I tried it that way (I was writing it in my question). I do everything in the folder where the software is. :(

I can download and run the software without any issue on a Linux machine with simply ./structure. You need to show us the exact errors you're getting, the file paths you're using and so on, else we can't really help.

These are my commands:

xxx:~/structure/Psylvestris/oldSTR/console$ ls

extraparams  input_oldStr  mainparams  structure  structure_doc.pdf

xxx:~/structure/Psylvestris/oldSTR/console$ structure

structure: command not found

xxx:~/structure/Psylvestris/oldSTR/console$ ./structure

-bash: ./structure: No such file or directory

xxx:~/structure/Psylvestris/oldSTR/console$ sh structure

structure: 1: structure: Syntax error: word unexpected (expecting ")")

xxx:~/structure/Psylvestris/oldSTR/console$ sh ./structure

./structure: 1: ./structure: Syntax error: word unexpected (expecting ")")

could you show an ls -l of that folder?

Yes it is the following:

xxx:~/structure/Psylvestris/oldSTR/console$ ls -l

total 1044

-rwxr-xr-x 1 tendre tendre   6260 nov   20 12:59 extraparams

-rwx------ 1 tendre tendre  96029 nov   20 12:44 input_oldStr

-rwxr-xr-x 1 tendre tendre   2590 nov   20 12:56 mainparams

-rwxr-xr-x 1 tendre tendre 143870 júl   16  2012 structure

-rwxr-xr-x 1 tendre tendre 809401 júl   16  2012 structure_doc.pdf

can you md5sum your structure file and show us the result?

It should match 2fcb2fa0314005d681340f0496924924. It seems your error could be caused by a number of things, an incomplete download/transfer being one of them.

endretoth : Which linux flavor are you using? I downloaded the pre-compiled executable from your link and had no issues getting it to run.

1 answer

Dear All,

I would like to write to all person helped to solve this problem (Joe, genomax, WouterDeCoster, h.mon). Sorry, for my slow response, unfortunately, the Biostars forum does not allow me to write more than 5 messages within 6 hours, or something like this, as a new users.)

The problem is solved, someone suggested me that compatibility between the 64bit server and 32bit Structure program cause the trouble. Thus, I tried to fix this issue by doing the following steps:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

This immediately fixed the problem and the Structure runs simply with ./structure

I really appreciate all of your help and patient guidance. I hope this information will be useful for others facing the same or a similar problem.

Best, Thend

PS: I don't really understand this voting system... :(

Glad you solved it, the 32-bit/64-bit issue was going to be my next guess!

I don't really understand this voting system... :(

It is really simple. If an answer/comment is helpful, people (including you) upvote (thumbs-up only, Biostars doesn't use down-voting). If an answer resolved your question, you can mark it as accepted (well technically moderators can but we prefer that original posters do that). You are able to accept more than one answer if they all work.
Upvote|Bookmark|Accept

Log in to answer this question.