Building propeller-gcc + PropWare

ntosme2ntosme2 Posts: 12
edited 2019-07-20 - 02:38:16 in Propeller 1
I've put together a docker that makes deployment easy on any system.

https://gitlab.com/ntosme2/propeller-docker

To use PropWare develop branch (3.0), clone and then checkout the develop branch.
To use PropWare 2.0.1, clone and then checkout master.

Both branches compile propeller-gcc(6) from source.

Install:
# clone the repo:
git clone https://gitlab.com/ntosme2/propeller-docker
git checkout <either develop or master, see above>
# build the docker
cd propeller-docker
./build_docker

Build/Run:
# from your project directory make a build directory
cd /path/to/project
# enter docker environment: note it's currently hard-coded to pass-through /dev/ttyUSB0 as the device to program
/path/to/propeller-docker/propeller
# build
mkdir -p build && cd build
cmake ..
make
# run
make run
# or debug with interactive serial shell
make debug

Edit 2: the below issues are resolved
Edit - https://ci.zemon.name/ is accessable now. Troubleshooting building PropWare (develop/3.0) is below:

Using the "GettingStarted" project in PropWare as an example:
git clone https://gitlab.com/ntosme2/propeller-docker
cd propeller-docker
./build_docker
cd /path/to/PropWare/Examples/GettingStarted/
./propeller #runs bash in the docker built above
cd /home/<your username>/
mkdir build
cd build
cmake ..

It appears to almost work, but something seems to be broken with the way I'm installing/building PropWare
# cmake ..
-- Found PropWare: /usr/share/PropWare/CMakeModules/PropellerToolchain.cmake (found version "3.0.0") 
-- The C compiler identification is GNU 6.0.0
-- The CXX compiler identification is GNU 6.0.0
-- Check for working C compiler: /opt/parallax/bin/propeller-elf-gcc
-- Check for working C compiler: /opt/parallax/bin/propeller-elf-gcc -- 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: /opt/parallax/bin/propeller-elf-gcc
-- Check for working CXX compiler: /opt/parallax/bin/propeller-elf-gcc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /opt/parallax/bin/propeller-elf-gcc
-- Configuring done
CMake Error at /usr/share/cmake-3.5/Modules/FindPropWare.cmake:449 (target_link_libraries):
  Error evaluating generator expression:

    $<COMPILE_LANGUAGE:DAT>

  $<COMPILE_LANGUAGE:...> Unknown language.
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPropWare.cmake:475 (_pw_create_executable)
  CMakeLists.txt:12 (create_simple_executable)


CMake Error at /usr/share/cmake-3.5/Modules/FindPropWare.cmake:449 (target_link_libraries):
  Error evaluating generator expression:

    $<COMPILE_LANGUAGE:DAT>

  $<COMPILE_LANGUAGE:...> Unknown language.
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPropWare.cmake:475 (_pw_create_executable)
  CMakeLists.txt:12 (create_simple_executable)


CMake Error at /usr/share/cmake-3.5/Modules/FindPropWare.cmake:449 (target_link_libraries):
  Error evaluating generator expression:

    $<COMPILE_LANGUAGE:DAT>

  $<COMPILE_LANGUAGE:...> Unknown language.
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPropWare.cmake:475 (_pw_create_executable)
  CMakeLists.txt:12 (create_simple_executable)


CMake Error at /usr/share/cmake-3.5/Modules/FindPropWare.cmake:449 (target_link_libraries):
  Error evaluating generator expression:

    $<COMPILE_LANGUAGE:DAT>

  $<COMPILE_LANGUAGE:...> Unknown language.
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPropWare.cmake:475 (_pw_create_executable)
  CMakeLists.txt:12 (create_simple_executable)


