# rosetta compile

3 posts / 0 new
rosetta compile
#1

Hi, I am beginner using rosetta, I used Scons to compile rosetta code and it is successful. I used Anjuta(IDE) to compile AbinitioRelax.cc 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':

AbinitioRelax.cc:(.text+0x2b): undefined reference to protocols::abinitio::AbrelaxApplication::register_options()'

AbinitioRelax.cc:(.text+0x42): undefined reference to devel::init(int, char**)'

AbinitioRelax.cc:(.text+0x47): undefined reference to basic::options::OptionKeys::run::checkpoint'

AbinitioRelax.cc:(.text+0x4c): undefined reference to basic::options::option'

AbinitioRelax.cc:(.text+0x65): undefined reference to basic::options::OptionKeys::run::checkpoint_interval'

AbinitioRelax.cc:(.text+0x6a): undefined reference to basic::options::option'

AbinitioRelax.cc:(.text+0x9a): undefined reference to basic::options::OptionKeys::run::checkpoint_interval'

AbinitioRelax.cc:(.text+0x9f): undefined reference to basic::options::option'

AbinitioRelax.cc:(.text+0xb5): undefined reference to protocols::checkpoint::checkpoint_with_interval(int)'

AbinitioRelax.cc:(.text+0xc4): undefined reference to protocols::abinitio::AbrelaxApplication::AbrelaxApplication()'

AbinitioRelax.cc:(.text+0xd3): 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.

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

Rosetta is a *large* program. Not all of the code that AbinitioRelax requires is in the AbinitioRelax.cc file -- in fact, very little of the AbinitoRelax code is in AbinitioRelax.cc. 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
rmoretti

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

Thu, 2017-04-27 18:53
MA