compilation fail: duplicate listing of header files in src/Makefile.am & missing backslash

Bug #712766 reported by Minh Van Nguyen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
Fix Released
High
Gábor Csárdi

Bug Description

Affecting revision: 2309

Checkout trunk of igraph 0.6 and run the following commands:

$ autoreconf --install
$ ./configure --prefix=/tmp/igraphusr
$ make && make install

Create a C source file named demo.c with the following content:

<quote>
#include <igraph.h>

int main(void) {
  return 0;
}
</quote>

Now compile the above program as follows:

$ gcc demo.c -I/tmp/igraphusr/include/igraph -L/tmp/igraphusr/lib -ligraph -o demo
In file included from demo.c:1:
/tmp/igraphusr/include/igraph/igraph.h:40: fatal error: igraph_complex.h: No such file or directory
compilation terminated.

The problem can be traced to the file src/Makefile.am, specifically the following section:

HEADERS_PUBLIC =../include/igraph.h ../include/igraph_memory.h \
  ../include/igraph_random.h ../include/igraph_types.h \
  ../include/igraph_vector.h ../include/igraph_matrix.h \
  ../include/igraph_array.h ../include/igraph_dqueue.h \
  ../include/igraph_stack.h ../include/igraph_heap.h \
  ../include/igraph_arpack.h ../include/igraph_interrupt.h \
  ../include/igraph_attributes.h ../include/igraph_error.h \
  ../include/igraph_pmt.h ../include/igraph_pmt_off.h \
  ../include/igraph_adjlist.h ../include/igraph_iterators.h \
  ../include/igraph_bipartite.h ../include/igraph_layout.h \
  ../include/igraph_centrality.h ../include/igraph_motifs.h \
  ../include/igraph_cliques.h ../include/igraph_neighborhood.h \
  ../include/igraph_cocitation.h ../include/igraph_nongraph.h \
  ../include/igraph_community.h ../include/igraph_operators.h \
  ../include/igraph_components.h ../include/igraph_paths.h \
  ../include/igraph_constructors.h ../include/igraph_progress.h \
  ../include/igraph_conversion.h ../include/igraph_revolver.h \
  ../include/igraph_datatype.h ../include/igraph_structural.h\
  ../include/igraph_flow.h ../include/igraph_topology.h \
  ../include/igraph_foreign.h ../include/igraph_transitivity.h \
  ../include/igraph_games.h ../include/igraph_visitor.h \
  ../include/igraph_interface.h ../include/igraph_adjlist.h \
  ../include/igraph_progress.h ../include/igraph_constants.h \
  ../include/igraph_vector_pmt.h ../include/igraph_matrix_pmt.h\
  ../include/igraph_array_pmt.h ../include/igraph_dqueue_pmt.h\
  ../include/igraph_stack_pmt.h ../include/igraph_heap_pmt.h \
  ../include/igraph_vector_ptr.h ../include/igraph_spmatrix.h \
  ../include/igraph_strvector.h ../include/igraph_psumtree.h \
  ../include/igraph_sparsemat.h ../include/igraph_mixing.h \
  ../include/igraph_version.h ../include/igraph_blas.h \
  ../include/igraph_separators.h ../include/igraph_cohesive_blocks.h \
  ../include/igraph_statusbar.h
  ../include/igraph_lapack.h ../include/igraph_complex.h \
  ../include/igraph_eigen.h ../include/igraph_statusbar.h

Notice that there should be a backslash after "../include/igraph_statusbar.h". Put in the required backslash and again do

$ autoreconf --install
$ ./configure --prefix=/tmp/igraphusr
$ make && make install

will result in an installation error such as

/usr/bin/install: will not overwrite just-created `/home/mvngu/usr/include/igraph/igraph_statusbar.h' with `../include/igraph_statusbar.h'
make[3]: *** [install-includeHEADERS] Error 1
make[3]: Leaving directory `/home/mvngu/usr/src/igraph/src'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/mvngu/usr/src/igraph/src'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/mvngu/usr/src/igraph/src'
make: *** [install-recursive] Error 1

This is because some header files are listed more than once in the above "HEADERS_PUBLIC" section, in particular the following files are listed twice:

* igraph_adjlist.h
* igraph_progress.h
* igraph_statusbar.h

See the attached patch for a solution.

Revision history for this message
Minh Van Nguyen (mvngu) wrote :
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Thanks! Fixed in revision #2311 (0.6-main).

Changed in igraph:
status: New → Fix Released
importance: Undecided → High
assignee: nobody → Gábor Csárdi (gabor.csardi)
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/85

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.