, compiling VTK-8.90g++ -m32 can not find libstdc++ on debian amd64error using static function deleter with std::unique_ptrCompilation Error when using tr1::functionWhy const member caused error?how to return pair from a function?why the program with static main() type shows error?building 32 exe on 64 bit open suse linux gives link errorCompiling an application for use in highly radioactive environmentsg++ will not link to library in /usr/lib/Why Clang at Coliru can't compile vector::push_back?

Convenience stores in India

Explain how 'Sharing the burden' puzzle from Professor Layton and the Miracle Mask should be solved

Can a Time Lord survive with just one heart?

Are "confidant" and "confident" homophones?

Term for a character that only exists to be talked to

Data normalization before or after train-test split?

How did שְׁלֹמֹה (shlomo) become Solomon?

Motorcyle Chain needs to be cleaned every time you lube it?

Boss has banned cycling to work because he thinks it's unsafe

How come having a Deathly Hallow is not a big deal?

Did Snape really give Umbridge a fake Veritaserum potion that Harry later pretended to drink?

Is it possible to spoof an IP address to an exact number?

Interview Question - Card betting

List comprehensions in Mathematica?

Contributing to a candidate as a Foreign National US Resident?

Implementing absolute value function in c

What does the ash content of broken wheat really mean?

What does it mean for a bass player to play "on the one"?

Why did the "Orks" never develop better firearms than Firelances and Handcannons?

Will electrically joined dipoles of different lengths, at right angles, behave as a multiband antenna?

Do intermediate subdomains need to exist?

What is the addition in the re-released version of Avengers: Endgame?

Did Stalin kill all Soviet officers involved in the Winter War?

How can solar sailed ships be protected from space debris?



, compiling VTK-8.90


g++ -m32 can not find libstdc++ on debian amd64error using static function deleter with std::unique_ptrCompilation Error when using tr1::functionWhy const member caused error?how to return pair from a function?why the program with static main() type shows error?building 32 exe on 64 bit open suse linux gives link errorCompiling an application for use in highly radioactive environmentsg++ will not link to library in /usr/lib/Why Clang at Coliru can't compile vector::push_back?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















As the title says I'm having problems compiling the latest version of VTK from the github source.



