torognes / vsearch

Versatile open-source tool for microbiome analysis
Other
643 stars 123 forks source link

compilation warning with ar: 'u' modifier ignored since 'D' is the default #531

Closed frederic-mahe closed 6 months ago

frederic-mahe commented 10 months ago

As noted in issue #525 the program ar (from binutils) emits a warning when compiling vsearch:

ar: 'u' modifier ignored since 'D' is the default (see 'U')

The ar program creates, modifies, and extracts from archives. By default, it will try to create deterministic archives, meaning that file metadata (permissions, timestamps, etc.) will be ignored (which is good). When running the autogen.sh script, ./src/Makefile.in is created with flags for the ar program ARFLAGS = cru. To solve our issue, these flags should be set to cr or crD, but not cru. Indeed, manually setting ar flags to cr, and then running ./configure and make eliminates the warnings.

Trying to fix the issue downstream does not work:

./autogen.sh
AR_FLAGS="cr" ARFLAGS="cr" ./configure
make

This issue has been discussed in forums for at least seven years, and seems to be an issue that should be fixed upstream (binutils?). However, the issue is still present in the latest Ubuntu (23.04 and 23.10 beta) and Debian distributions. Some posts indicate that it is possible to patch the issue locally, between autogen.sh and configure, but I am not sure how to to that (using a sed -i command seems a crude idea).

torognes commented 10 months ago

Yes, it seems like a long-standing issue that should have been fixed upstream, up it may be too minor for anyone to care.

However, it seems like the following fixes the issue temporarily, on Debian at least:

make ARFLAGS="cr"
frederic-mahe commented 6 months ago

However, it seems like the following fixes the issue temporarily, on Debian at least:

make ARFLAGS="cr"

You are right. I've added that to my local compilation scripts. However, I don't think we should add that to the compilation instructions listed in the README:

./autogen.sh
./configure CFLAGS="-O3" CXXFLAGS="-O3"
make
make install

make ARFLAGS="cr" would add clutter for little benefit, in my opinion. I will close that issue for now and hope that it will be fixed upstream one day.