Back To Overview
Problem building gpstk from sources on os x 10.7
Posted on 02 Feb, 2012 by StephenBespalko
attempting to build from sources results in the following error:

jam ... Cc src/getopt-l.o Cc src/getopt1-l.o Link src/libgpstk.17.dylib.0 ld: library not found for -lgpstk collect2: ld returned 1 exit status

nothing else links after this point. Or maybe everything fails to link.

The problem happens with both the gpstk-1.7 and subversion sources.

Help would be greatly appreciated.

Add your comments to the Discussion

Hi Stephen,

To start, this URL might help you with jam options for debugging:

I did not intend to imply that you should wait for v2.0 -- its functionality will be significantly altered from v1.7. If you're not needing to modify v1.7 functionality, but want to use the main or auxiliary library modules or the applications, you may want to try downloading the Mac pre-built distribution via the "Files" tab on SourceForge, and see if that will install and function for you.

If you need to build from source, and have a complete set of autotools and libtool installed on your Mac, you may be able to build with Make. At times it is necessary to recreate aclocal.m4 so that it is compatible with the libtool version. Unfortunately I do not yet have a Mac configured with the necessary tools. Began this today, but even so it is currently a Leopard system (the Snow Leopard system is no longer available to me). We are about to begin upgrading the Leopard machine to Lion, so I'll be able to look at your issue in the proper environment, but will need to get the system set up first. I hope one of the above suggestions will help you in the meantime.

Best Regards,

--Susan Cummins
SusanCummins 07 Feb 2012 - 15:35

Susan - I spoke to quickly. While adding the -L entry to the end of the link command for libgpstk did work, the rest of the build did not. It would be helpful if you could at least see if the same behavior is exhibited in your environment. It would also be helpful if the make alternative was tested on OS X. Make is at least supported on the mac. Jam - not so much. Maybe the sort of bug I may have hit is an example of why?

In any event, a month is a bit long to wait for gpstk 2.0 - I need to do some things before that point. If you'd be willing to help me a bit I can try cobbling something together myself.

For example, how would I invoke a jam build with more verbose information - variable settings, commands, etc? The threadbare documentation doesn't at all make that clear.
StephenBespalko 06 Feb 2012 - 14:35

Hi Stephen,

Thank you for the additional info! We will be looking into the main (/src) Jamfile regarding its behavior on OS X Lion when we begin preparing distributions for the new version of the GPSTk, v2.0. We're working on that version currently (upgrading/debugging the test suite for new functionality), and hope to have a release out within the next month or so. If you check out the GPSTk from subversion currently, you do get version 1.7 with additional changes, but no additional, official version designation is associated with the current code trunk. Version 1.7 is considered the current release, and if you visit the gpstk page on SourceForge, then click on the "Files" tab, you'll be taken to a page showing all of the historical GPSTk downloadable versions, in tarball form. Click on version 1.7, for instance, and you'll be shown the various pre-built GPSTk distributions, as well as a source code tarball. Pre-built Version 1.7 for the Mac, however, was built on Snow Leopard, so that could be a factor in the problem you've been seeing. You may have noticed the repetition of the -lgpstk switch on the dynamic library installation command, and that is something we'll be looking to eliminate as we look into jam's behavior under this Jamfile. We had not seen any "failure to link" problem with this Jamfile, so not certain what was causing that for you, but we'll get more insight as we prepare the Lion distribution.

I'm glad you were able to successfully link by explicitly specifying the directory for the gpstk library, but this had not been necessary when we built under Snow Leopard, so not sure why this is happening under Lion, but I will keep that in mind as we build the next release.

Thank you for bringing this to our attention, and please let me know if you have any additional questions.

Best Regards,

-- Susan Cummins
SusanCummins 06 Feb 2012 - 09:43

Hi Susan - two things. I've attached, I hope, a more detailed listing of the output from the build up to where the first dynamic library fails to link. The problem appears to be that src/libgpstk.a is referenced as -lgpstk without a path to the archive. I was able to get it to work by adding -Lsrc to the end of the link command.

Second, other information on the gpstk site leads me to believe that I need to build 1.7.1 or 1.7.2 because I use OS X Lion. Is that what one gets by accessing the sources through subversion? Or are there tar balls floating around somewhere?
StephenBespalko 03 Feb 2012 - 15:57

Dear Stephen,

It appears that the main gpstk library did not build successfully. Can you tell me what operating system/build environment you're using,and whether you see any other error messages prior to the one above? If you're interested in running existing apps or using the current main or auxiliary libraries, you could try the pre-built distribution also downloadable from SourceForge. If that's not an option, I will need more information to determine what's causing your build failure. Also, please be sure you have write permission for the directories you're building in or installing to.

Best Regards,

-- Susan Cummins
SusanCummins 03 Feb 2012 - 11:14

Topic attachments
I Attachment Action Size Date Who Comment
gpstk-build-failure.txttxt gpstk-build-failure.txt manage 9.7 K 03 Feb 2012 - 21:55 StephenBespalko output from failed build of gpstk-1.7 on OS X Lion
Topic revision: r6 - 07 Feb 2012, SusanCummins

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback