dacase / nabc

Nonperiodic force field calculations, with a "C" language interface rather than the original interface based on the Nucleic Acid Builder (NAB) molecular manipulation language
Other
4 stars 1 forks source link

Installation question #2

Open evancollins1 opened 5 months ago

evancollins1 commented 5 months ago

Hi,

I saw that NAB is no longer part of AMBER so I wanted to use this GitHub repository. I installed it according to the instructions you provided on the README.

To contextualize my likely simple question, I want to run the these two commands.

nab mrna.nab
./a.out

This is to ultimately generate a .pdb file for a small RNA sequence.

How do I do this? I see there is a 'nab' folder under 'src' but don't know how to run these commands. It says command 'nab' not found. I also tried cd src/nab and then running ./mrna.nab, but it says... "syntax error near unexpected token '('.

Note, this is my mrna.nab file.

molecule m;

m = fd_helix("arna", "auggaggacgccaagaacau", "rna");
putpdb("mrna.pdb", m, "-wwpdb");
dacase commented 5 months ago

On Tue, Jan 30, 2024, Evan Collins wrote:

I saw that NAB is no longer part of AMBER so I wanted to use this GitHub repository. I installed it according to the instructions you provided on the README.

To contextualize my likely simple question, I want to run the these two commands.

nab rna.nab
./a.out

This is to ultimately generate a .pdb file for a small RNA sequence.

How do I do this? I see there is a 'nab' folder under 'src' but don't know how to run these commands. It says command 'nab' not found.

The executable files get put into /path/to/nabc/bin. Do have this folder in your PATH? Note also that NAB is not built by default: you need to execute a separate "make nab" command.

...hope this helps...dac

evancollins1 commented 5 months ago

Thanks for this. I tried running...

cd nabc/bin
./nab mrna.nab

It returned this error

/home/andersonxps/anaconda3/envs/md-intro-tutorial/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/andersonxps/evan/md/nabc/lib/libsff.a(sff.o): in function `egb_hcp_rbondi':
/home/andersonxps/evan/md/nabc/src/sff/hcp_gb.c:98: undefined reference to `_ZGVbN2v_cbrt'
/home/andersonxps/anaconda3/envs/md-intro-tutorial/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/andersonxps/evan/md/nabc/src/sff/hcp_gb.c:108: undefined reference to `_ZGVbN2v_cbrt'
/home/andersonxps/anaconda3/envs/md-intro-tutorial/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/andersonxps/evan/md/nabc/src/sff/hcp_gb.c:116: undefined reference to `_ZGVbN2v_cbrt'
/home/andersonxps/anaconda3/envs/md-intro-tutorial/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/andersonxps/evan/md/nabc/src/sff/hcp_gb.c:98: undefined reference to `_ZGVbN2v_cbrt'
/home/andersonxps/anaconda3/envs/md-intro-tutorial/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/andersonxps/evan/md/nabc/src/sff/hcp_gb.c:108: undefined reference to `_ZGVbN2v_cbrt'
collect2: error: ld returned 1 exit status
cc failed!

Despite this error, it seems like a file .mrna.c was produced in the bin folder.

How can I obtain the .pdb file? Thanks - I am new to NAB.

dacase commented 5 months ago

On Jan 31, 2024, at 1:53 PM, Evan Collins @.***> wrote: cd nabc/bin ./nab mrna.nab It returned this error

/home/andersonxps/anaconda3/envs/md-intro-tutorial/bin/../lib/gcc/x86_64-conda-linux-gnu/12.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/andersonxps/evan/md/nabc/lib/libsff.a(sff.o): in function `egb_hcp_rbondi': cc failed! What does “which gcc” return? It looks like you are using an anaconda compiler: is that expected? What OS are you using? I’ve certainly never tested nabc with gcc 12.3, and there could be some incompatibility. Do you have access to any less-recent version of gcc; and/or can you avoid the anaconda3 complications? It would be great if you could just use the gcc that is in /usr/bin.

Despite this error, it seems like a file .mrna.c was produced in the bin folder.

This is expected: nab compiled the mrna.nab file to mrna.c, but your compiler was unable to compile the latter file. I would suggest that you run the test suite, just to make sure that the problem is not with your input. But I suspect all nab tests will fail with errors like the one above.

evancollins1 commented 5 months ago

Question: I was hoping for a single-stranded .pdb for my RNA sequence. I noticed the outputted .pdb was a double-stranded helix. How can I obtain just the single-stranded .pdb? (Note I included the content of my .nab file in my first comment on this thread.) My current solution is to simply delete one strand in PyMOL. Is this the optimal way?


Thanks. Exiting the conda environment solved it.

For anyone reading this in the future, here is a comprehensive solution for installation and running a basic nab command as of January 2024.

The bin folder should now contain the .pdb file.

dacase commented 5 months ago

On Thu, Feb 01, 2024, Evan Collins wrote:

For anyone reading this in the future, here is a comprehensive solution for installation and running a basic nab command as of January 2024.

Just a note: AmberTools is not required for nabc. (You might, however, want AmberTools for other purposes.)

james-vincent commented 4 months ago

I should rephrase: does nab need to be bundled with the cimpiler used to build it? We find nab is looking for the specific gcc, including full path, that was used to build it. Gcc is available on the test system, but not the gcc that was used to build nab. Hope that makes sense.

Is a gcc compiler required at run time? We had the same situation with a conda install of nabc. Running nab looks for the compiler. We cannot distribute a compiler with nab. Can it be installed, and will it run, in a self contained way?

dacase commented 4 months ago

On Thu, Feb 29, 2024, james-vincent wrote:

Is a gcc compiler required at run time? We had the same situation with a conda install of nabc. Running nab looks for the compiler. We cannot distribute a compiler with nab. Can it be installed, and will it run, in a self contained way?

Yes: the nab compiler coverts nab code to C, and you then need gcc to compile the C code into executables.

When you build nab from the github repository, gcc is involved, and using the same compiler should work when compiling and running nab progams.

I'm unsure how you are "distributing" nab, or why you cannot include a compiler. So I can't be of much help with your second question. People that don't already have access to a C compiler, and hence how probably are not themselves programmers, are not going to find nab to be of much use. Both nab and nabc are aimed a helping users write novel computer code.

....dac

james-vincent commented 3 months ago

When we run nab, on various machines, it seems to be looking for the gcc that it was built with, not the gcc available in the path. For example on macs we use spack to install. The nab executable seems to be looking for the spack compiler (which is no longer in place). It does not find the gcc that is already in PATH:


% nab ./dna.nab 
[spack cc] ERROR: Spack compiler must be run from Spack! Input 'SPACK_ENV_PATH' is missing.
C compiler failed with exit code 256
sbtest@sbgrid-m11 /tmp % which gcc
/usr/bin/gcc
sbtest@sbgrid-m11 /tmp % gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
dacase commented 3 months ago

On Thu, Mar 07, 2024, james-vincent wrote:

When we run nab, on various machines, it seems to be looking for the gcc that it was built with, not the gcc available in the path. For example on macs we use spack to install. The nab executable seems to be looking for the spack compiler (which is no longer in place). It does not find the gcc that is already in PATH:



% nab ./dna.nab

Please type "nab -v ./dna.nab". That will tell you what compiler you are using. For me, it is the gcc in the PATH.

If you installed nab with a compiler that is no longer available, that is indeed likely to lead to problems. I'm not sure that there is any easy way around this problem. Straightforward (if possible) workaround might be to not use spack to install

....dac