You are here

rosetta compile

3 posts / 0 new
Last post
rosetta compile

Hi, I am beginner using rosetta, I used Scons to compile rosetta code and it is successful. I used Anjuta(IDE) to compile and generated an AbinitioRelax.o file,when i used g++ to Compile it into executable file, it return the wrong information, as follows:

root@ma:/home/ma/rosetta/main/source/src/apps/public# g++ AbinitioRelax.o

AbinitioRelax.o: In function `main': undefined reference to `protocols::abinitio::AbrelaxApplication::register_options()' undefined reference to `devel::init(int, char**)' undefined reference to `basic::options::OptionKeys::run::checkpoint' undefined reference to `basic::options::option' undefined reference to `basic::options::OptionKeys::run::checkpoint_interval' undefined reference to `basic::options::option' undefined reference to `basic::options::OptionKeys::run::checkpoint_interval' undefined reference to `basic::options::option' undefined reference to `protocols::checkpoint::checkpoint_with_interval(int)' undefined reference to `protocols::abinitio::AbrelaxApplication::AbrelaxApplication()' undefined reference to `protocols::abinitio::AbrelaxApplication::run()'

I don't know how to solve this error and hope you help me. Thank you  very much.

Post Situation: 
Wed, 2017-04-26 00:46

Rosetta is a *large* program. Not all of the code that AbinitioRelax requires is in the file -- in fact, very little of the AbinitoRelax code is in Most of it is in the other files in the Rosetta source directory. That's why we have the scons build system. Scons takes care of compiling all the files and linking them together in the correct order. 

When you did the compilation in your IDE, it sounds like you set things up such that it only compiles the one file as a program - that isn't going to work. Theoretically, you might be able to take all the build instructions that scons does and set things up for your IDE, but that's going to be a lot of work. I wouldn't recommend it. Instead, I'd suggest sticking to the scons build system to rebuild Rosetta.

That's not to say you can enable compilation through the IDE to facilitate on-the-fly checking of various features, but I'd set that up for compiling as an intermediate object file, not as a full program, and only as much as you need to get the on-the-fly checking working. For actually building of the program, I'd drop to the commandline and invoke scons. (Actually, your IDE might even have a feature to run the external scons command when you click the "build" button, instead of the internal one. You might want to look into that.)

Thu, 2017-04-27 07:00

Thank you for your help, yor advice give me great help.

Thu, 2017-04-27 18:53