close
Skip to content

Alter the path to version.h.#870

Merged
jkbonfield merged 1 commit into
samtools:developfrom
whitwham:misc_version
Jun 14, 2018
Merged

Alter the path to version.h.#870
jkbonfield merged 1 commit into
samtools:developfrom
whitwham:misc_version

Conversation

@whitwham
Copy link
Copy Markdown
Member

This prevents the compiler from picking up htslib's version.h when C_INCLUDE_PATH=: (or similar).

From #817:
Simplest way to reproduce the error:

tar xvfj samtools-1.8.tar.bz2
cd samtools-1.8
./configure
C_INCLUDE_PATH=: make

The : in the C_INCLUDE_PATH is in effect adding -I. to the end of the gcc list of include paths while removing the original -I. from the start.
So
gcc -g -O2 -DMAQ_LONGREADS -I. -Ihtslib-1.8 -I./lz4 -c -o misc/maq2sam-long.o misc/maq2sam.c
becomes
gcc -g -O2 -DMAQ_LONGREADS -Ihtslib-1.8 -I./lz4 -I. -c -o misc/maq2sam-long.o misc/maq2sam.c

Though there is no apparent change in the command line, internally gcc removes any duplicate paths that are also in C_INCLUDE_PATH. This makes gcc find the htslib version.h before the samtools version.h so the build fails with a missing SAMTOOLS_VERSION.

The gcc and clang compilers both exhibit this behaviour.

Fixes #817.

This prevents the compiler from picking up htslib's version.h when C_INCLUDE_PATH=: (or similar).
@jkbonfield jkbonfield merged commit f1f90e5 into samtools:develop Jun 14, 2018
@whitwham whitwham deleted the misc_version branch February 14, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants