tskit-dev / tskit

Population-scale genomics
MIT License
147 stars 69 forks source link

trees.c Compilation Error #2950

Closed micailamarcelle closed 1 month ago

micailamarcelle commented 1 month ago

Hello!

While trying to compile some code, which included elements of tskit, in the Linux environment of the University of Arizona HPC unit, I noticed that some errors were thrown within the tskit code, particularly within trees.c. I suspect that this is an issue of versions (i.e. our simulation code was likely written with an earlier version of tskit, and is now trying to use this earlier version while being supplied a current one), but I wanted to look into how to further resolve this. I've attached both an image of the particular error being thrown and the Makefile that I'm currently using (which has been checked by multiple people now, though I figured that it still might be worthwhile to include)- let me know if there are any other questions/ideas on how to fix this!

Makefile:

CC = gcc INCLUDES = -I/home/u6/micailamarcelle/tskit/c -I/home/u6/micailamarcelle/tskit/c/subprojects/kastore/ CFLAGS = $(INCLUDES) -O3 -frounding-math mutationload: main.o dependencies/pcg_basic.o sharedfunc_flag.o relative_functions.o absolute_functions.o /home/u6/micailamarcelle/tskit/c/tskit/tables.o /home/u6/micailamarcelle/tskit/c/subprojects/kastore/kastore.o /home/u6/micailamarcelle/tskit/c/tskit/core.o /home/u6/micailamarcelle/tskit/c/tskit/trees.o $(CC) -O3 -frounding-math pcg_basic.o main.o sharedfunc_flag.o relative_functions.o absolute_functions.o tables.o kastore.o core.o trees.o -lm -lgsl -lgslcblas -o mutationload main.o: main.c $(CC) $(CFLAGS) -c main.c dependencies/pcg_basic.o: dependencies/pcg_basic.c $(CC) $(CFLAGS) -c dependencies/pcg_basic.c sharedfunc_flag.o: sharedfunc_flag.c $(CC) $(CFLAGS) -c sharedfunc_flag.c relative_functions.o: relative_functions.c $(CC) $(CFLAGS) -c relative_functions.c absolute_functions.o: absolute_functions.c $(CC) $(CFLAGS) -c absolute_functions.c /home/u6/micailamarcelle/tskit/c/tskit/tables.o: /home/u6/micailamarcelle/tskit/c/tskit/tables.c $(CC) $(CFLAGS) -c -std=c99 /home/u6/micailamarcelle/tskit/c/tskit/tables.c /home/u6/micailamarcelle/tskit/c/subprojects/kastore/kastore.o: /home/u6/micailamarcelle/tskit/c/subprojects/kastore/kastore.c $(CC) $(CFLAGS) -c -std=c99 /home/u6/micailamarcelle/tskit/c/subprojects/kastore/kastore.c /home/u6/micailamarcelle/tskit/c/tskit/core.o: /home/u6/micailamarcelle/tskit/c/tskit/core.c $(CC) $(CFLAGS) -c -std=c99 /home/u6/micailamarcelle/tskit/c/tskit/core.c /home/u6/micailamarcelle/tskit/c/tskit/trees.o: /home/u6/micailamarcelle/tskit/c/tskit/trees.c $(CC) $(CFLAGS) -c -std=c99 /home/u6/micailamarcelle/tskit/c/tskit/trees.c

treesError
benjeffery commented 1 month ago

Hi @micailamarcelle! The undefined references you have are deinfined in tskit/genotypes.c which isn't mentioned in your makefile or linker line.

micailamarcelle commented 1 month ago

Thank you for pointing this out! I updated the Makefile to include genotypes.c, and the code was able to compile properly.