GithubHelp home page GithubHelp logo

Compiling on OSX about marnav HOT 6 CLOSED

mariokonrad avatar mariokonrad commented on August 21, 2024
Compiling on OSX

from marnav.

Comments (6)

mariokonrad avatar mariokonrad commented on August 21, 2024

I suspect the implementation of std::array differs between stdlibc++ and libc++, therefore the error in name.cpp:265. It looks like the function to_name(talker) is the only one using std::array, all others have switches, I'll rewrite the function to also use a switch. It may be not as fancy as std::array/algorithms, but it works well, the problem you mention will disappear and the function can become constexpr for C++14 or newer.

Edit: now I see why it's handled with std::array/algorithms, talker is a class, not directly usable in a switch. Maybe the whole construct is a bit silly, since talker could/should be an enum class... I'll do something about it.

from marnav.

mariokonrad avatar mariokonrad commented on August 21, 2024

One thing I forgot: please note that OSX is not officially supported, and I have no plans to do so.

from marnav.

raffmont avatar raffmont commented on August 21, 2024

Thanks @mariokonrad !
About the MacOS, I could test it. The real challenge will be compiling marnav on Android!

from marnav.

mariokonrad avatar mariokonrad commented on August 21, 2024

This is very kind of you. In the past I have not supported any platform I cannot test. Also, for me it is not an use-case, therefore I do not want to invest much time into it (which I do not have too much of it anyway).

However, I'm willing to think about (no guarantees!) support of other platforms if

  • there is a setup for continuous integration (Travis-CI regarding OSX, AppVeyor? for MSVC).
  • there are no intrusive changes to the code (#pragma's and #ifdef's everywhere)

from marnav.

raffmont avatar raffmont commented on August 21, 2024

@mariokonrad , usually is very no intrusive.
With the change in CMakeLists.txt i can create the makefile with cmake ... and then issue the make command . This is the result:

[ 0%] Creating directories for 'extern_gmock'
[ 1%] No download step for 'extern_gmock'
[ 1%] No patch step for 'extern_gmock'
[ 1%] No update step for 'extern_gmock'
[ 1%] Performing configure step for 'extern_gmock'
-- TARGET: gmock 1.7.0
@@ /Users/raffaelemontella/dev/marnav/extern/gmock-1.7.0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/raffaelemontella/dev/marnav/build/gmock/src/extern_gmock-build
[ 2%] Performing build step for 'extern_gmock'
[100%] Built target gmock
[ 2%] Performing install step for 'extern_gmock'
[100%] Built target gmock
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/raffaelemontella/dev/marnav/build/local/lib/libgmock.a
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/include/gmock/gmock.h
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/include/gtest/gtest.h
[ 2%] Completed 'extern_gmock'
[ 2%] Built target extern_gmock
[ 2%] Creating directories for 'extern_benchmark'
[ 3%] No download step for 'extern_benchmark'
[ 3%] No patch step for 'extern_benchmark'
[ 3%] No update step for 'extern_benchmark'
[ 3%] Performing configure step for 'extern_benchmark'
-- git Version: v0.8.1-ea82c58c-dirty
-- Version: 0.8.1
-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES
-- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- failed to compile
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/raffaelemontella/dev/marnav/build/benchmark/src/extern_benchmark-build
[ 4%] Performing build step for 'extern_benchmark'
[ 30%] Built target benchmark
[ 34%] Built target output_test_helper
[ 38%] Built target complexity_test
[ 42%] Built target cxx03_test
[ 46%] Built target filter_test
[ 51%] Built target user_counters_test
[ 55%] Built target reporter_output_test
[ 59%] Built target options_test
[ 63%] Built target map_test
[ 67%] Built target register_benchmark_test
[ 71%] Built target multiple_ranges_test
[ 75%] Built target fixture_test
[ 79%] Built target donotoptimize_test
[ 83%] Built target skip_with_error_test
[ 87%] Built target basic_test
[ 91%] Built target benchmark_test
[ 95%] Built target user_counters_tabular_test
[100%] Built target diagnostics_test
[ 4%] Performing install step for 'extern_benchmark'
[ 30%] Built target benchmark
[ 34%] Built target output_test_helper
[ 38%] Built target complexity_test
[ 42%] Built target cxx03_test
[ 46%] Built target filter_test
[ 51%] Built target user_counters_test
[ 55%] Built target reporter_output_test
[ 59%] Built target options_test
[ 63%] Built target map_test
[ 67%] Built target register_benchmark_test
[ 71%] Built target multiple_ranges_test
[ 75%] Built target fixture_test
[ 79%] Built target donotoptimize_test
[ 83%] Built target skip_with_error_test
[ 87%] Built target basic_test
[ 91%] Built target benchmark_test
[ 95%] Built target user_counters_tabular_test
[100%] Built target diagnostics_test
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/raffaelemontella/dev/marnav/build/local/lib/libbenchmark.a
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/include/benchmark
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/include/benchmark/reporter.h
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/include/benchmark/benchmark_api.h
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/include/benchmark/benchmark.h
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/lib/cmake/benchmark/benchmarkConfig.cmake
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/lib/cmake/benchmark/benchmarkConfigVersion.cmake
-- Up-to-date: /Users/raffaelemontella/dev/marnav/build/local/lib/cmake/benchmark/benchmarkTargets.cmake
-- Installing: /Users/raffaelemontella/dev/marnav/build/local/lib/cmake/benchmark/benchmarkTargets-release.cmake
[ 4%] Completed 'extern_benchmark'
[ 4%] Built target extern_benchmark
[ 4%] Building CXX object src/CMakeFiles/marnav.dir/marnav/utils/mmsi.cpp.o
[ 4%] Building CXX object src/CMakeFiles/marnav.dir/marnav/utils/mmsi_country.cpp.o
[ 4%] Building CXX object src/CMakeFiles/marnav.dir/marnav/geo/angle.cpp.o
[ 5%] Building CXX object src/CMakeFiles/marnav.dir/marnav/geo/position.cpp.o
[ 5%] Building CXX object src/CMakeFiles/marnav.dir/marnav/geo/region.cpp.o
[ 5%] Building CXX object src/CMakeFiles/marnav.dir/marnav/geo/cpa.cpp.o
[ 6%] Building CXX object src/CMakeFiles/marnav.dir/marnav/geo/geodesic.cpp.o
[ 6%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/waypoint.cpp.o
[ 6%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/tag_block.cpp.o
[ 6%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/talker_id.cpp.o
[ 7%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/convert.cpp.o
[ 7%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/manufacturer.cpp.o
[ 7%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/checks.cpp.o
[ 7%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/split.cpp.o
[ 8%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/angle.cpp.o
[ 8%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/string.cpp.o
[ 8%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/name.cpp.o
[ 8%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/io.cpp.o
[ 9%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/date.cpp.o
[ 9%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/time.cpp.o
[ 9%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/checksum.cpp.o
[ 9%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/sentence.cpp.o
[ 10%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/detail.cpp.o
[ 10%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/ais_helper.cpp.o
[ 10%] Building CXX object src/CMakeFiles/marnav.dir/marnav/nmea/nmea.cpp.o
In file included from /Users/raffaelemontella/dev/marnav/src/marnav/nmea/nmea.cpp:27:
/Users/raffaelemontella/dev/marnav/src/marnav/nmea/glc.hpp:63:64: error: implicit instantiation of undefined template
'std::_1::array<marnav::utils::optionalmarnav::nmea::glc::time_difference, 5>'
std::array<utils::optional<time_difference>, max_differences> time_diffs
;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:223:64: note: template
is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
^
/Users/raffaelemontella/dev/marnav/src/marnav/nmea/nmea.cpp:110:33: error: no matching constructor for initialization of
'const std::vector'
static const std::vector known_sentences = {
^ ~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:498:9: note: candidate
constructor template not viable: requires 2 arguments, but 78 were provided
vector(_InputIterator __first,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:506:9: note: candidate
constructor template not viable: requires at most 4 arguments, but 78 were provided
vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:513:9: note: candidate
constructor template not viable: requires 2 arguments, but 78 were provided
vector(_ForwardIterator __first,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:520:9: note: candidate
constructor template not viable: requires at most 4 arguments, but 78 were provided
vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:496:5: note: candidate
constructor not viable: requires 3 arguments, but 78 were provided
vector(size_type __n, const_reference __x, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:495:5: note: candidate
constructor not viable: requires 2 arguments, but 78 were provided
vector(size_type __n, const_reference __x);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:535:5: note: candidate
constructor not viable: requires 2 arguments, but 78 were provided
vector(const vector& __x, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:544:5: note: candidate
constructor not viable: requires 2 arguments, but 78 were provided
vector(initializer_list<value_type> __il, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:555:5: note: candidate
constructor not viable: requires 2 arguments, but 78 were provided
vector(vector&& __x, const allocator_type& __a);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:479:40: note: candidate
constructor not viable: requires single argument '__a', but 78 arguments were provided
_LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:491:14: note: candidate
constructor not viable: requires single argument '__n', but 78 arguments were provided
explicit vector(size_type __n);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:534:5: note: candidate
constructor not viable: requires single argument '__x', but 78 arguments were provided
vector(const vector& __x);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:541:5: note: candidate
constructor not viable: requires single argument '__il', but 78 arguments were provided
vector(initializer_list<value_type> __il);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:547:5: note: candidate
constructor not viable: requires single argument '__x', but 78 arguments were provided
vector(vector&& __x)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:473:5: note: candidate
constructor not viable: requires 0 arguments, but 78 were provided
vector() NOEXCEPT(is_nothrow_default_constructible<allocator_type>::value)
^
2 errors generated.
make[2]: *** [src/CMakeFiles/marnav.dir/marnav/nmea/nmea.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/marnav.dir/all] Error 2
make: *** [all] Error 2

Any idea about how to fix it?

from marnav.

mariokonrad avatar mariokonrad commented on August 21, 2024

Hi Raffaele.

The error appears here:

/Users/raffaelemontella/dev/marnav/src/marnav/nmea/glc.hpp:63:64: error: implicit instantiation of undefined template
'std::_1::array<marnav::utils::optionalmarnav::nmea::glc::time_difference, 5>'
std::array<utils::optional<time_difference>, max_differences> time_diffs
;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1> /__tuple:223:64: note: template
is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;

which indicates that your toolchain really does not like std::array. I do not know what toolchain do you have nor what it supports. Please note: the library does not support OSX. std::array is nothing specific to the library, but to the toolchain and/or the installation you are using.

Since this is not a marnav library issue, I will have to close the issue.

from marnav.

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.