EddyRivasLab / easel

Sequence analysis library used by Eddy/Rivas lab code
Other
46 stars 26 forks source link

autoheader would like complete AC_DEFINEs #20

Closed mr-c closed 7 years ago

mr-c commented 7 years ago
$ make check V=2
[…]
gcc -O3 -pthread -fPIC -msse2   -o esl_dsqdata_utest -I. -I. -L. -DeslDSQDATA_TESTDRIVE ./esl_dsqdata.c -leasel -lm
./esl_dsqdata.c: In function ‘utest_readwrite’:
./esl_dsqdata.c:1467:22: warning: implicit declaration of function ‘esl_sq_Sample’ [-Wimplicit-function-declaration]
       if (( status = esl_sq_Sample(rng, abc, maxL, &(sqarr[i])))              != eslOK) esl_fatal(msg);
                      ^~~~~~~~~~~~~
/tmp/ccO9pzie.o: In function `utest_readwrite':
esl_dsqdata.c:(.text+0x3753): undefined reference to `esl_sq_Sample'
collect2: error: ld returned 1 exit status
Makefile:415: recipe for target 'esl_dsqdata_utest' failed
make: *** [esl_dsqdata_utest] Error 1
cryptogenomicon commented 7 years ago

Does not reproduce on Linux or OS/X, using current master or develop branch, using gcc or icc.

Please provide more information so I can reproduce the problem; in particular, please specify what release or github branch you're using.

mr-c commented 7 years ago

Hello @cryptogenomicon I am using https://github.com/EddyRivasLab/easel/archive/0.43.tar.gz on Debian "sid"

$ uname -a
Linux mrcdev 4.8.0-2-amd64 #1 SMP Debian 4.8.15-2 (2017-01-04) x86_64 GNU/Linux
$ gcc --version
gcc (Debian 6.3.0-14) 6.3.0 20170415
cryptogenomicon commented 7 years ago

Still does not reproduce for me, on our CentOS Linux, with gcc 6.3.0.

But I have a hunch. Go to configure.ac line 146 where it says AC_DEFINE(eslAUGMENT_RANDOM). Add a line: AC_DEFINE(eslAUGMENT_RANDOMSEQ)

Rerun ./configure and make. See if the problem goes away.

After ./configure, in esl_config.h lines 148-149, in 0.43 code, you should see:
#define eslAUGMENT_RANDOM 1 #define eslAUGMENT_RANDOMSEQ which is slightly sloppy - eslAUGMENT_RANDOMSEQ should be defined to 1, not just defined as a symbol -- and I'll fix.

After the patch suggested above, you should see: #define eslAUGMENT_RANDOM 1 #define eslAUGMENT_RANDOMSEQ 1 which is cleaner, but as we are just using #ifdef tests for these symbols, I can't see how it should matter.

mr-c commented 7 years ago

Oh, whoops, I wasn't doing a clean build. Mea culpa.

Let me back up: I'm packaging easel for Debian. We normally run autoreconf which calls autoheader and that complained about the lack of complete AC_DEFINEs.

