You are here

PocketGrid.cc file error during Rosetta compiling

5 posts / 0 new
Last post
PocketGrid.cc file error during Rosetta compiling
#1

Hi,

I am trying to compile Rosetta 3.7 (Released Sep 11, 2016) and it was building fine until it hit this error (attached below). It seems to be upset about the PocketGrid.cc file, but I'm not sure how to go about solving the error since I'm not familiar with coding languages. Any help would be greatly appreciated. Thank you.

Marlyn

 

scons: Reading SConscript files ...
Running versioning script ... fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Done. (0.0 seconds)
Number of option files updated: 0
Total 3741 options.
Finished updating ResidueProperty code -- no changes needed
Finished updating VariantType code -- no changes needed
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/src/release/linux/4.8/64/x86/gcc/6.3/default/protocols/init/init.os -c -std=c++98 -ffor-scope -isystem external/boost_1_55_0/ -isystem external/ -isystem external/include/ -isystem external/dbio/ -pipe -Wall -Wextra -pedantic -Werror -Wno-long-long -Wno-strict-aliasing -march=core2 -mtune=generic -O3 -ffast-math -funroll-loops -finline-functions -finline-limit=20000 -s -Wno-unused-variable -Wno-unused-parameter -fPIC -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -DPTR_BOOST -DNDEBUG -Isrc -Iexternal/include -Isrc/platform/linux/64/gcc/6.3 -Isrc/platform/linux/64/gcc -Isrc/platform/linux/64 -Isrc/platform/linux -Iexternal/boost_1_55_0 -Iexternal/libxml2/include -Iexternal -Iexternal/dbio -I/usr/include -I/usr/local/include src/protocols/init/init.cc
g++ -o build/src/release/linux/4.8/64/x86/gcc/6.3/default/protocols/pockets/PocketGrid.os -c -std=c++98 -ffor-scope -isystem external/boost_1_55_0/ -isystem external/ -isystem external/include/ -isystem external/dbio/ -pipe -Wall -Wextra -pedantic -Werror -Wno-long-long -Wno-strict-aliasing -march=core2 -mtune=generic -O3 -ffast-math -funroll-loops -finline-functions -finline-limit=20000 -s -Wno-unused-variable -Wno-unused-parameter -fPIC -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -DPTR_BOOST -DNDEBUG -Isrc -Iexternal/include -Isrc/platform/linux/64/gcc/6.3 -Isrc/platform/linux/64/gcc -Isrc/platform/linux/64 -Isrc/platform/linux -Iexternal/boost_1_55_0 -Iexternal/libxml2/include -Iexternal -Iexternal/dbio -I/usr/include -I/usr/local/include src/protocols/pockets/PocketGrid.cc
src/protocols/pockets/PocketGrid.cc: In member function 'virtual bool protocols::pockets::PocketGrid::same_type_as_me(const protocols::pockets::PocketGrid&) const':
src/protocols/pockets/PocketGrid.cc:4152:52: error: the compiler can assume that the address of 'other' will always evaluate to 'true' [-Werror=address]
  return dynamic_cast < PocketGrid const * > (&other);
                                                    ^
src/protocols/pockets/PocketGrid.cc:4152:52: error: the compiler can assume that the address of 'other' will always evaluate to 'true' [-Werror=address]
src/protocols/pockets/PocketGrid.cc:4152:52: error: nonnull argument 'other' compared to NULL [-Werror=nonnull-compare]
  return dynamic_cast < PocketGrid const * > (&other);
                                                    ^
cc1plus: all warnings being treated as errors
scons: *** [build/src/release/linux/4.8/64/x86/gcc/6.3/default/protocols/pockets/PocketGrid.os] Error 1
scons: building terminated because of errors.

Category: 
Post Situation: 
Wed, 2017-01-11 14:14
mwid

Yeah, that's a somewhat nonsensical bit of code that previous versions of GCC didn't have an issue with.

The easy fix is to turn off the warnings-as-errors setting in the build system: having this enabled is only really useful for developers. See https://www.rosettacommons.org/node/3748 for details on how to do this.

 

Wed, 2017-01-11 14:31
rmoretti

Wow, gcc 6.3, you are waaaaay out on the forefront.  That compiler was released three weeks ago.

The problem is that you have a compiler that we've never tried compiling Rosetta with, and that compiler is turning up new "warnings".  Warnings are soft problems in the code.  We turn on "warnings as errors" which makes the soft problems into hard problems to force us to fix them.  That's fine for devs but a problem for users trying new configurations.

The fastest thing to try is downgrading to a compiler that isn't newer than the Rosetta version.  Pulling a number out of a hat, try gcc 5.4 or so.  (Whatever's readily available on your system in the gcc 5 series is worth trying). 

