Git Product home page Git Product logo

Comments (6)

poletti-marco avatar poletti-marco commented on May 1, 2024

Thanks for the report, I'll take a look this weekend.
In the meantime, could you please provide the exact command that you used to build? Also, what Fruit version you're using? (or are you using git master?)

from fruit.

YujenHsieh avatar YujenHsieh commented on May 1, 2024

Thanks for your reply. The Fruit version I'm using is 2.0.4-0. I built with "g++-5 -std=c++11 fruit.cpp -lfruit"

from fruit.

poletti-marco avatar poletti-marco commented on May 1, 2024

The issue looks specific to Ubuntu 14.04.
In Ubuntu 14.04, the following compilers hit the segfault with the Fruit binary packages:

  • Clang 3.5, 3.6, 3.7, 3.8
  • GCC 4.9, GCC 5.0

While GCC 4.8 works.

In Ubuntu 15.10, I've tried the following compilers and they all work:

  • Clang 3.5, 3.6, 3.7, 3.8
  • GCC 5.0

This might be caused by the fact that the Fruit packages are built with GCC (GCC 4.8 for Ubuntu 14.04) and then using them with another compiler is not guaranteed to work (it does usually work though; so I understand that people come to expect this).
I've tried uninstalling the Fruit packages and instead manually building Fruit under Ubuntu 14.04 with each compiler and then compiling the example with the same compiler, and all the following compilers work:

  • GCC 4.8, GCC 4.9, GCC 5.0
  • Clang 3.5, 3.6, 3.7, 3.8

So I would suggest that you do the same. Remember to uninstall the binary packages, as having a mix of manually-built files and binary packages could cause even more trouble.
The instructions for building fruit manually are here.

This might also be due to the fact that the binary packages are built using the openSUSE Build Service, and for Ubuntu 14.04 that uses GCC 4.8.2 instead of a more recent version (Fruit only supports GCC 4.8.3 or later).

Since the prebuilt packages for 14.04 have issues, I've removed them entirely so that other people don't experience the same issues. Sorry for the trouble.

from fruit.

YujenHsieh avatar YujenHsieh commented on May 1, 2024

It works. Thank you. :)

from fruit.

qgicup avatar qgicup commented on May 1, 2024

I cannot compile it on Ubuntu 14.04 with gcc 4.8.4, see below 👍

ization::normalizeBindingsAndAddTo(fruit::impl::FixedSizeVector<fruit::impl::ComponentStorageEntry>&&, fruit::impl::MemoryPool&, const fruit::impl::NormalizedComponentStorage&, fruit::impl::FixedSizeAllocator::FixedSizeAllocatorData&, std::vector<fruit::impl::ComponentStorageEntry, fruit::impl::ArenaAllocator<fruit::impl::ComponentStorageEntry> >&, std::unordered_map<fruit::impl::TypeId, fruit::impl::NormalizedMultibindingSet>&)::__lambda40, fruit::impl::BindingNormalization::normalizeBindingsAndAddTo(fruit::impl::FixedSizeVector<fruit::impl::ComponentStorageEntry>&&, fruit::impl::MemoryPool&, const fruit::impl::NormalizedComponentStorage&, fruit::impl::FixedSizeAllocator::FixedSizeAllocatorData&, std::vector<fruit::impl::ComponentStorageEntry, fruit::impl::ArenaAllocator<fruit::impl::ComponentStorageEntry> >&, std::unordered_map<fruit::impl::TypeId, fruit::impl::NormalizedMultibindingSet>&)::__lambda41, fruit::impl::BindingNormalization::normalizeBindingsAndAddTo(fruit::impl::FixedSizeVector<fruit::impl::ComponentStorageEntry>&&, fruit::impl::MemoryPool&, const fruit::impl::NormalizedComponentStorage&, fruit::impl::FixedSizeAllocator::FixedSizeAllocatorData&, std::vector<fruit::impl::ComponentStorageEntry, fruit::impl::ArenaAllocator<fruit::impl::ComponentStorageEntry> >&, std::unordered_map<fruit::impl::TypeId, fruit::impl::NormalizedMultibindingSet>&)::__lambda42, fruit::impl::BindingNormalization::normalizeBindingsAndAddTo(fruit::impl::FixedSizeVector<fruit::impl::ComponentStorageEntry>&&, fruit::impl::MemoryPool&, const fruit::impl::NormalizedComponentStorage&, fruit::impl::FixedSizeAllocator::FixedSizeAllocatorData&, std::vector<fruit::impl::ComponentStorageEntry, fruit::impl::ArenaAllocator<fruit::impl::ComponentStorageEntry> >&, std::unordered_map<fruit::impl::TypeId, fruit::impl::NormalizedMultibindingSet>&)::__lambda43, fruit::impl::BindingNormalization::normalizeBindingsAndAddTo(fruit::impl::FixedSizeVector<fruit::impl::ComponentStorageEntry>&&, fruit::impl::MemoryPool&, const fruit::impl::NormalizedComponentStorage&, fruit::impl::FixedSizeAllocator::FixedSizeAllocatorData&, std::vector<fruit::impl::ComponentStorageEntry, fruit::impl::ArenaAllocator<fruit::impl::ComponentStorageEntry> >&, std::unordered_map<fruit::impl::TypeId, fruit::impl::NormalizedMultibindingSet>&)::__lambda44}; fruit::impl::HashMapWithArenaAllocator<fruit::impl::TypeId, fruit::impl::ComponentStorageEntry> = std::unordered_map<fruit::impl::TypeId, fruit::impl::ComponentStorageEntry, std::hash<fruit::impl::TypeId>, std::equal_to<fruit::impl::TypeId>, fruit::impl::ArenaAllocator<std::pair<const fruit::impl::TypeId, fruit::impl::ComponentStorageEntry> > >]’
/home/buddy/work/fruit/fruit-3.1.0/src/binding_normalization.cpp:433:50:   required from here
/usr/include/c++/4.8/bits/hashtable.h:727:6: error: ‘std::_Hashtable<fruit::impl::ComponentStorageEntry::LazyComponentWithNoArgs, fruit::impl::ComponentStorageEntry::LazyComponentWithNoArgs, fruit::impl::ArenaAllocator<fruit::impl::ComponentStorageEntry::LazyComponentWithNoArgs>, std::__detail::_Identity, std::equal_to<fruit::impl::ComponentStorageEntry::LazyComponentWithNoArgs>, fruit::impl::NormalizedComponentStorage::HashLazyComponentWithNoArgs, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::_Node_allocator_type’ has no member named ‘construct’
/home/buddy/work/fruit/fruit-3.1.0/include/fruit/impl/normalized_component_storage/binding_normalization.templates.h:50: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/cc0xnUWM.out file, please attach this to your bugreport.
Traceback (most recent call last):
  File "/usr/share/apport/gcc_ice_hook", line 34, in <module>
    with apport.fileutils.make_report_file(pr) as f:
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 290, in make_report_file
    return open(path, 'xb')
