Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Cannot make MotionCal for Linux

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    10

    Cannot make MotionCal for Linux

    Teensy 4 is a huge hit and I understand this is not going to get noticed for a while. That said, here goes.

    In a response to a question about modifying MotionCal to support other sensors https://forum.pjrc.com/threads/43838...ight=motioncal
    Paul said
    You can dig a little deeper. The chips have clear datasheets and the library isn't complicated (at least not that part, no sensor fusion or filter). The MotionCal source is also available on github.
    To my mind that is a very fair answer! Since I wanted to modify MotionCal to use with my own IMU (although I am using a Teensy3.6 with it), I tried to follow Paul's directions. I downloaded MotionCal from git, gathered the OpenGL pieces as directed in imuread.h, and tried to build it. Here's the result:
    :~/Shared/Projects/Software/IMU/MotionCal$ make
    g++ -O2 -Wall -DLINUX `/usr/bin/wx-config --cppflags` -c -o gui.o gui.cpp
    g++ -O2 -Wall -DLINUX `/usr/bin/wx-config --cppflags` -c -o portlist.o portlist.cpp
    gcc -O2 -Wall -DLINUX -c -o visualize.o visualize.c
    gcc -O2 -Wall -DLINUX -c -o serialdata.o serialdata.c
    gcc -O2 -Wall -DLINUX -c -o rawdata.o rawdata.c
    gcc -O2 -Wall -DLINUX -c -o magcal.o magcal.c
    gcc -O2 -Wall -DLINUX -c -o matrix.o matrix.c
    gcc -O2 -Wall -DLINUX -c -o fusion.o fusion.c
    gcc -O2 -Wall -DLINUX -c -o quality.o quality.c
    gcc -O2 -Wall -DLINUX -c -o mahony.o mahony.c
    gcc -O2 -Wall -DLINUX -c -o imuread.o imuread.c
    gcc -s -O2 -Wall -DLINUX -o imuread imuread.o visualize.o serialdata.o rawdata.o magcal.o matrix.o fusion.o quality.o mahony.o -lglut -lGLU -lGL -lm
    g++ -s -O2 -Wall -DLINUX -o MotionCal gui.o portlist.o images.o visualize.o serialdata.o rawdata.o magcal.o matrix.o fusion.o quality.o mahony.o `/usr/bin/wx-config --libs all,opengl`
    /usr/bin/ld: cannot find -lwx_gtk2u_webview-3.0
    collect2: error: ld returned 1 exit status
    Makefile:71: recipe for target 'MotionCal' failed
    make: *** [MotionCal] Error 1

    Trying to find the missing wx_gtk2u_webview-3.0 led to understand that it is no longer part of the package because of security problems. But my efforts to remove it have failed. Key routines in the code appear to be in this library.
    Is there any chance of getting this fixed so that MotionCal can be built again?

    Needless to say, I'm trying to make this work now, but I realize it will be a while before any action will happen. That's OK.
    Thanks!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,065
    Try running "/usr/bin/wx-config --libs all,opengl" Look at the list is prints!

    There's nothing in the MotionCal code or Makefile specifically looking for wx_gtk2u_webview-3.0. It's simply running that command (from your system), which is telling it the extra libs which are required for your system.

    Looks like you will need to update or recompile wxWidgets.

    Again, just to be clear, this problem is a matter of your installation of wxWidgets has a "wx-config" command that is giving wrong info. It's not a problem with MotionCal. It's the wx-config command on your system. You need to focus on fixing that, or just get a copy of wxWidgets and build it from source with the usual ./configure, make, make install. Easiest if you run "./configure" with a prefix that's a local folder, then edit MotionCal's makefile to set WXCONFIG to that folder.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,065
    FWIW, here's the configure command I used, when I built wxWidgets.

    Code:
    ./configure --prefix=/home/paul/wxwidgets/3.0.2.gtk2-opengl --with-opengl --disable-shared --disable-compat28
    If all else fails, maybe get a copy of wxWidgets 3.0.2 (not the most recent) and of course replace the "/home/paul" part of the path with your home directory. If "make" and "make install" work, odds are good you'll be able to compile MotionCal by just editing the makefile with that folder name, rather than using the wxWidgets provided by your Linux distro.

    Maybe also file a bug report with whatever Linux distro you're using. Clearly they've changed the system's libraries, but not rebuilt wxWidgets for their new setup.

  4. #4
    Junior Member
    Join Date
    Nov 2012
    Posts
    10
    Thanks, as always, for your prompt and helpful reply! (Can't believe you had time to respond - Teensy4.0 launch must be going great!)

    I went here https://packages.debian.org/stretch/...webview3.0-0v5 and downloaded the version for amd64 from the http site. Double clicking the download file allowed me to install the webview library with the other wx_gtk libraries. The only trick was to create the symbolic link to libwx_gtk2u_webview-3.0.so so that wx-config would find it.

    This almost did it, but there were still some gl functions (DSOs) not found. I had to modify the makefile to add CLILIBS like so:
    MotionCal: gui.o portlist.o images.o $(OBJS)
    $(CXX) $(SFLAG) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(CLILIBS) `$(WXCONFIG) --libs all,opengl`

    With that done, MotionCal builds. Looks like it works, but now I have to add my mods.

    Again, thanks so much for the support!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •