mpfr.h file not found after installation

89 Views Asked by At

I'm trying to install some software that has dependencies on GMP and mpfr on a Mac OS machine. After installing every dependency with homebrew and trying to run the makefile it says fatal error: 'mpfr.h' file not found.

I've installed everything with homebrew and I've changed the paths in the makefile so it points to the installation paths:

CXX = g++
GMP_HOME= /opt/homebrew/Cellar/gmp/6.3.0/include
GMP_LIB_HOME = /opt/homebrew/Cellar/gmp/6.3.0/lib
LIBS = -lmpfr -lgmp -lgsl -lgslcblas -lm -lglpk
CFLAGS = -I . -I $(GMP_HOME) -g -O3 -std=c++11
LINK_FLAGS = -g -L$(GMP_LIB_HOME) 
OBJS = Interval.o Matrix.o Polynomial.o Monomial.o Constraints.o Geometry.o TaylorModel.o Continuous.o Hybrid.o

all: flowstar lib

flowstar: $(OBJS) lex.yy.o modelParser.tab.o modelParser.o
    g++ -O3 -w $(LINK_FLAGS) -o $@ $^ $(LIBS)

lib: $(OBJS) lex.yy.o modelParser.tab.o
    ar rcs libflowstar.a $^

%.o: %.cc
    $(CXX) -O3 -c $(CFLAGS) -o $@ $<
%.o: %.cpp
    $(CXX) -O3 -c $(CFLAGS) -o $@ $<
%.o: %.c
    $(CXX) -O3 -c $(CFLAGS) -o $@ $<

modelParser.tab.c: modelParser.y
    bison -d -v modelParser.y

lex.yy.c: modelLexer.l modelParser.tab.c
    flex modelLexer.l

clean: 
    rm -f flowstar *.o libflowstar.a *~ modelParser.tab.c modelParser.tab.h modelParser.output lex.yy.c

I've also exported the bison, lex and mpfr:

echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/bison/lib"
echo 'export PATH="/opt/homebrew/opt/flex/bin:$PATH"' >> ~/.zshrc
export CPPFLAGS="-I/opt/homebrew/opt/flex/include"
export LDFLAGS="-L/opt/homebrew/opt/flex/lib" 
export LDFLAGS="-L/opt/homebrew/opt/mpfr/4.2.0-p12/lib"

But I still get the same compilation error

0

There are 0 best solutions below