I'm not a c++ programmer and only have a basic understanding of the code. So far what I have tried/investigated/googled to no avail:



  • Linted the .h file/looked for bad white spaces/tabs. (I didn't expect this to do anything)

  • a hard reset of my local git repo

  • tried compiling with gcc-8 and the standard linker (/usr/bin/ld)

  • tried compiling with clang and the llvm linker (/usr/bin/ld.lld)

  • attempted a basic compile (both) with none of the extra modules I need.

  • updated my distro/clang/gcc/llvm

I don't know where to go from here. I'm sure its something on my side, as I have not found any issues related to this from a google search.



This is the error I'm receiving without any extra output (errors from clang compilation, but the same with gcc):



`Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

This is the error output when the -v linker flag is set:



`[ 8%] Built target WrappingPythonCore
Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
clang version 8.0.0-1ubuntu1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found CUDA installation: /usr/lib/cuda, version 10.0
"/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o ../../bin/vtkWrapHierarchy-8.90 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../.. -L/usr/lib/llvm-8/bin/../lib -L/lib -L/usr/lib CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o ../../lib/libvtkWrappingTools-8.90.a -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o
[ 8%] Built target WrapHierarchy
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

and this is the .h file referenced:



=========================================================================*/

/**
* @class vtkGenericDataArrayLookupHelper
* @brief internal class used by
* vtkGenericDataArray to support LookupValue.
*
*/

#ifndef vtkGenericDataArrayLookupHelper_h
#define vtkGenericDataArrayLookupHelper_h

#include <algorithm>
#include <cmath>
#include "vtkIdList.h"

namespace detail

// this can be removed when C++11 is required.
template< class T > struct remove_const typedef T type; ;
template< class T > struct remove_const<const T> typedef T type; ;

template <typename T, bool> struct has_NaN;

template <typename T>
struct has_NaN<T, true>

static bool isnan(T x)

return std::isnan(x);

;

template <typename T>
struct has_NaN<T, false>

static bool isnan(T)

return false;

;

template <typename T>
bool isnan(T x)

// Select the correct partially specialized type.
return has_NaN<T, std::numeric_limits<T>::has_quiet_NaN>::isnan(x);



template <class ArrayTypeT>
class vtkGenericDataArrayLookupHelper

public:
typedef ArrayTypeT ArrayType;
typedef typename ArrayType::ValueType ValueType;

// Constructor.
vtkGenericDataArrayLookupHelper()
: AssociatedArray(nullptr), SortedArray(nullptr),
FirstValue(nullptr), SortedArraySize(0)


~vtkGenericDataArrayLookupHelper()

this->ClearLookup();


void SetArray(ArrayTypeT *array)

if (this->AssociatedArray != array)

this->ClearLookup();
this->AssociatedArray = array;



vtkIdType LookupValue(ValueType elem)

this->UpdateLookup();

if (this->SortedArraySize == 0)

return -1;


if(::detail::isnan(elem))

if(this->SortedArray && ::detail::isnan(this->SortedArray->Value))

return this->SortedArray->Index;

else

return -1;



ValueWithIndex temp;
temp.Value = elem;
ValueWithIndex* pos =
std::lower_bound(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
if (pos == (this->SortedArray + this->SortedArraySize))

return -1;

if (pos->Value != elem)

return -1;

return pos->Index;


void LookupValue(ValueType elem, vtkIdList* ids)

ids->Reset();
this->UpdateLookup();

if (this->SortedArraySize == 0)

return;


if(::detail::isnan(elem))

ValueWithIndex *range = this->SortedArray;
while (range != this->FirstValue)

ids->InsertNextId(range->Index);
++range;


else

ValueWithIndex temp;
temp.Value = elem;
std::pair<ValueWithIndex*, ValueWithIndex*> range =
std::equal_range(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
while (range.first != range.second)

// assert(range.first->Value == elem);
ids->InsertNextId(range.first->Index);
++range.first;




//@
/**
* Release any allocated memory for internal data-structures.
*/
void ClearLookup()

free(this->SortedArray);
this->SortedArray = nullptr;
this->SortedArraySize = 0;

//@

private:
vtkGenericDataArrayLookupHelper(const vtkGenericDataArrayLookupHelper&) = delete;
void operator=(const vtkGenericDataArrayLookupHelper&) = delete;

struct ValueWithIndex

typename ::detail::remove_const<ValueType>::type Value;
vtkIdType Index;
inline bool operator<(const ValueWithIndex& other) const

return this->Value < other.Value;

;

static bool isnan(const ValueWithIndex &tmp)

return ::detail::isnan(tmp.Value);


void UpdateLookup()
this->SortedArray)

return;


int numComps = this->AssociatedArray->GetNumberOfComponents();
this->SortedArraySize =
this->AssociatedArray->GetNumberOfTuples() * numComps;

if (this->SortedArraySize == 0)

return;


this->SortedArray = reinterpret_cast<ValueWithIndex*>(
malloc(this->SortedArraySize * sizeof(ValueWithIndex)));
for (vtkIdType cc = 0, max = this->AssociatedArray->GetNumberOfValues();
cc < max; ++cc)

ValueWithIndex& item = this->SortedArray[cc];
item.Value = this->AssociatedArray->GetValue(cc);
item.Index = cc;

this->FirstValue = std::partition(this->SortedArray, this->SortedArray + this->SortedArraySize, isnan);
std::sort(this->FirstValue, this->SortedArray + this->SortedArraySize);


ArrayTypeT *AssociatedArray;
ValueWithIndex* SortedArray;
ValueWithIndex* FirstValue;
vtkIdType SortedArraySize;
;

#endif
// VTK-HeaderTest-Exclude: vtkGenericDataArrayLookupHelper.h









share|improve this question
























  • My guess is that isnan in VTK collides with something in your system. I checked VTK nightly builds and it not tested against GCC8. Can you try GCC7? I'm pretty sure that VTK is GCC7 compatible.

    – Liu Hao Cheng
    Mar 28 at 20:33


















3















As the title says I'm having problems compiling the latest version of VTK from the github source.



I'm not a c++ programmer and only have a basic understanding of the code. So far what I have tried/investigated/googled to no avail:



  • Linted the .h file/looked for bad white spaces/tabs. (I didn't expect this to do anything)

  • a hard reset of my local git repo

  • tried compiling with gcc-8 and the standard linker (/usr/bin/ld)

  • tried compiling with clang and the llvm linker (/usr/bin/ld.lld)

  • attempted a basic compile (both) with none of the extra modules I need.

  • updated my distro/clang/gcc/llvm

I don't know where to go from here. I'm sure its something on my side, as I have not found any issues related to this from a google search.



This is the error I'm receiving without any extra output (errors from clang compilation, but the same with gcc):



`Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

This is the error output when the -v linker flag is set:



`[ 8%] Built target WrappingPythonCore
Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
clang version 8.0.0-1ubuntu1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found CUDA installation: /usr/lib/cuda, version 10.0
"/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o ../../bin/vtkWrapHierarchy-8.90 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../.. -L/usr/lib/llvm-8/bin/../lib -L/lib -L/usr/lib CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o ../../lib/libvtkWrappingTools-8.90.a -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o
[ 8%] Built target WrapHierarchy
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

and this is the .h file referenced:



=========================================================================*/

/**
* @class vtkGenericDataArrayLookupHelper
* @brief internal class used by
* vtkGenericDataArray to support LookupValue.
*
*/

#ifndef vtkGenericDataArrayLookupHelper_h
#define vtkGenericDataArrayLookupHelper_h

#include <algorithm>
#include <cmath>
#include "vtkIdList.h"

namespace detail

// this can be removed when C++11 is required.
template< class T > struct remove_const typedef T type; ;
template< class T > struct remove_const<const T> typedef T type; ;

template <typename T, bool> struct has_NaN;

template <typename T>
struct has_NaN<T, true>

static bool isnan(T x)

return std::isnan(x);

;

template <typename T>
struct has_NaN<T, false>

static bool isnan(T)

return false;

;

template <typename T>
bool isnan(T x)

// Select the correct partially specialized type.
return has_NaN<T, std::numeric_limits<T>::has_quiet_NaN>::isnan(x);



template <class ArrayTypeT>
class vtkGenericDataArrayLookupHelper

public:
typedef ArrayTypeT ArrayType;
typedef typename ArrayType::ValueType ValueType;

// Constructor.
vtkGenericDataArrayLookupHelper()
: AssociatedArray(nullptr), SortedArray(nullptr),
FirstValue(nullptr), SortedArraySize(0)


~vtkGenericDataArrayLookupHelper()

this->ClearLookup();


void SetArray(ArrayTypeT *array)

if (this->AssociatedArray != array)

this->ClearLookup();
this->AssociatedArray = array;



vtkIdType LookupValue(ValueType elem)

this->UpdateLookup();

if (this->SortedArraySize == 0)

return -1;


if(::detail::isnan(elem))

if(this->SortedArray && ::detail::isnan(this->SortedArray->Value))

return this->SortedArray->Index;

else

return -1;



ValueWithIndex temp;
temp.Value = elem;
ValueWithIndex* pos =
std::lower_bound(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
if (pos == (this->SortedArray + this->SortedArraySize))

return -1;

if (pos->Value != elem)

return -1;

return pos->Index;


void LookupValue(ValueType elem, vtkIdList* ids)

ids->Reset();
this->UpdateLookup();

if (this->SortedArraySize == 0)

return;


if(::detail::isnan(elem))

ValueWithIndex *range = this->SortedArray;
while (range != this->FirstValue)

ids->InsertNextId(range->Index);
++range;


else

ValueWithIndex temp;
temp.Value = elem;
std::pair<ValueWithIndex*, ValueWithIndex*> range =
std::equal_range(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
while (range.first != range.second)

// assert(range.first->Value == elem);
ids->InsertNextId(range.first->Index);
++range.first;




//@
/**
* Release any allocated memory for internal data-structures.
*/
void ClearLookup()

free(this->SortedArray);
this->SortedArray = nullptr;
this->SortedArraySize = 0;

//@

private:
vtkGenericDataArrayLookupHelper(const vtkGenericDataArrayLookupHelper&) = delete;
void operator=(const vtkGenericDataArrayLookupHelper&) = delete;

struct ValueWithIndex

typename ::detail::remove_const<ValueType>::type Value;
vtkIdType Index;
inline bool operator<(const ValueWithIndex& other) const

return this->Value < other.Value;

;

static bool isnan(const ValueWithIndex &tmp)

return ::detail::isnan(tmp.Value);


void UpdateLookup()
this->SortedArray)

return;


int numComps = this->AssociatedArray->GetNumberOfComponents();
this->SortedArraySize =
this->AssociatedArray->GetNumberOfTuples() * numComps;

if (this->SortedArraySize == 0)

return;


this->SortedArray = reinterpret_cast<ValueWithIndex*>(
malloc(this->SortedArraySize * sizeof(ValueWithIndex)));
for (vtkIdType cc = 0, max = this->AssociatedArray->GetNumberOfValues();
cc < max; ++cc)

ValueWithIndex& item = this->SortedArray[cc];
item.Value = this->AssociatedArray->GetValue(cc);
item.Index = cc;

this->FirstValue = std::partition(this->SortedArray, this->SortedArray + this->SortedArraySize, isnan);
std::sort(this->FirstValue, this->SortedArray + this->SortedArraySize);


ArrayTypeT *AssociatedArray;
ValueWithIndex* SortedArray;
ValueWithIndex* FirstValue;
vtkIdType SortedArraySize;
;

#endif
// VTK-HeaderTest-Exclude: vtkGenericDataArrayLookupHelper.h









share|improve this question
























  • My guess is that isnan in VTK collides with something in your system. I checked VTK nightly builds and it not tested against GCC8. Can you try GCC7? I'm pretty sure that VTK is GCC7 compatible.

    – Liu Hao Cheng
    Mar 28 at 20:33














3












3








3








As the title says I'm having problems compiling the latest version of VTK from the github source.



I'm not a c++ programmer and only have a basic understanding of the code. So far what I have tried/investigated/googled to no avail:



  • Linted the .h file/looked for bad white spaces/tabs. (I didn't expect this to do anything)

  • a hard reset of my local git repo

  • tried compiling with gcc-8 and the standard linker (/usr/bin/ld)

  • tried compiling with clang and the llvm linker (/usr/bin/ld.lld)

  • attempted a basic compile (both) with none of the extra modules I need.

  • updated my distro/clang/gcc/llvm

I don't know where to go from here. I'm sure its something on my side, as I have not found any issues related to this from a google search.



This is the error I'm receiving without any extra output (errors from clang compilation, but the same with gcc):



`Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

This is the error output when the -v linker flag is set:



`[ 8%] Built target WrappingPythonCore
Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
clang version 8.0.0-1ubuntu1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found CUDA installation: /usr/lib/cuda, version 10.0
"/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o ../../bin/vtkWrapHierarchy-8.90 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../.. -L/usr/lib/llvm-8/bin/../lib -L/lib -L/usr/lib CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o ../../lib/libvtkWrappingTools-8.90.a -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o
[ 8%] Built target WrapHierarchy
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

and this is the .h file referenced:



=========================================================================*/

/**
* @class vtkGenericDataArrayLookupHelper
* @brief internal class used by
* vtkGenericDataArray to support LookupValue.
*
*/

#ifndef vtkGenericDataArrayLookupHelper_h
#define vtkGenericDataArrayLookupHelper_h

#include <algorithm>
#include <cmath>
#include "vtkIdList.h"

namespace detail

// this can be removed when C++11 is required.
template< class T > struct remove_const typedef T type; ;
template< class T > struct remove_const<const T> typedef T type; ;

template <typename T, bool> struct has_NaN;

template <typename T>
struct has_NaN<T, true>

static bool isnan(T x)

return std::isnan(x);

;

template <typename T>
struct has_NaN<T, false>

static bool isnan(T)

return false;

;

template <typename T>
bool isnan(T x)

// Select the correct partially specialized type.
return has_NaN<T, std::numeric_limits<T>::has_quiet_NaN>::isnan(x);



template <class ArrayTypeT>
class vtkGenericDataArrayLookupHelper

public:
typedef ArrayTypeT ArrayType;
typedef typename ArrayType::ValueType ValueType;

// Constructor.
vtkGenericDataArrayLookupHelper()
: AssociatedArray(nullptr), SortedArray(nullptr),
FirstValue(nullptr), SortedArraySize(0)


~vtkGenericDataArrayLookupHelper()

this->ClearLookup();


void SetArray(ArrayTypeT *array)

if (this->AssociatedArray != array)

this->ClearLookup();
this->AssociatedArray = array;



vtkIdType LookupValue(ValueType elem)

this->UpdateLookup();

if (this->SortedArraySize == 0)

return -1;


if(::detail::isnan(elem))

if(this->SortedArray && ::detail::isnan(this->SortedArray->Value))

return this->SortedArray->Index;

else

return -1;



ValueWithIndex temp;
temp.Value = elem;
ValueWithIndex* pos =
std::lower_bound(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
if (pos == (this->SortedArray + this->SortedArraySize))

return -1;

if (pos->Value != elem)

return -1;

return pos->Index;


void LookupValue(ValueType elem, vtkIdList* ids)

ids->Reset();
this->UpdateLookup();

if (this->SortedArraySize == 0)

return;


if(::detail::isnan(elem))

ValueWithIndex *range = this->SortedArray;
while (range != this->FirstValue)

ids->InsertNextId(range->Index);
++range;


else

ValueWithIndex temp;
temp.Value = elem;
std::pair<ValueWithIndex*, ValueWithIndex*> range =
std::equal_range(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
while (range.first != range.second)

// assert(range.first->Value == elem);
ids->InsertNextId(range.first->Index);
++range.first;




//@
/**
* Release any allocated memory for internal data-structures.
*/
void ClearLookup()

free(this->SortedArray);
this->SortedArray = nullptr;
this->SortedArraySize = 0;

//@

private:
vtkGenericDataArrayLookupHelper(const vtkGenericDataArrayLookupHelper&) = delete;
void operator=(const vtkGenericDataArrayLookupHelper&) = delete;

struct ValueWithIndex

typename ::detail::remove_const<ValueType>::type Value;
vtkIdType Index;
inline bool operator<(const ValueWithIndex& other) const

return this->Value < other.Value;

;

static bool isnan(const ValueWithIndex &tmp)

return ::detail::isnan(tmp.Value);


void UpdateLookup()
this->SortedArray)

return;


int numComps = this->AssociatedArray->GetNumberOfComponents();
this->SortedArraySize =
this->AssociatedArray->GetNumberOfTuples() * numComps;

if (this->SortedArraySize == 0)

return;


this->SortedArray = reinterpret_cast<ValueWithIndex*>(
malloc(this->SortedArraySize * sizeof(ValueWithIndex)));
for (vtkIdType cc = 0, max = this->AssociatedArray->GetNumberOfValues();
cc < max; ++cc)

ValueWithIndex& item = this->SortedArray[cc];
item.Value = this->AssociatedArray->GetValue(cc);
item.Index = cc;

this->FirstValue = std::partition(this->SortedArray, this->SortedArray + this->SortedArraySize, isnan);
std::sort(this->FirstValue, this->SortedArray + this->SortedArraySize);


ArrayTypeT *AssociatedArray;
ValueWithIndex* SortedArray;
ValueWithIndex* FirstValue;
vtkIdType SortedArraySize;
;

#endif
// VTK-HeaderTest-Exclude: vtkGenericDataArrayLookupHelper.h









share|improve this question
















As the title says I'm having problems compiling the latest version of VTK from the github source.



I'm not a c++ programmer and only have a basic understanding of the code. So far what I have tried/investigated/googled to no avail:



  • Linted the .h file/looked for bad white spaces/tabs. (I didn't expect this to do anything)

  • a hard reset of my local git repo

  • tried compiling with gcc-8 and the standard linker (/usr/bin/ld)

  • tried compiling with clang and the llvm linker (/usr/bin/ld.lld)

  • attempted a basic compile (both) with none of the extra modules I need.

  • updated my distro/clang/gcc/llvm

I don't know where to go from here. I'm sure its something on my side, as I have not found any issues related to this from a google search.



This is the error I'm receiving without any extra output (errors from clang compilation, but the same with gcc):



`Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

This is the error output when the -v linker flag is set:



`[ 8%] Built target WrappingPythonCore
Scanning dependencies of target WrapHierarchy
[ 8%] Building C object Wrapping/Tools/CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o
[ 8%] Linking C executable ../../bin/vtkWrapHierarchy-8.90
clang version 8.0.0-1ubuntu1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
Found CUDA installation: /usr/lib/cuda, version 10.0
"/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o ../../bin/vtkWrapHierarchy-8.90 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../x86_64-linux-gnu/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../.. -L/usr/lib/llvm-8/bin/../lib -L/lib -L/usr/lib CMakeFiles/WrapHierarchy.dir/vtkWrapHierarchy.c.o ../../lib/libvtkWrappingTools-8.90.a -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o
[ 8%] Built target WrapHierarchy
Scanning dependencies of target CommonCore-hierarchy
[ 8%] Generating the wrap hierarchy for VTK::CommonCore
vtkWrapHierarchy-8.90: In /src/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h:40: syntax error.
make[2]: *** [Common/Core/CMakeFiles/CommonCore-hierarchy.dir/build.make:260: lib/vtk/hierarchy/VTK/vtkCommonCore-hierarchy.txt] Error 1
make[1]: *** [CMakeFiles/Makefile2:6418: Common/Core/CMakeFiles/CommonCore-hierarchy.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`


#

and this is the .h file referenced:



=========================================================================*/

/**
* @class vtkGenericDataArrayLookupHelper
* @brief internal class used by
* vtkGenericDataArray to support LookupValue.
*
*/

#ifndef vtkGenericDataArrayLookupHelper_h
#define vtkGenericDataArrayLookupHelper_h

#include <algorithm>
#include <cmath>
#include "vtkIdList.h"

namespace detail

// this can be removed when C++11 is required.
template< class T > struct remove_const typedef T type; ;
template< class T > struct remove_const<const T> typedef T type; ;

template <typename T, bool> struct has_NaN;

template <typename T>
struct has_NaN<T, true>

static bool isnan(T x)

return std::isnan(x);

;

template <typename T>
struct has_NaN<T, false>

static bool isnan(T)

return false;

;

template <typename T>
bool isnan(T x)

// Select the correct partially specialized type.
return has_NaN<T, std::numeric_limits<T>::has_quiet_NaN>::isnan(x);



template <class ArrayTypeT>
class vtkGenericDataArrayLookupHelper

public:
typedef ArrayTypeT ArrayType;
typedef typename ArrayType::ValueType ValueType;

// Constructor.
vtkGenericDataArrayLookupHelper()
: AssociatedArray(nullptr), SortedArray(nullptr),
FirstValue(nullptr), SortedArraySize(0)


~vtkGenericDataArrayLookupHelper()

this->ClearLookup();


void SetArray(ArrayTypeT *array)

if (this->AssociatedArray != array)

this->ClearLookup();
this->AssociatedArray = array;



vtkIdType LookupValue(ValueType elem)

this->UpdateLookup();

if (this->SortedArraySize == 0)

return -1;


if(::detail::isnan(elem))

if(this->SortedArray && ::detail::isnan(this->SortedArray->Value))

return this->SortedArray->Index;

else

return -1;



ValueWithIndex temp;
temp.Value = elem;
ValueWithIndex* pos =
std::lower_bound(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
if (pos == (this->SortedArray + this->SortedArraySize))

return -1;

if (pos->Value != elem)

return -1;

return pos->Index;


void LookupValue(ValueType elem, vtkIdList* ids)

ids->Reset();
this->UpdateLookup();

if (this->SortedArraySize == 0)

return;


if(::detail::isnan(elem))

ValueWithIndex *range = this->SortedArray;
while (range != this->FirstValue)

ids->InsertNextId(range->Index);
++range;


else

ValueWithIndex temp;
temp.Value = elem;
std::pair<ValueWithIndex*, ValueWithIndex*> range =
std::equal_range(this->FirstValue,
this->SortedArray + this->SortedArraySize, temp);
while (range.first != range.second)

// assert(range.first->Value == elem);
ids->InsertNextId(range.first->Index);
++range.first;




//@
/**
* Release any allocated memory for internal data-structures.
*/
void ClearLookup()

free(this->SortedArray);
this->SortedArray = nullptr;
this->SortedArraySize = 0;

//@

private:
vtkGenericDataArrayLookupHelper(const vtkGenericDataArrayLookupHelper&) = delete;
void operator=(const vtkGenericDataArrayLookupHelper&) = delete;

struct ValueWithIndex

typename ::detail::remove_const<ValueType>::type Value;
vtkIdType Index;
inline bool operator<(const ValueWithIndex& other) const

return this->Value < other.Value;

;

static bool isnan(const ValueWithIndex &tmp)

return ::detail::isnan(tmp.Value);


void UpdateLookup()
this->SortedArray)

return;


int numComps = this->AssociatedArray->GetNumberOfComponents();
this->SortedArraySize =
this->AssociatedArray->GetNumberOfTuples() * numComps;

if (this->SortedArraySize == 0)

return;


this->SortedArray = reinterpret_cast<ValueWithIndex*>(
malloc(this->SortedArraySize * sizeof(ValueWithIndex)));
for (vtkIdType cc = 0, max = this->AssociatedArray->GetNumberOfValues();
cc < max; ++cc)

ValueWithIndex& item = this->SortedArray[cc];
item.Value = this->AssociatedArray->GetValue(cc);
item.Index = cc;

this->FirstValue = std::partition(this->SortedArray, this->SortedArray + this->SortedArraySize, isnan);
std::sort(this->FirstValue, this->SortedArray + this->SortedArraySize);


ArrayTypeT *AssociatedArray;
ValueWithIndex* SortedArray;
ValueWithIndex* FirstValue;
vtkIdType SortedArraySize;
;

#endif
// VTK-HeaderTest-Exclude: vtkGenericDataArrayLookupHelper.h






c++ vtk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 19:13









πάντα ῥεῖ

75.7k10 gold badges81 silver badges148 bronze badges




75.7k10 gold badges81 silver badges148 bronze badges










asked Mar 25 at 19:12









spencespence

216 bronze badges




216 bronze badges












  • My guess is that isnan in VTK collides with something in your system. I checked VTK nightly builds and it not tested against GCC8. Can you try GCC7? I'm pretty sure that VTK is GCC7 compatible.

    – Liu Hao Cheng
    Mar 28 at 20:33


















  • My guess is that isnan in VTK collides with something in your system. I checked VTK nightly builds and it not tested against GCC8. Can you try GCC7? I'm pretty sure that VTK is GCC7 compatible.

    – Liu Hao Cheng
    Mar 28 at 20:33

















My guess is that isnan in VTK collides with something in your system. I checked VTK nightly builds and it not tested against GCC8. Can you try GCC7? I'm pretty sure that VTK is GCC7 compatible.

– Liu Hao Cheng
Mar 28 at 20:33






My guess is that isnan in VTK collides with something in your system. I checked VTK nightly builds and it not tested against GCC8. Can you try GCC7? I'm pretty sure that VTK is GCC7 compatible.

– Liu Hao Cheng
Mar 28 at 20:33













0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344924%2fvtkgenericdataarraylookuphelper-h-syntax-error-compiling-vtk-8-90%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344924%2fvtkgenericdataarraylookuphelper-h-syntax-error-compiling-vtk-8-90%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript