You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just encountered some issues while compiling ADMIXTOOLS on a freshly unpacked M1 MacBook Pro running macOS Monterey Version 12.3.1 (openblas and gsl installed from Homebrew). The problem manifests both on the latest development commit of ADMIXTOOLS from GitHub as well as on the latest tagged v7.0.2 release.
Description of the problem # 1
The usual combination of cd src/ && make clobber && make install leads to:
[ ... snip ... ]
clang: warning: argument unused during compilation: '-p' [-Wunused-command-line-argument]
admutils.c:459:9: error: implicitly declaring library function 'finite' with type 'int (double)' [-Werror,-Wimplicit-function-declaration]
if (!finite(a[i])) fatalx("(testnan) fails: index %d\n",i) ;
^
admutils.c:459:9: note: include the header <math.h> or explicitly provide a declaration for 'finite'
admutils.c:885:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
admutils.c:1114:28: warning: more '%' conversions than data arguments [-Wformat-insufficient-args]
printf("(setid2pops): %s not found\n") ;
~^
2 warnings and 1 error generated.
make: *** [admutils.o] Error 1
Solution to the problem # 1
I found out that the latest macOS compiler infrastructure provided by Xcode no longer considers implicit function declarations as warnings (as seems to have been the case at least prior to the latext Xcode v13) but it turns them into errors.
Adding -Wno-implicit-function-declaration to the CFLAGS list here so that it becomes:
This is really an emergency solution, but one that works without modifying the source code. Explicitly including #include <math.h> in appropriate places should be the way to go, but I have not tested that myself.
Maybe it's worth implementing it in the Makefile? Unlike the usual openblas or gsl compilation errors, which are easy even for non-C/C++ programmers to solve with a bits of googling, this one took me a bit to get around.
Description of the problem # 2
Also, for completeness, it seems that the location of Homebrew-installed libraries suggested in the Makefiles under src/ is different in the latest version of Homebrew and/or macOS Monterey, the paths suggested here no longer work. Because of this, even uncommenting the Mac-specific flags doesn't work, and the compiler complains about the missing GSL.
Obviously this will depend on the version of Homebrew and possibly also macOS so I'm not sure if it's worth modifying the Makefile (maybe it is, because this is the current status of things in the Homebrew world). However, I think the issue #1 with implicit function declarations is backwards compatible as well as necessary in latest Xcode, so it would be great to have it implemented in future versions.
With both of these fixes in place, I was able to compile ADMIXTOOLS on the latest M1 MBP macOS without further problems, using the default Makefile.
Hope this helps (even if only for people googling for similar errors, in ADMIXTOOLS or elsewhere).
--Martin
The text was updated successfully, but these errors were encountered:
On a less important note, I have also noticed that the testing Perl script mklog has a hardcoded path to the Perl interpreter. I would suggest changing this to #!/usr/bin/env perl -w which should make it much more platform independent. (At least on my Macs, the default built-in Perl interpreter binary is in a different location to the one given in the mklog hashbang line).
Hi, I'm trying to install admixtools on Mac but I keep getting an error when I run make install. I added the flags so the linker can find the definitions for gsl and openblas but when I tried to do brew install argp it says
Warning: No available formula with the name "argp". Did you mean argo or argc?
I installed argp-standalone and added the flag for /include and /lib but I keep getting the following error message:
Undefined symbols for architecture x86_64:
"_argp_parse", referenced from:
_main in transpose.o
"_argp_usage", referenced from:
_parse_opt in transpose.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [transpose] Error 1
I then installed argparse and I noticed the /lib directory only has two directories inside (/cmake and /pkgconfig) and there is no file with .a extension. Not sure if I need that file but the other program have those files. Any idea how to fix this error?
Thanks!
UPDATE: I FIGURED OUT THE PROBLEM!!!!!!
I just needed to add the -largp flag to the Makefile in the first line (shown below)
Background
I just encountered some issues while compiling ADMIXTOOLS on a freshly unpacked M1 MacBook Pro running macOS Monterey Version 12.3.1 (openblas and gsl installed from Homebrew). The problem manifests both on the latest development commit of ADMIXTOOLS from GitHub as well as on the latest tagged
v7.0.2
release.Description of the problem # 1
The usual combination of
cd src/ && make clobber && make install
leads to:Solution to the problem # 1
I found out that the latest macOS compiler infrastructure provided by Xcode no longer considers implicit function declarations as warnings (as seems to have been the case at least prior to the latext Xcode v13) but it turns them into errors.
Adding
-Wno-implicit-function-declaration
to theCFLAGS
list here so that it becomes:Fixed this particular error.
This is really an emergency solution, but one that works without modifying the source code. Explicitly including
#include <math.h>
in appropriate places should be the way to go, but I have not tested that myself.Maybe it's worth implementing it in the
Makefile
? Unlike the usual openblas or gsl compilation errors, which are easy even for non-C/C++ programmers to solve with a bits of googling, this one took me a bit to get around.Description of the problem # 2
Also, for completeness, it seems that the location of Homebrew-installed libraries suggested in the Makefiles under
src/
is different in the latest version of Homebrew and/or macOS Monterey, the paths suggested here no longer work. Because of this, even uncommenting the Mac-specific flags doesn't work, and the compiler complains about the missing GSL.Solution to the problem # 2
I had to change these flags to these locations:
Obviously this will depend on the version of Homebrew and possibly also macOS so I'm not sure if it's worth modifying the Makefile (maybe it is, because this is the current status of things in the Homebrew world). However, I think the issue #1 with implicit function declarations is backwards compatible as well as necessary in latest Xcode, so it would be great to have it implemented in future versions.
With both of these fixes in place, I was able to compile ADMIXTOOLS on the latest M1 MBP macOS without further problems, using the default
Makefile
.Hope this helps (even if only for people googling for similar errors, in ADMIXTOOLS or elsewhere).
--Martin
The text was updated successfully, but these errors were encountered: