This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem Installing r8s on mac: No rule to make target '/usr/include/string.h', needed by 'DrawTree.o'

Hi,

I'm trying to install the software r8s on a MacBook pro (M1). When trying to use the command make in the src folder (as explained in the manual and README) I get this error:

make: *** No rule to make target '/usr/include/string.h', needed by 'DrawTree.o'. Stop.

I have searched online for a solution but I was not able to find one. Some of you has any idea on how to resolve this?

Thank you in advance

Marcella

r8s string.h

Yes I have both Xcode and command line tools installed. It seems that it's the thing I need to do, but I'm quite new to mac and informatics in general and I can't understand what I need to do

It does not work. I'm still using bash, so I edited my .bashrc and opened a new terminal.

If I use the command make I get the same error

I managed to edit the makefile so that it compiled on a Macbook Pro M4 OS 26.6.2. I used ChatGPT 4 to help figure it out.

I edited the makefile to:

  • give it the correct SDK path: SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) <- due to error above

  • remove defunct paths to the C header files: sed -i '' 's| /usr/include/[^ ]*||g' makefile. There was one line (line 40) where I had to remove the path manually, even after the sed command. I changed moment.o:/usr/include/math.h moment.h MyUtilities.h to moment.o: moment.h MyUtilities.h. <- also due to error above

  • change FC to the correct gfortran version: FC = gfortran-14 and the path to the correct path: LPATH = -L/opt/homebrew/opt/gcc@14/lib/gcc/14 <- due to error: ld: library 'gfortran' not found clang: error: linker command failed with exit code 1 (use -v to see invocation)

  • set gfortran to allow some mismatches FFLAGS = -fallow-argument-mismatch <- due to error: Error: Rank mismatch in argument 'ipivot' at (1) (rank-1 and scalar)

Here is the text of the makefile:

# Make file for r8s
# Updated April 2003 for Linux and Mac OS 10.2. No other builds currently supported
# updated by madda 2 sep 2026

FC = gfortran-14  # Fortran compiler; standard on Linux, may have to go fetch this on OS X! (get it from Fink)
FFLAGS = -fallow-argument-mismatch

CC = gcc  # GNU C compiler

SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path)

LIBS =  -lgfortran -lm  # FORTRAN to C library, and standard C library
#LPATH = -L/usr/local/gfortran/lib
#LPATH = -L/usr/local/lib/gfortran
#LPATH = -L/usr/local/gfortran/lib # correct location as of August 2011.
LPATH = -L/opt/homebrew/opt/gcc@14/lib/gcc/14
CFLAGS = -g -std=c99 -pedantic  # for debugging, etc.
#CFLAGS =  # usual case


OBJS =  DrawTree.o TreeSim.o moment.o ConstrOpt.o \
MyUtilities.o WuLi.o DistrFuncs.o NRCvectorUtils.o distance.o penalty.o \
ObjFunc.o main.o relativeRates.o ReadNexusFile2.o  memory.o root3taxa.o \
TimeAlgorithms.o nextToken2.o storeNexusFile.o MinND.o TreeUtils.o structures.o \
blas.o tn.o TNwrapper.o ancestral.o covarion.o


#r8s: ${OBJS}
#   ${CC} -o r8s  ${OBJS} ${LIBS}
# Use the following for MAC OS X
r8s: ${OBJS}
    ${CC} -o r8s  ${LPATH} ${OBJS} ${LIBS}

# DO NOT DELETE


covarion.o:covarion.h
ancestral.o:ancestral.h
# continuousML.o:continuousML.h
TNwrapper.o:TNwrapper.h
DrawTree.o:DrawTree.h TreeUtils.h
TreeSim.o:TreeSim.h TreeUtils.h
moment.o: moment.h MyUtilities.h
ConstrOpt.o:
ConstrOpt.o: Maximize.h
ConstrOpt.o: NRCvectorUtils.h ConstrOpt.h MyUtilities.h
ConstrOpt.o:
DistrFuncs.o: DistrFuncs.h
MinND.o: Maximize.h NRCvectorUtils.h
MyUtilities.o: MyUtilities.h
MyUtilities.o:
MyUtilities.o: memory.h
NRCvectorUtils.o: NRCvectorUtils.h
NRCvectorUtils.o: memory.h
ObjFunc.o:
ObjFunc.o: ObjFunc.h TreeUtils.h
ObjFunc.o: structures.h TimeAlgorithms.h ConstrOpt.h objective.h ObjFuncHeader.h
ObjFunc.o: MyUtilities.h
ReadNexusFile2.o: WuLi.h nexus.h
ReadNexusFile2.o:
ReadNexusFile2.o:  TreeUtils.h
ReadNexusFile2.o: structures.h MyUtilities.h memory.h ObjFunc.h
ReadNexusFile2.o: TimeAlgorithms.h TreeSim.h
TimeAlgorithms.o: TreeUtils.h
TimeAlgorithms.o:
TimeAlgorithms.o: structures.h TimeAlgorithms.h
TimeAlgorithms.o: memory.h penalty.h
TreeUtils.o: TreeUtils.h
TreeUtils.o:
TreeUtils.o: structures.h memory.h
WuLi.o:
WuLi.o: nexus.h
WuLi.o: TreeUtils.h structures.h WuLi.h
WuLi.o: MyUtilities.h memory.h DistrFuncs.h distance.h
distance.o: distance.h nexus.h
distance.o:
distance.o: TreeUtils.h structures.h
main.o:
main.o: storeNexusFile.h nexus.h
main.o: TreeUtils.h structures.h
memory.o: memory.h
memory.o:
nextToken2.o: nexus.h
nextToken2.o:
nextToken2.o: TreeUtils.h structures.h MyUtilities.h
nextToken2.o: memory.h
penalty.o: TreeUtils.h
penalty.o:
penalty.o: structures.h penalty.h
relativeRates.o: nexus.h
relativeRates.o:
relativeRates.o: TreeUtils.h structures.h
relativeRates.o: relativeRates.h WuLi.h MyUtilities.h root3taxa.h
relativeRates.o: distance.h
root3taxa.o: TreeUtils.h
root3taxa.o:
root3taxa.o: structures.h memory.h root3taxa.h
storeNexusFile.o:
storeNexusFile.o: storeNexusFile.h MyUtilities.h
storeNexusFile.o:
structures.o: structures.h
structures.o: MyUtilities.h
structures.o: memory.h

Some of the lines are probably not necessary but I just edited it enough so it compiled and ran.

0 answers

No answers yet.

Log in to answer this question.