We can also try turning off warnings as errors for your system.  The easiest way to do that would be to comment out (put a # in front of) all instances of "Werror" in the file tools/build/basic.settings.

Wed, 2017-01-11 14:34
smlewis

Thank you for the  help and speedy reply!

I edited the user.setting file to ignore the Werror and was able to continue compiling Rosetta.

Marlyn

Wed, 2017-01-11 15:46
mwid

This is not a proper patch file, but it turns out Xingjie has fixed this bug since 3.7 (fix will be in the next weekly).  Here's the fix for the particular warning problem you saw:

 

commit 48914dd7d9ba1f23e8a68e6c81f92e4030604336
Author: xingjiepan <REDACTED>
Date:   Sat Aug 6 16:46:37 2016 -0700

    Fix the warning: the address of XXX will always evaluate as 'true'

diff --git a/source/src/core/id/SequenceMapping.cc b/source/src/core/id/SequenceMapping.cc
index 6a840f1..4a28e04 100644
--- a/source/src/core/id/SequenceMapping.cc
+++ b/source/src/core/id/SequenceMapping.cc
@@ -339,7 +339,8 @@ bool SequenceMapping::operator == ( SequenceMapping const & rhs ) const
 
 bool SequenceMapping::same_type_as_me( SequenceMapping const & other ) const
 {
-    return dynamic_cast< SequenceMapping const *  > (&other);
+    SequenceMapping const * casted_other = dynamic_cast< SequenceMapping const *  > (&other);
+    return casted_other;
 }
 
 std::string SequenceMapping::to_string() const {
diff --git a/source/src/protocols/pockets/PocketGrid.cc b/source/src/protocols/pockets/PocketGrid.cc
index 043f866..2112910 100644
--- a/source/src/protocols/pockets/PocketGrid.cc
+++ b/source/src/protocols/pockets/PocketGrid.cc
@@ -4149,7 +4149,8 @@ bool PocketGrid::operator == ( PocketGrid const & other ) const
 
 bool PocketGrid::same_type_as_me( PocketGrid const & other ) const
 {
-    return dynamic_cast< PocketGrid const * > (&other);
+    PocketGrid const * casted_other = dynamic_cast< PocketGrid const * > (&other);
+    return casted_other;
 }
 
 
@@ -4350,7 +4351,8 @@ void ElectrostaticpotentialGrid::initialize_typGrid(){
 
 bool TargetPocketGrid::same_type_as_me( PocketGrid const & other ) const
 {
-    return dynamic_cast< TargetPocketGrid const * > (&other);
+    TargetPocketGrid const * casted_other = dynamic_cast< TargetPocketGrid const * > (&other);
+    return casted_other;
 }
 
 
@@ -5157,7 +5159,8 @@ bool ElectrostaticpotentialGrid::operator == ( PocketGrid const & other ) const
 
 bool ElectrostaticpotentialGrid::same_type_as_me( PocketGrid const & other ) const
 {
-    return dynamic_cast< ElectrostaticpotentialGrid const * > (&other);
+    ElectrostaticpotentialGrid const * casted_other = dynamic_cast< ElectrostaticpotentialGrid const * > (&other);
+    return casted_other;
 }
 
 
@@ -5745,7 +5748,8 @@ bool EggshellGrid::operator == ( PocketGrid const & other ) const {
 
 bool EggshellGrid::same_type_as_me( PocketGrid const & other ) const
 {
-    return dynamic_cast< EggshellGrid const * > (&other);
+    EggshellGrid const * casted_other = dynamic_cast< EggshellGrid const * > (&other);
+    return casted_other;
 }
 
 
diff --git a/source/src/protocols/pose_length_moves/FixAllLoopsMover.cc b/source/src/protocols/pose_length_moves/FixAllLoopsMover.cc
index 6b39169..f522c14 100644
--- a/source/src/protocols/pose_length_moves/FixAllLoopsMover.cc
+++ b/source/src/protocols/pose_length_moves/FixAllLoopsMover.cc
@@ -112,7 +112,7 @@ void FixAllLoopsMover::apply(core::pose::Pose & pose) {
         Real loop_rmsd = ABEGOHashedFragmentStore_->lookback(pose,lookback_resid);
         TR << "Loop" << pose_loops[ii].start() << "-" << pose_loops[ii].stop() << " rmsd:" << loop_rmsd << std::endl;
     }
-    for ( Size ii=pose_loops.num_loop(); (ii>=1 && (&pose)!=NULL); --ii ) {
+    for ( Size ii=pose_loops.num_loop(); ii>=1; --ii ) {
         if ( pose_loops[ii].start()>=firstResidue_ && pose_loops[ii].stop()<=lastResidue_ ) {
             TR << "working on " << pose_loops[ii].start() << "-" <<  pose_loops[ii].stop() << std::endl;
             Real loop_rmsd = ABEGOHashedFragmentStore_->lookback(pose,pose_loops[ii].start()-2);
 

Thu, 2017-01-12 07:21
smlewis