James, That was exactly the issue. libmagic.dll.a was in /lib under cygwin. Adding a -L/lib took care of this. This was also an issue with -lpcre, which adding -L/lib fixed as well. Of course, I'm now running up against something else. from make libtool: link: g++ -fshow-column -Wall -W -Wredundant-decls -Wpointer-arith -Wca st-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef -Woverloaded-virtual -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Wlogic al-op -Wmissing-declarations -Wdouble-promotion -Winit-self -fvisibility=hidden -I/home/John/xapian-core-1.4.0/include -g -O2 -std=gnu++11 -o .libs/omega.exe om ega.o query.o cgiparam.o utils.o configfile.o date.o cdb_init.o cdb_find.o cdb_h ash.o cdb_unpack.o jsonescape.o loadfile.o datevalue.o common/str.o sample.o url encode.o weight.o expand.o csvescape.o -Wl,--enable-runtime-pseudo-reloc /home/ John/xapian-omega-1.4.0/../xapian-core-1.4.0/.libs/libxapian.dll.a -lrpcrt4 -lz -lws2_32 ./.libs/libtransform.a -L/lib -lpcre -L/usr/local/lib datevalue.o: In function `DateRangeLimit::operator-(int)': /home/John/xapian-omega-1.4.0/datevalue.cc:87: undefined reference to `timegm(tm *)' datevalue.o: In function `DateRangeLimit::operator+(int)': /home/John/xapian-omega-1.4.0/datevalue.cc:92: undefined reference to `timegm(tm *)' If I'm understanding the undefined reference error correctly, I think what make is telling me is that it can't find timegm.o, which I believe handles the definitions as specified in timegm.h. The libtool: link command is being generated by some variables in the Makefile. As best as I can tell, the list of .o files comes from libtransform_la_OBJECTS, which comes from am_libtransform_la_OBJECTS, which comes from libtransform_la-transform.lo, which does some make stuff that I can't follow that seems to be centered around transform.cc I'm guessing that if I could somehow get timegm.o added to that list that the undefined reference would go bye-bye, but as I freely admit I'm out of my depth here as relates to C/C++ I won't swear to it. Again, any useful information very much appreciated. Thanks! John On Thu, Sep 22, 2016 at 2:34 PM, James Aylett <james-xapian at tartarus.org> wrote:> On 22 Sep 2016, at 18:35, John Bankert <jbankert at gmail.com> wrote: > > > /usr/bin/x86_64-w64-mingw32-ld: cannot find -lmagic > > It's slightly confusing, but this error means it's failing to find a > _library_ called magic, which won't be in a file just called "magic". I > don't know where libraries live under cygwin, or what they're called, but > it'll probably start "libmagic". It might end ".dll". > > J > > -- > James Aylett > devfort.com ? spacelog.org ? tartarus.org/james/ > >
On Thu, Sep 22, 2016 at 05:10:32PM -0400, John Bankert wrote:> That was exactly the issue. libmagic.dll.a was in /lib under cygwin. Adding > a -L/lib took care of this.The "share" vs "lib" distinction is that "share" is for files which are architecture independent. So executable machine code will (well, should) never be there, only data files, scripts, byte-code, etc, and only when the format and contents don't depend on word-size, endianness or other aspects of the machine's architecture.> datevalue.o: In function `DateRangeLimit::operator-(int)': > /home/John/xapian-omega-1.4.0/datevalue.cc:87: undefined reference to > `timegm(tm *)'OK, this is a bug in the build system.> If I'm understanding the undefined reference error correctly, I think > what make is telling me is that it can't find timegm.o, which I > believe handles the definitions as specified in timegm.h.Almost - it's not that timegm.o isn't found, but that it's not included in the list of source files for omega. It should have been added when omega started to use timegm() in the 1.3.x series: commit 8482749f9c45de3b0d1b827fde7f807ac83b2e8c Author: Olly Betts <olly at survex.com> Date: Fri Nov 27 10:36:45 2015 +1300 Use value ranges for date range filtering by value Should be more efficient than a MatchDecider, and will automatically take advantage of any future value range optimisations in xapian-core. Many platforms (including at least Linux, BSD platforms, and OS X) provide timegm(), in which case our definition of timegm() in timegm.cc is suppressed, and timegm.o doesn't actually supply any symbols to the link, which is how this has gone unnoticed for so long. Thanks for spotting this - I'll commit a fix. A simple workaround is probably just to append the contents of timegm.cc to omega.cc (just do this once): cat timegm.cc >> omega.cc Cheers, Olly
Olly, Thanks for the hint - by concatenating timegm.cc on to the end of omega.cc, I was able to successfully build omega. Of course, now when I try to run omindex, I get nothing. I've tried using various permutation of -h to see if I could get help output to validate that the program is running. Have also tried using the -p --db etc flags shown on the omega overview page to see if I could get omindex to produce an error of some sort. echo $? returns a 0, so I'm at a loss. Thanks again for all your help. On Thu, Sep 22, 2016 at 6:25 PM, Olly Betts <olly at survex.com> wrote:> On Thu, Sep 22, 2016 at 05:10:32PM -0400, John Bankert wrote: > > That was exactly the issue. libmagic.dll.a was in /lib under cygwin. > Adding > > a -L/lib took care of this. > > The "share" vs "lib" distinction is that "share" is for files which are > architecture independent. So executable machine code will (well, > should) never be there, only data files, scripts, byte-code, etc, and > only when the format and contents don't depend on word-size, endianness > or other aspects of the machine's architecture. > > > datevalue.o: In function `DateRangeLimit::operator-(int)': > > /home/John/xapian-omega-1.4.0/datevalue.cc:87: undefined reference to > > `timegm(tm *)' > > OK, this is a bug in the build system. > > > If I'm understanding the undefined reference error correctly, I think > > what make is telling me is that it can't find timegm.o, which I > > believe handles the definitions as specified in timegm.h. > > Almost - it's not that timegm.o isn't found, but that it's not included > in the list of source files for omega. It should have been added when > omega started to use timegm() in the 1.3.x series: > > commit 8482749f9c45de3b0d1b827fde7f807ac83b2e8c > Author: Olly Betts <olly at survex.com> > Date: Fri Nov 27 10:36:45 2015 +1300 > > Use value ranges for date range filtering by value > > Should be more efficient than a MatchDecider, and will automatically > take advantage of any future value range optimisations in xapian-core. > > Many platforms (including at least Linux, BSD platforms, and OS X) > provide timegm(), in which case our definition of timegm() in timegm.cc > is suppressed, and timegm.o doesn't actually supply any symbols to the > link, which is how this has gone unnoticed for so long. > > Thanks for spotting this - I'll commit a fix. A simple workaround is > probably just to append the contents of timegm.cc to omega.cc (just do > this once): > > cat timegm.cc >> omega.cc > > Cheers, > Olly >