Build igotu2gpx on OS X Yosemite

Asked by Pierre Bernard

Hi!

I am trying to build igotu2gpx 0.30.0 on OS X Yosemite so that I can integrate a patch for the year 2016 bug.
I managed to create a build, but it crashes immediately.

I used Homebrew to install dependancies:

brew install qt
brew install homebrew/versions/gcc49
brew install boost --cc=gcc-4.9
brew uninstall libusb (could not get ld to find libusb, but it is happy with limbs-compat)
brew install libusb-compat
brew install pkg-config

I updated localconfig.pri like so:

macx:BOOSTROOT = /usr/local/include/boost/../..
macx:BOOSTINCLUDEDIR = $${BOOSTROOT}/include
macx:BOOSTLIBDIR = $${BOOSTROOT}/lib
macx:BOOSTPOLIB = boost_program_options-mt
macx:LIBUSBINCLUDEDIR = /usr/local/Cellar/libusb-compat/0.1.5/include

This is not good enough for the liker to fin libusb. Thus I also patched libusb.pri:

LIBS *= -L/usr/local/Cellar/libusb-compat/0.1.5/lib -lusb

Then I run:

qmake -spec macx-g++
make
sudo make install

The binary is installed at:
 /usr/local/bin/igotu2gpx
It links against:
 /usr/local/lib/libigotu.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
 /usr/local/opt/boost/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
 /usr/local/opt/qt/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
 /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 283.0.0)

Running the binary crashes:

/usr/local/bin/igotu2gpx -version
igotu2gpx(18099,0x7fff7671c300) malloc: *** error for object 0x7fff75403f50: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

I don’t expect this to be a code level bug since I am using the code distribution from https://launchpad.net/igotu2gpx/0.3/0.3.0/+download/igotu2gpx-0.3.0.tar.gz

Any suggestions appreciated.

Question information

Language:
English Edit question
Status:
Answered
For:
igotu2gpx Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael Hofmann (mh21) said :
#1

Hi,

can you get a backtrace for the crash? I don't really know how to do this in on OS X, on linux it would be sth like just running it in gdb or "gdb -c core ..." and "bt".

Cheers
  Michael

Revision history for this message
Pierre Bernard (pierre-bernard) said :
#2

Hi Michael,

The backtrace is:

(gdb) bt
#0 0x00007fff92676286 in __pthread_kill ()
#1 0x00007fff9b8019f9 in pthread_kill ()
#2 0x00007fff8ed689ab in abort ()
#3 0x00007fff998361cb in free ()
#4 0x000000010012413f in boost::program_options::store ()
#5 0x0000000102420500 in ?? ()
Previous frame inner to this frame (gdb could not unwind past this frame)

The version of boost I got is 1.60.0_2

Pierre

Revision history for this message
Pierre Bernard (pierre-bernard) said :
#3

Hi!

I managed to build igotu2gpx 0.3.0 on Mac OS X 10.6 Snow Leopard using the following procedure:

sudo port install qt4-mac
sudo port install boost
sudo port install libusb
sudo port install libusb-compat
sudo port install pkg-config

Copy localconfig-template.pri to localconfig.pri

Update:
macx:BOOSTROOT = /opt/local
macx:BOOSTINCLUDEDIR = $${BOOSTROOT}/include
macx:BOOSTLIBDIR = $${BOOSTROOT}/lib
macx:BOOSTPOLIB = boost_program_options-mt
macx:LIBUSBINCLUDEDIR = /opt/local/include

Patch libusb.pri:
LIBS *= -L/opt/local/lib/ -lusb

qmake -spec macx-g++
make
sudo make install

Pierre

Revision history for this message
Jansen Robert (zoeloe) said (last edit ):
#4

Hi all,... I would like to contribute some notes which could help in compiling branch 0.4 on Catalina (10.15.7 (19H2026)) with Xcode 12.4:

Random notes below, enjoy:

Compilation notes for 0.4 branch on Catalina with Xcode 12.4

Starting hints in: https://answers.launchpad.net/igotu2gpx/+question/294099

sudo port install qt4-mac
sudo port install boost
sudo port install libusb
sudo port install libusb-compat
macport package is called pkgconfig,.. typo ?: sudo port install pkgconfig
(I think macports qt5 is also installed)

Copy localconfig-template.pri to localconfig.pri

Update:
macx:BOOSTROOT = /opt/local
macx:BOOSTINCLUDEDIR = $${BOOSTROOT}/include
macx:BOOSTLIBDIR = $${BOOSTROOT}/lib
macx:BOOSTPOLIB = boost_program_options-mt
macx:LIBUSBINCLUDEDIR = /opt/local/include

Patch libusb.pri:
LIBS *= -L/opt/local/lib/ -lusb

qmake -spec macx-g++

Removed brew qt to force usage of qt4-mac from macport

Nope: still some residues from brew qt5 etc detected, weird.

