IRIX Network Forums
CMake 3.6.3 in MIPSpro - Printable Version

+- IRIX Network Forums (//forums.irixnet.org)
+-- Forum: SGI/MIPS (//forums.irixnet.org/forum-3.html)
+--- Forum: Development/Porting (//forums.irixnet.org/forum-9.html)
+--- Thread: CMake 3.6.3 in MIPSpro (/thread-2024.html)

Pages: 1 2


CMake 3.6.3 in MIPSpro - nintendoeats - 04-14-2020

I've been fiddling with making MIPSpro compile CMake 3.6.3, alas seeing not much success (learning lots, achieving little). I was wondering if anybody had any ideas.

Here are the first few errors I get:

Code:
cc-3316 CC: ERROR File = /usr/include/CC/stl_vector.h, Line = 637
  The expression must be a pointer to a complete object type.

      construct(_M_finish, *(_M_finish - 1));
                             ^
          detected during instantiation of "void
                    std::vector<cmState::SnapshotDataType,
                    std::allocator<cmState::SnapshotDataType>>::_M_insert_aux(s
                    td::vector<cmState::SnapshotDataType,
                    std::allocator<cmState::SnapshotDataType>>::iterator,
                    const cmState::SnapshotDataType &)"

cc-1070 CC: ERROR File = /usr/include/CC/stl_construct.h, Line = 53
  The indicated type is incomplete.

    new (__p) _T1(__value);
              ^
          A template was detected during header processing.
            instantiation of "void std::construct(cmState::SnapshotDataType *,
                      const <error-type> &)" at line 637 of
                      "/usr/include/CC/stl_vector.h"
            instantiation of "void std::vector<cmState::SnapshotDataType,
                      std::allocator<cmState::SnapshotDataType>>::_M_insert_aux
                      (std::vector<cmState::SnapshotDataType,
                      std::allocator<cmState::SnapshotDataType>>::iterator,
                      const cmState::SnapshotDataType &)"

cc-3316 CC: ERROR File = /usr/include/CC/stl_vector.h, Line = 638
  The expression must be a pointer to a complete object type.

      ++_M_finish;
        ^
          detected during instantiation of "void
                    std::vector<cmState::SnapshotDataType,
                    std::allocator<cmState::SnapshotDataType>>::_M_insert_aux(s
                    td::vector<cmState::SnapshotDataType,
                    std::allocator<cmState::SnapshotDataType>>::iterator,
                    const cmState::SnapshotDataType &)"

So what I'm getting is that cmState::SnapshotDataType is not completely defined.

Here is the relevent portion of cmState.h:

Code:
#ifndef cmState_h
#define cmState_h

#include "cmStandardIncludes.h"

#include "cmAlgorithms.h"
#include "cmLinkedTree.h"
#include "cmPolicies.h"
#include "cmPropertyDefinitionMap.h"
#include "cmPropertyMap.h"

class cmake;
class cmCommand;
class cmDefinitions;
class cmListFileBacktrace;
class cmCacheManager;

class cmState
{
  struct SnapshotDataType;
  struct PolicyStackEntry;
  struct BuildsystemDirectoryStateType;
  typedef cmLinkedTree<SnapshotDataType>::iterator PositionType;
  friend class Snapshot;

public:
  cmState();
  ~cmState();

  enum SnapshotType
  {
    BaseType,
    BuildsystemDirectoryType,
    FunctionCallType,
    MacroCallType,
    IncludeFileType,
    InlineListFileType,
    PolicyScopeType,
    VariableScopeType
  };

And cmState.cxx:

Code:
#include "cmState.h"

#include "cmAlgorithms.h"
#include "cmCacheManager.h"
#include "cmCommand.h"
#include "cmDefinitions.h"
#include "cmVersion.h"
#include "cmake.h"

#include <assert.h>

struct cmState::SnapshotDataType
{
  cmState::PositionType ScopeParent;
  cmState::PositionType DirectoryParent;
  cmLinkedTree<cmState::PolicyStackEntry>::iterator Policies;
  cmLinkedTree<cmState::PolicyStackEntry>::iterator PolicyRoot;
  cmLinkedTree<cmState::PolicyStackEntry>::iterator PolicyScope;
  cmState::SnapshotType SnapshotType;
  bool Keep;
  cmLinkedTree<std::string>::iterator ExecutionListFile;
  cmLinkedTree<cmState::BuildsystemDirectoryStateType>::iterator
    BuildSystemDirectory;
  cmLinkedTree<cmDefinitions>::iterator Vars;
  cmLinkedTree<cmDefinitions>::iterator Root;
  cmLinkedTree<cmDefinitions>::iterator Parent;
  std::vector<std::string>::size_type IncludeDirectoryPosition;
  std::vector<std::string>::size_type CompileDefinitionsPosition;
  std::vector<std::string>::size_type CompileOptionsPosition;
};

I've tried a lot of things, such as moving the struct declaration into the header and attempting to explicitly declare cmLinkedTree<SnapshotDataType>::iterator in various places. For a long time I thought this was an issue with that typedef of a template being in a header, but I have drifted away from that theory.

Does anybody have any thoughts?


RE: So this data type isn't complete... - ghost180sx - 04-15-2020

What version of IRIX and MIPSPro are you using?


RE: So this data type isn't complete... - nintendoeats - 04-15-2020

(04-15-2020, 04:19 PM)ghost180sx Wrote:  What version of IRIX and MIPSPro are you using?

IRIX 6.5.22, MIPSpro 7.4.4m


RE: So this data type isn't complete... - nintendoeats - 04-15-2020

Are you thinking that the issue might be with my local stl_vector library, rather than with the cmake code?


RE: So this data type isn't complete... - Raion - 04-15-2020

According to what I've talked with Axatax about and others, there's a number of variable issues that you're probably facing here. He thinks it's linking against C instead of C++ headers.

run "printenv" and show the output.

Code:
export CC=c99
export CXX=CC
export CFLAGS='-O3 -mips4 -I/usr/nekoware/include'
export CXXFLAGS=$CFLAGS
export CPPFLAGS='-I/usr/nekoware/include -I/usr/include'
export LDFLAGS='-L/usr/nekoware/lib -Wl,-rpath -Wl,/usr/nekoware/lib'
export PKG_CONFIG=/usr/nekoware/bin/pkgconf
export PERL=/usr/nekoware/bin/perl
export GNUMAKE=/usr/nekoware/bin/make
export PATH=/usr/nekoware/bin:/usr/nekoware/sbin:${PATH}
unset LD_LIBRARY_PATH
unset LD_LIBRARYN32_PATH
unset LD_LIBRARY64_PATH

Using bash or ksh

Code:
setenv CC c99
setenv CXX $CC
setenv CFLAGS '-O3 -mips4 -I/usr/nekoware/include'
setenv CXXFLAGS $CFLAGS
setenv  CPPFLAGS '-I/usr/nekoware/include -I/usr/include'
setenv  LDFLAGS '-L/usr/nekoware/lib -Wl,-rpath -Wl,/usr/nekoware/lib'
setenv PKG_CONFIG /usr/nekoware/bin/pkgconf
setenv GNUMAKE=/usr/nekoware/bin/make
setenv PATH=/usr/nekoware/bin:$PATH
unset LD_LIBRARY_PATH
unset LD_LIBRARYN32_PATH
unset LD_LIBRARY64_PATH

Using tcsh

You'll need to tweak this depending on what prefix and libs you are linking against.


RE: So this data type isn't complete... - ghost180sx - 04-16-2020

I downloaded the latest release (3.17.1) and it uses C++11, so with MIPSPro, that will be a no-go.

Then I reread your OP and saw you are trying with 3.6.3. Why such an old version? Is it the last one that will work on IRIX?

I did notice that it *does* support IRIX. I'm trying to build it now.


RE: So this data type isn't complete... - Raion - 04-16-2020

Cmake 3.6 is the last version to support building without libuv, which introduces incompatibility.

Personally, if we can't build a toolchain without relying on GCC it's probably a lost cause. There's serious performance issues with some of the stuff GCC points out, and some people are not interested in a software dev caste system where 80% of the userbase is locked out due to performance issues.


RE: So this data type isn't complete... - ghost180sx - 04-16-2020

I'm having no problem buildling cmake 3.6.3 following the build instructions in the README.rst file:

Code:
$ ./boostrap && make && make install

I take that back! After running for about 20 minutes, I end up with this:

Code:
72 errors detected in the compilation of "/usr/people/rees/src/cmake-v3.6.3/Source/cmake.cxx".
C++ prelinker: Error compiling cmake.o
make: *** [Makefile:2: cmake] Error 2
---------------------------------------------
Error when bootstrapping CMake:
Problem while running make
---------------------------------------------
Log of errors: /usr/people/rees/src/cmake-v3.6.3/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

So I'm probably getting the same results as you, nintendoeats.

What about trying a newer version? I noticed the README.rst for 3.7.x still says it supports IRIX.


RE: So this data type isn't complete... - Raion - 04-16-2020

As I said in my other post, CMake 3.7+ require libuv, which brings in its own complications. You're not gonna get a mipspro build any easier.


RE: So this data type isn't complete... - nintendoeats - 04-23-2020

I have a high level of confidence that my setup is correct, having gone at this from many angles. I truly believe this to be a real error for MIPSpro.

I found a bug report this morning, which implies that the issue might be fixed by moving the offending class definition to the header. I will investigate this evening.