Remove -idirafter /usr/include/sys. This had presumably been added long ago to find /usr/include/sys/malloc.h, but the project has already switched to include stdlib.h instead. https://groups.google.com/g/lp_solve/c/aEcKo6Bdpso --- bfp/bfp_LUSOL/ccc.osx.orig 2021-01-08 03:35:31.000000000 -0600 +++ bfp/bfp_LUSOL/ccc.osx 2021-01-08 03:36:24.000000000 -0600 @@ -18,7 +18,7 @@ mkdir bin bin/$PLATFORM >/dev/null 2>&1 -opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME' +opts='-O3 -DINTEGERTIME' $c -s -c $opts -I.. -I../.. -I../../colamd -I../../shared -ILUSOL -I. -DRoleIsExternalInvEngine -DINVERSE_ACTIVE=INVERSE_LUSOL $src libtool -static -o libbfp_LUSOL.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` --- configure.ac.orig 2021-01-08 03:35:31.000000000 -0600 +++ configure.ac 2021-01-08 03:36:24.000000000 -0600 @@ -21,7 +21,7 @@ linux) CCSHARED="-fPIC";; apple-darwin) - DEF=-ldl -idirafter /usr/include/sys -DINTEGERTIME + DEF=-ldl -DINTEGERTIME ;; OpenUNIX*|UnixWare*) DEF='-dy -DNOLONGLONG' --- configure.orig 2021-01-08 03:35:31.000000000 -0600 +++ configure 2021-01-08 03:36:24.000000000 -0600 @@ -1357,7 +1357,7 @@ linux) CCSHARED="-fPIC";; apple-darwin) - DEF=-ldl -idirafter /usr/include/sys -DINTEGERTIME + DEF=-ldl -DINTEGERTIME ;; OpenUNIX*|UnixWare*) DEF='-dy -DNOLONGLONG' --- demo/ccc.osx.orig 2021-01-08 03:35:31.000000000 -0600 +++ demo/ccc.osx 2021-01-08 03:36:24.000000000 -0600 @@ -9,6 +9,6 @@ else dl=-ldl fi -opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME' +opts='-O3 -DINTEGERTIME' $c -I.. -I../bfp -I../bfp/bfp_etaPFI -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP $src -o demo $math $dl --- lp_solve/ccc.osx.orig 2021-01-08 03:35:31.000000000 -0600 +++ lp_solve/ccc.osx 2021-01-08 03:36:24.000000000 -0600 @@ -35,6 +35,6 @@ def= dl=-ldl -opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME' +opts='-O3 -DINTEGERTIME' $c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl --- lpsolve55/ccc.osx.orig 2021-01-08 03:35:31.000000000 -0600 +++ lpsolve55/ccc.osx 2021-01-08 03:36:24.000000000 -0600 @@ -34,7 +34,7 @@ dl=-ldl so=y -opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME' +opts='-O3 -DINTEGERTIME' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src libtool -static -o bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` --- lpsolve55/cccLUSOL.osx.orig 2021-01-08 03:35:31.000000000 -0600 +++ lpsolve55/cccLUSOL.osx 2021-01-08 03:36:24.000000000 -0600 @@ -34,7 +34,7 @@ dl=-ldl so=y -opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME' +opts='-O3 -DINTEGERTIME' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src libtool -static -o bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`