FileExistsError: [Errno 17] File exists: '/var/crash/_usr_lib_gcc_x86_64-linux-gnu_4.8_cc1plus.1000.crash'
make[2]: *** [src/CMakeFiles/fruit.dir/binding_normalization.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/fruit.dir/all] Error 2
make: *** [all] Error 2
buddy@ubuntu:~/work/fruit/fruit-3.1.0/build$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

myuser@ubuntu:~/work/fruit/fruit-3.1.0/build$ 

Also see below my CMake results >

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test FRUIT_TRIVIAL_SOURCE_COMPILES
-- Performing Test FRUIT_TRIVIAL_SOURCE_COMPILES - Success
-- Performing Test FRUIT_HAS_CLANG_ARBITRARY_OVERLOAD_RESOLUTION_BUG
-- Performing Test FRUIT_HAS_CLANG_ARBITRARY_OVERLOAD_RESOLUTION_BUG - Failed
-- Performing Test FRUIT_HAS_HAS_TRIVIAL_COPY
-- Performing Test FRUIT_HAS_HAS_TRIVIAL_COPY - Success
-- Performing Test FRUIT_HAS_IS_TRIVIALLY_COPYABLE
-- Performing Test FRUIT_HAS_IS_TRIVIALLY_COPYABLE - Failed
-- Performing Test FRUIT_HAS_MAX_ALIGN_T
-- Performing Test FRUIT_HAS_MAX_ALIGN_T - Success
-- Performing Test FRUIT_HAS_STD_IS_TRIVIALLY_COPYABLE
-- Performing Test FRUIT_HAS_STD_IS_TRIVIALLY_COPYABLE - Failed
-- Performing Test FRUIT_HAS_STD_IS_TRIVIALLY_COPY_CONSTRUCTIBLE
-- Performing Test FRUIT_HAS_STD_IS_TRIVIALLY_COPY_CONSTRUCTIBLE - Failed
-- Performing Test FRUIT_HAS_STD_MAX_ALIGN_T
-- Performing Test FRUIT_HAS_STD_MAX_ALIGN_T - Failed
-- Performing Test FRUIT_HAS_TYPEID
-- Performing Test FRUIT_HAS_TYPEID - Success
-- Performing Test FRUIT_HAS_CONSTEXPR_TYPEID
-- Performing Test FRUIT_HAS_CONSTEXPR_TYPEID - Success
-- Performing Test FRUIT_HAS_CXA_DEMANGLE
-- Performing Test FRUIT_HAS_CXA_DEMANGLE - Success
-- Performing Test FRUIT_HAS_ALWAYS_INLINE_ATTRIBUTE
-- Performing Test FRUIT_HAS_ALWAYS_INLINE_ATTRIBUTE - Success
-- Performing Test FRUIT_HAS_FORCEINLINE
-- Performing Test FRUIT_HAS_FORCEINLINE - Failed
-- Performing Test FRUIT_HAS_ATTRIBUTE_DEPRECATED
-- Performing Test FRUIT_HAS_ATTRIBUTE_DEPRECATED - Success
-- Performing Test FRUIT_HAS_GCC_ATTRIBUTE_DEPRECATED
-- Performing Test FRUIT_HAS_GCC_ATTRIBUTE_DEPRECATED - Success
-- Performing Test FRUIT_HAS_DECLSPEC_DEPRECATED
-- Performing Test FRUIT_HAS_DECLSPEC_DEPRECATED - Failed
-- Performing Test FRUIT_HAS_MSVC_ASSUME
-- Performing Test FRUIT_HAS_MSVC_ASSUME - Failed
-- Performing Test FRUIT_HAS_BUILTIN_UNREACHABLE
-- Performing Test FRUIT_HAS_BUILTIN_UNREACHABLE - Success
-- Configuring done
-- Generating done

It only worked to compile Fruit 2.1, but not 3++ versions

from fruit.

poletti-marco avatar poletti-marco commented on May 1, 2024

It only worked to compile Fruit 2.1, but not 3++ versions

@qgicup: Yes, 3.x doesn't work with GCC<5.0 (and from your logs it's clear that you're using GCC 4.8.4).
See https://github.com/google/fruit/wiki/install#dependencies for more details on supported compilers.
Since you're using Ubuntu 14.04, the distribution-provided GCC is quite old; however you can install a newer one from this PPA: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test , and then use that to build Fruit.

from fruit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.