I work on a MacBook Pro (13 inch, M1, 2020) running macOS version 11.3.1. I downloaded the tar.bz2 file and followed the instructions to build the program
First, a few generalities. I don't have access to a Mac to test this myself. I know that UNAFold 4 compiles on a Mac, but I'm not sure if we ever tried UNAFold or OAA 3.8 on a Mac. (If we did, it was probably ten years ago so the results wouldn't necessarily match a modern OS/compiler anyway!) However, I can compile OAA 3.8 on my Linux machine with gcc 11.3, so I think there's some hope.
Those specific errors are clearly because I was sloppy with my use of header and implementation tiles. There is a function "readOrDie" defined in util.h (mistake #1) that is called from energy.c without being declared there (mistake #2). These things worked in C89 but have always been bad practice. I fixed them in UNAFold 4, but that doesn't help here.
When I build OAA 3.8, I get those same "errors" but as warnings, which allows the build to proceed. I notice in my config.log that autoconf determined that the compiler would accept C89 by default, but your output suggests that gcc is enforcing C99. Maybe you can get around this by modifying the configure step to "./configure CFLAGS=-std=c89".
I'm hopeful that will get you unstuck. If there are still problems, I'll see if there's a simple code change you can make to get around this.
I am currently having the same issue on MacOS X as well. I tried using the ./configure flags you recommended, but am still having no luck. Regarding your comment on the build being able to proceed despite the errors - presumably at the end of the OPs truncated message is something to the tune of "fatal error: too many errors emitted, stopping now [-ferror-limit=]" which prevents installation. Any guidance or advice would be greatly appreciated!
oligoarrayaux-3.8 % make
/Library/Developer/CommandLineTools/usr/bin/make all-recursive
Making all in src
gcc -DHAVE_CONFIG_H -I. -I.. -DENERGY=int -DINTEGER -DPRECISION=1000 -DPKGDATADIR=\"/usr/local/share/oligoarrayaux/\" -g -O2 -MT hybrid_min-energy.o -MD -MP -MF .deps/hybrid_min-energy.Tpo -c -o hybrid_min-energy.o `test -f 'energy.c' || echo './'`energy.c
mv -f .deps/hybrid_min-energy.Tpo .deps/hybrid_min-energy.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DENERGY=int -DINTEGER -DPRECISION=1000 -DPKGDATADIR=\"/usr/local/share/oligoarrayaux/\" -g -O2 -MT hybrid_min-hybrid-min.o -MD -MP -MF .deps/hybrid_min-hybrid-min.Tpo -c -o hybrid_min-hybrid-min.o `test -f 'hybrid-min.c' || echo './'`hybrid-min.c
hybrid-min.c:2201:8: error: implicitly declaring library function 'finite' with type 'int (double)' [-Werror,-Wimplicit-function-declaration]
if (!finite(a) || !finite(b))
^
hybrid-min.c:2201:8: note: include the header <math.h> or explicitly provide a declaration for 'finite'
hybrid-min.c:2206:10: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
return fabs(a - b) < 1e-5;
^
hybrid-min.c:2206:10: note: use function 'abs' instead
return fabs(a - b) < 1e-5;
^~~~
abs
hybrid-min.c:2211:10: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
return fabs((a - b) / (a + b)) < 0.00001;
^
hybrid-min.c:2211:10: note: use function 'abs' instead
return fabs((a - b) / (a + b)) < 0.00001;
^~~~
abs
2 warnings and 1 error generated.
make[2]: *** [hybrid_min-hybrid-min.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
oligoarrayaux-3.8 % make install
Making install in src
gcc -DHAVE_CONFIG_H -I. -I.. -DENERGY=int -DINTEGER -DPRECISION=1000 -DPKGDATADIR=\"/usr/local/share/oligoarrayaux/\" -g -O2 -MT hybrid_min-hybrid-min.o -MD -MP -MF .deps/hybrid_min-hybrid-min.Tpo -c -o hybrid_min-hybrid-min.o `test -f 'hybrid-min.c' || echo './'`hybrid-min.c
hybrid-min.c:2201:8: error: implicitly declaring library function 'finite' with type 'int (double)' [-Werror,-Wimplicit-function-declaration]
if (!finite(a) || !finite(b))
^
hybrid-min.c:2201:8: note: include the header <math.h> or explicitly provide a declaration for 'finite'
hybrid-min.c:2206:10: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
return fabs(a - b) < 1e-5;
^
hybrid-min.c:2206:10: note: use function 'abs' instead
return fabs(a - b) < 1e-5;
^~~~
abs
hybrid-min.c:2211:10: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
return fabs((a - b) / (a + b)) < 0.00001;
^
hybrid-min.c:2211:10: note: use function 'abs' instead
return fabs((a - b) / (a + b)) < 0.00001;
^~~~
abs
2 warnings and 1 error generated.
make[1]: *** [hybrid_min-hybrid-min.o] Error 1
make: *** [install-recursive] Error 1
So it seems to have worked? I dont see the program in my path variable but will add it and see if it works with the R package "openPrimeR" I am installing it for.
Based on the "1 error generated" and the fact that "make install" tries to do the build again, I'm guessing your build didn't succeed.
This seems to be another error caused by the compiler treating the code as C99 instead of C89. I don't see any setting for language standard in your output, which makes me wonder if the configure script understood CFLAGS. I don't know why "./configure CFLAGS=-std=gnu89" wouldn't solve all of this.
You can probably solve this problem by editing hybrid-min.c and removing everything after the #endif at line 3100 and before the } at line 3113. You'll have to make a similar edit to hybrid-ss-min.c. At this point I doubt that will be the last change you'll have to make, but I'll keep pursuing this as long as you want to!
So I removed that chunk of code (lines 3100-3112) from hybrid-ss-min.c but the hybrid-min.c script is only 2261 lines long and there is ~18 #endifs in there and I dont want to break anything too badly . Ill happily keep working at this!
Dp you think these problems could be avoided or superseded if I create a conda environment and download from there?
Sorry, I should have been clear that it isn't the same line numbers in hybrid-min.c. The equal() function appears at line 2195, so it's lines 2200–2211 to delete.
I didn't know what conda was until I Googled it just now. I don't really understand it; I don't think it has any relevance here, but I could be wrong.
thanks a lot for taking this on! I just saw you had written a reply. I have implemented the changes you suggest (added the line in energy.c which reproduced the error message from Blake) and commenting out the lines 2200 - 2211 and 3100 - 3112 in hybrid-min.c and hybrid-ss-min.c, respectively.
Making install in src
source='energy.c' object='energy.o' libtool=no \
DEPDIR=.deps depmode=gcc /bin/sh ../config/depcomp \
c89 -DHAVE_CONFIG_H -I. -I.. -DPKGDATADIR=\"/usr/local/share/oligoarrayaux/\" -g -O2 -c energy.c
clang: error: no such file or directory: 'HAVE_CONFIG_H'
clang: error: no such file or directory: 'PKGDATADIR="/usr/local/share/oligoarrayaux/"'