This patch triggers the bug, without it the checks run fine. ``` From b1ecf0a6a23941df48199be939de56907b053869 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Wed, 19 Apr 2017 06:11:51 -0700 Subject: [PATCH] add descriptions for autoheader --- configure.ac | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) --- easel.orig/configure.ac +++ easel/configure.ac @@ -101,10 +101,10 @@ # Preprocessor symbols. # adds a -Dvar=value to @DEFS@; # replace #undef's in easel.h.in -AC_DEFINE_UNQUOTED(EASEL_DATE, "$EASEL_DATE") -AC_DEFINE_UNQUOTED(EASEL_COPYRIGHT, "$EASEL_COPYRIGHT") -AC_DEFINE_UNQUOTED(EASEL_LICENSE, "$EASEL_LICENSE") -AC_DEFINE_UNQUOTED(EASEL_VERSION, "$EASEL_VERSION") +AC_DEFINE_UNQUOTED(EASEL_DATE, "$EASEL_DATE", "Easel's copyright date") +AC_DEFINE_UNQUOTED(EASEL_COPYRIGHT, "$EASEL_COPYRIGHT", "Easel's copyright") +AC_DEFINE_UNQUOTED(EASEL_LICENSE, "$EASEL_LICENSE", "Easel's license text") +AC_DEFINE_UNQUOTED(EASEL_VERSION, "$EASEL_VERSION", "Easel's version") # Figure out what host we're compiling on. # Three GNU scripts must be included in the distro: @@ -133,20 +133,21 @@ ], [ AC_MSG_NOTICE([Compiling the full Easel library, with all augmentations.]) - AC_DEFINE(eslAUGMENT_ALPHABET) - AC_DEFINE(eslAUGMENT_NCBI) - AC_DEFINE(eslAUGMENT_DMATRIX) - AC_DEFINE(eslAUGMENT_FILEPARSER) - AC_DEFINE(eslAUGMENT_GEV) - AC_DEFINE(eslAUGMENT_GUMBEL) - AC_DEFINE(eslAUGMENT_HISTOGRAM) - AC_DEFINE(eslAUGMENT_KEYHASH) - AC_DEFINE(eslAUGMENT_MINIMIZER) - AC_DEFINE(eslAUGMENT_MSA) - AC_DEFINE(eslAUGMENT_RANDOM) - AC_DEFINE(eslAUGMENT_SSI) - AC_DEFINE(eslAUGMENT_STATS) - AC_DEFINE(eslLIBRARY) + AC_DEFINE(eslAUGMENT_ALPHABET, 1, "Enable the alphabet augmentation.") + AC_DEFINE(eslAUGMENT_NCBI, 1, "Enable the NCBI augmentation.") + AC_DEFINE(eslAUGMENT_DMATRIX, 1, "Enable the dmatrix augmentation.") + AC_DEFINE(eslAUGMENT_FILEPARSER, 1, "Enable the fileparser augmentation.") + AC_DEFINE(eslAUGMENT_GEV, 1, "Enable the GEV augmentation.") + AC_DEFINE(eslAUGMENT_GUMBEL, 1, "Enable the gumbel augmentation.") + AC_DEFINE(eslAUGMENT_HISTOGRAM, 1, "Enable the histogram augmentation.") + AC_DEFINE(eslAUGMENT_KEYHASH, 1, "Enable the keyhash augmentation.") + AC_DEFINE(eslAUGMENT_MINIMIZER, 1, "Enable the minimizer augmentation.") + AC_DEFINE(eslAUGMENT_MSA, 1, "Enable the MSA augmentation.") + AC_DEFINE(eslAUGMENT_RANDOM, 1, "Enable the random augmentation.") + AC_DEFINE(eslAUGMENT_RANDOMSEQ, 1, "Enable the randomseq augmentation.") + AC_DEFINE(eslAUGMENT_SSI, 1, "Enable the SSI augmentation.") + AC_DEFINE(eslAUGMENT_STATS, 1, "Enable the state augmentation.") + AC_DEFINE(eslLIBRARY, 1, "eslLIBRARY") ]) # --enable-debugging - enable basic debugging code (level 1) @@ -161,11 +162,11 @@ enable_debugging=$enableval, enable_debugging=no) case $enable_debugging in - yes) AC_DEFINE(eslDEBUGLEVEL, 1);; - 1) AC_DEFINE(eslDEBUGLEVEL, 1);; - 2) AC_DEFINE(eslDEBUGLEVEL, 2);; - 3) AC_DEFINE(eslDEBUGLEVEL, 3);; - no) AC_DEFINE(eslDEBUGLEVEL, 0);; + yes) AC_DEFINE(eslDEBUGLEVEL, 1, "verbosity level");; + 1) AC_DEFINE(eslDEBUGLEVEL, 1, "verbosity level");; + 2) AC_DEFINE(eslDEBUGLEVEL, 2, "verbosity level");; + 3) AC_DEFINE(eslDEBUGLEVEL, 3, "verbosity level");; + no) AC_DEFINE(eslDEBUGLEVEL, 0, "verbosity level");; *) AC_MSG_ERROR([Unknown argument to --enable-debugging: $enable_debugging]);; esac @@ -381,7 +382,7 @@ if test "${HAVE_GZIP}" = "no"; then AC_MSG_WARN([gzip not found]) else - AC_DEFINE(HAVE_GZIP) + AC_DEFINE(HAVE_GZIP, 1, "Is gzip found?") fi ```
mr-c commented 7 years ago

In the meantime I'll just not run autoheader -- sorry to waste your time!

cryptogenomicon commented 7 years ago

It's a good idea not to run autoheader in any case, because it silently overwrites our configuration header, esl_config.h.in. We only use autoconf, no other GNU build system tools.

I've just checked in changes on our develop branch that make Easel safe for autoheader, including changing the AC_DEFINE()'s, and adding a decoy_config.h.in to keep it away from overwriting our configuration header.