Comments

  • ntosme2ntosme2 Posts: 12
    edited 2019-07-14 - 17:52:34
    .
  • DavidZemonDavidZemon Posts: 2,782
    edited 2019-07-15 - 02:51:50
    Hi! You seem to have written up a pretty nice Docker image - I like it!

    Any reason why you're compiling PropGCC from source and not using a binary from the same CI server? At first, when I was reading your Dockerfile, I figured you simply preferred compiling from source. But then when I saw you were downloading PropWare in binary form, I got a bit more confused.

    Also, PropWare 2.x is quite old at this point. I know there's no official stable release of 3.x yet, but it's probably more stable at this point (and definitely better supported ;) ) than the 2.x branch. I've made a lot of enhancements to PropWare's build system since branching off to v3.
    For reference, here's all the work I've been doing (er... did a long time ago) in the v3 tree: https://github.com/parallaxinc/PropWare/milestone/4?closed=1
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: https://ci.zemon.name?guest=1
  • I generally prefer building from source if available because gitlab/github are very reliable and I know where things are coming from.

    I intended use PropWare from source, but the develop branch is giving me the errors shown above in the last code block. Can you share your build + install recipe? I don't see a branch for "release-3.0", is that the develop branch?

    I tried building/installing like this:
    RUN cd /tmp/PropWare \
        && sed -i -e 's/add_subdirectory(Examples)//g' PropWareSources.cmake \
        && sed -i -e 's/add_subdirectory(test)//g' PropWareSources.cmake \
        && mkdir /tmp/build \
        && cd /tmp/build \
        && cmake /tmp/PropWare \
        && make \
        && make install \
        && cd /tmp/PropWare \
        && ./packaging/postinst \
        && cp -r /tmp/PropWare /usr/share \
        && cd / \
        && rm -rf /tmp/PropWare /tmp/build
    

    The first two sed lines were because I was getting compile errors in those directories.
  • ntosme2 wrote: »
    I generally prefer building from source if available because gitlab/github are very reliable and I know where things are coming from.

    I intended use PropWare from source, but the develop branch is giving me the errors shown above in the last code block. Can you share your build + install recipe? I don't see a branch for "release-3.0", is that the develop branch?

    I tried building/installing like this:
    RUN cd /tmp/PropWare \
        && sed -i -e 's/add_subdirectory(Examples)//g' PropWareSources.cmake \
        && sed -i -e 's/add_subdirectory(test)//g' PropWareSources.cmake \
        && mkdir /tmp/build \
        && cd /tmp/build \
        && cmake /tmp/PropWare \
        && make \
        && make install \
        && cd /tmp/PropWare \
        && ./packaging/postinst \
        && cp -r /tmp/PropWare /usr/share \
        && cd / \
        && rm -rf /tmp/PropWare /tmp/build
    

    The first two sed lines were because I was getting compile errors in those directories.

    Okay, thanks for reporting this. I've discovered two different bugs while investigating this and will get them fixed shortly.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: https://ci.zemon.name?guest=1
  • Bug #1 is fixed, "bug" #2 is actually a CMake bug and not a PropWare bug. The CMake bug appears to have been fixed in v3.12, though I was unable to find reference to it in the release notes: https://gitlab.kitware.com/cmake/cmake/issues/17952
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: https://ci.zemon.name?guest=1
  • Oh, and PropGCC with GCC 6 doesn't work with PropWare. Missing some C++-related headers. You'll have to switch to GCC 4 I'm afraid :(
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: https://ci.zemon.name?guest=1
  • Just so you know, I built my own Docker image for this stuff a while ago. I just updated it with the latest set of all the tools: https://hub.docker.com/r/davidzemon/propworld
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: https://ci.zemon.name?guest=1
  • ntosme2ntosme2 Posts: 12
    edited 2019-07-20 - 02:41:15
    Great!

    I pushed a working recipe that compiles PropWare develop/3.0 to the develop branch. I decided to remove the system cmake and compile and install 3.14 from source as well as that was easier than using 18.04 and installing an older gcc.

    edit: no gcc6 ... hmm there are some nice and shiny language features I'd love to use. That explains the issue compiling a few of the examples. How much functionality is lost? Can I help with workarounds?
  • I'm successfully using gcc6 with the I2CMaster and printer (pwOut) drivers, so the basics work fine.
  • Re: GCC 6

    Some of the basics do, indeed work. But then other things don't. For instance, the header "cstddef" doesn't exist and I'd have to replace it with "stddef.h" in PropWare/utlity/collection/queue.h. When I fix that, then it fails with a linker error:
    /usr/bin/cmake --build /home/david/reusable/Documents/Programming/PropellerProjects/PropWare/bin --target BufferedUART_Demo -- -j 4
    [  0%] Built target Libpropeller_lmm
    [  6%] Built target LibPropelleruino_lmm
    [  6%] Built target PropWare_lmm
    [100%] Built target Simple_lmm
    Scanning dependencies of target BufferedUART_Demo
    [100%] Building COGCXX object Examples/PropWare_BufferedUART/CMakeFiles/BufferedUART_Demo.dir/buffereduarttx.cogcpp.cog
    [100%] Building CXX object Examples/PropWare_BufferedUART/CMakeFiles/BufferedUART_Demo.dir/BufferedUART_Demo.cpp.obj
    [100%] Building COGCXX object Examples/PropWare_BufferedUART/CMakeFiles/BufferedUART_Demo.dir/buffereduartrx.cogcpp.cog
    [100%] Linking C executable BufferedUART_Demo.elf
    CMakeFiles/BufferedUART_Demo.dir/buffereduarttx.cogcpp.cog: In function `.L19':
    /tmp/ccKt6E1t.o:(buffereduarttx.cog+0x3cc): undefined reference to `_abort_ret'
    collect2: error: ld returned 1 exit status
    

    I gave up on this quite a while ago. GCC 6 was never finished. I think some really good work went into it, but it's truly an incomplete port at this point :(
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
    CI Server: https://ci.zemon.name?guest=1
Sign In or Register to comment.