/opt/local/libexec/qt4/bin/qmake ?

OK: /opt/local/libexec/qt4/bin/qmake -spec macx-g++

but /usr/local/bin/qmake in path ?

try to set PATH
setenv PATH /opt/local/libexec/qt4/bin:$PATH
NOPE:
try to trick qmake with: ln -s /opt/local/libexec/qt4/bin/qmake /usr/local/bin/qmake

Better, but now: ld: unknown option: -rpath-link
because:
[Some-User-MacBook:~/igotu2gpx] someuser% which ld
/opt/local/bin/ld
[Some-User-MacBook:~/igotu2gpx] someuser% ls -al /opt/local/bin/ld
lrwxr-xr-x 1 root admin 8 Nov 11 2021 /opt/local/bin/ld -> ld-xcode
[Some-User-MacBook:~/igotu2gpx] someuser% which ld-xcode
/opt/local/bin/ld-xcode
[Some-User-MacBook:~/igotu2gpx] someuser% ls -al /opt/local/bin/ld-xcode
lrwxr-xr-x 1 root admin 24 Nov 11 2021 /opt/local/bin/ld-xcode -> ../libexec/ld64/ld-xcode

Try: setenv LDPATH /Applications/Xcode.app/Contents/Developer/usr/bin
edit tags to replace rpath-link with rpath
Nope: tags rewritten somehow (with brew pathnames the ? /usr/local/... )

search Makefiles with find . -name Makefile in igotu2gpx root dir:
./Makefile
./src/exporters/rawexporter/Makefile
./src/exporters/gpxexporter/Makefile
./src/exporters/kmlexporter/Makefile
./src/exporters/detailsexporter/Makefile
./src/visualizers/listvisualizer/Makefile
./src/tests/Makefile
./src/connections/serialconnection/Makefile
./src/connections/libusb10connection/Makefile
./src/connections/libusbconnection/Makefile
./src/programs/igotugui/Makefile
./src/programs/igotu2gpx/Makefile
./src/lib/igotu/Makefile

first edited /src/lib/igotu/Makefile
changed -rpath-link= with -L
better now:
src/exporters/detailsexporter/Makefile now
then
src/exporters/gpxexporter/Makefile
then
./src/exporters/kmlexporter/Makefile
then
./src/exporters/rawexporter/Makefile
then
./src/connections/libusb10connection/Makefile
then
./src/connections/libusbconnection/Makefile
theni
./src/connections/serialconnection/Makefile
then
./src/visualizers/listvisualizer/Makefile
bummer:
linking ../../../bin/debug/liblistvisualizer.dylib
mv -f liblistvisualizer.dylib ../../../bin/debug/
cd src/programs/igotu2gpx/ && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
Makefile:343: /usr/local/Cellar/qt/6.3.1_1/share/qt/mkspecs/features/mac/sdk.mk: No such file or directory
make[1]: *** No rule to make target `/usr/local/Cellar/qt/6.3.1_1/share/qt/mkspecs/features/mac/sdk.mk'. Stop.
make: *** [sub-src-programs-igotu2gpx-make_default] Error 2

then change
./src/programs/igotu2gpx/Makefile
changea/usr/local/Cellar/qt/6.3.1_1/share/qt/mkspecs/features/mac/sdk.mk to
/opt/local/libexec/qt5/mkspecs/features/mac/sdk.mk
a qt5 macports part, but seems to work, no qt4 equivalent found...
and rpath-link
same error in ./src/programs/igotugui/Makefile
last one ?: ./src/programs/igotugui/Makefile

Also ./src/tests/Makefile
with an include
then the tester app ?
also do make install (/usr/local/bin) but error with lrelease??? bit seems to work.
 try cp to Applications
nope, leave it in /usr/local/bin
try to cp igotu2gpx /Users/USER/Downloads/myTracks.app/Contents/MacOS/igotu2gpx0.3.0
from /usr/local/bin/igotu2gpx.app/Contents/MacOS

WORKS !!

reset tracker and resolve time issue.

Test patch: http://bazaar.launchpad.net/~hackie/igotu2gpx/0.4+y2016+qt5/revision/228/src/lib/igotu/igotupoints.cpp#src/lib/igotu/igotupoints.cpp

Date now OK for download via igotUgui
but error: ./igotu2gpx --verbose info
Downloading configuration...
Unable to download configuration from GPS tracker: Unable to send data to device: LIBUSB_ERROR_IO
BUT: dump works ! and gui info panel also ? weird,.. also ./igotu2gpx info still works...

Check hackie branch ? with qt5 and y2016 and 0.4 ?

Also check: https://bugs.launchpad.net/igotu2gpx/+bug/1333012 ... mhhh lrelease-qt4 not found ?
Doesn't work.

Anyway,.. it compiled...
my 2 cents.

Can you help with this problem?

Provide an answer of your own, or ask Pierre Bernard for more information if necessary.

To post a message you must log in.