CMake 3.6.3 in MIPSpro
#1
CMake 3.6.3 in MIPSpro
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?
(This post was last modified: 04-24-2020, 11:08 PM by nintendoeats.)
nintendoeats
Octane

Trade Count: (0)
Posts: 85
Threads: 8
Joined: Nov 2019
Location: Canada
Find Reply
04-14-2020, 01:34 AM
#2
RE: So this data type isn't complete...
What version of IRIX and MIPSPro are you using?
ghost180sx
Now-MIPS-Powered

Trade Count: (0)
Posts: 110
Threads: 6
Joined: Dec 2018
Location: The Great White North
Find Reply
04-15-2020, 04:19 PM
#3
RE: So this data type isn't complete...
(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
(This post was last modified: 04-15-2020, 08:43 PM by nintendoeats.)
nintendoeats
Octane

Trade Count: (0)
Posts: 85
Threads: 8
Joined: Nov 2019
Location: Canada
Find Reply
04-15-2020, 04:28 PM
#4
RE: So this data type isn't complete...
Are you thinking that the issue might be with my local stl_vector library, rather than with the cmake code?
nintendoeats
Octane

Trade Count: (0)
Posts: 85
Threads: 8
Joined: Nov 2019
Location: Canada
Find Reply
04-15-2020, 07:49 PM
#5
RE: So this data type isn't complete...
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.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
(This post was last modified: 04-15-2020, 09:39 PM by Raion.)
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-15-2020, 09:35 PM
#6
RE: So this data type isn't complete...
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.
ghost180sx
Now-MIPS-Powered

Trade Count: (0)
Posts: 110
Threads: 6
Joined: Dec 2018
Location: The Great White North
Find Reply
04-16-2020, 05:11 PM
#7
RE: So this data type isn't complete...
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.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-16-2020, 05:16 PM
#8
RE: So this data type isn't complete...
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.
(This post was last modified: 04-16-2020, 05:46 PM by ghost180sx.)
ghost180sx
Now-MIPS-Powered

Trade Count: (0)
Posts: 110
Threads: 6
Joined: Dec 2018
Location: The Great White North
Find Reply
04-16-2020, 05:25 PM
#9
RE: So this data type isn't complete...
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.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-16-2020, 07:07 PM
#10
RE: So this data type isn't complete...
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.
nintendoeats
Octane

Trade Count: (0)
Posts: 85
Threads: 8
Joined: Nov 2019
Location: Canada
Find Reply
04-23-2020, 11:41 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)