Opened 2 years ago
Closed 2 years ago
#65989 closed defect (fixed)
wannier90 @3.1.0_0+gcc12+openblas / @3.1.0_0+accelerate+gcc12: Compile using libwannier.a fails on Apple M1 macbook
Reported by: | 8rinG-Yrrej (Yang Ge) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.2 |
Keywords: | arm64 | Cc: | dstrubbe (David Strubbe) |
Port: | wannier90 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
wannier90 @3.1.0_0+gcc12+openblas / @3.1.0_0+accelerate+gcc12: Compile using libwannier.a fails on Apple M1 macbook
Compilations using the Wannier90 example program, under official distribution "test-suite/library-mode-test/test_library.F90", with "libwannier.a" installed by macport fails in different ways for the two variants reported. The executables "*.x" works fine. It seems that "make.inc" for wannier90 is not setup properly, because I can compile wannier90 myself with macport's gfortran-mp-12 and everything works fine. Below are more detailed symptoms for the two variants.
For @3.1.0_0+gcc12+openblas, the compilation succeeds, but at runtime the program segfaults. The compilation command is
gfortran-mp-12 test_library.F90 /opt/local/lib/libwannier.a -llapack -lblas -o test_library_serial.x
And the runtime error, occured upon calling "wannier_run" in the program, is
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
For @3.1.0_0+accelerate+gcc12, the compilation fails due to symbols not found for arm64. The compilation command is
gfortran-mp-12 test_library.F90 -ff2c /opt/local/lib/libwannier.a -framework Accelerate -o test_library_serial.x
The error is mostly
Undefined symbols for architecture arm64: __wannier_run__ ... __wannier_setup__
Thanks.
Change History (5)
comment:1 Changed 2 years ago by dstrubbe (David Strubbe)
comment:2 Changed 2 years ago by 8rinG-Yrrej (Yang Ge)
Thanks a lot! Changing LAPACK/BLAS to using openblas solves the problem with the 1st build line, so the problem I reported is not there. For the 2nd build line, the +accelerate variant, remove -ff2c and change "-framework Accelerate" to openblas solved my problem as well.
Thanks again for you help. There is no longer an issue for me. I am not sure how to close this ticket.
BTW, "port test" kind of passes for me in both cases. I have to add a symlink python->python3 in $PATH, and some of the test nominally fails, but it seems that there is some mistakes in the Wannier90 tests: relative error<10-6 was used for pass/fail predicate, as in (computed-benchmark)/benchmark. Those tests fail because benchmark=0, while computed values are ~10-10.
comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
comment:4 Changed 2 years ago by dstrubbe (David Strubbe)
Good, we can try to follow up with upstream about this issues in the test.
comment:5 Changed 2 years ago by dstrubbe (David Strubbe)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Hello, can you please start by verifying if the port itself works, via "port test"? Your problems may be related to incompatibilities of how you are trying to build outside of macports. For example, it looks like you may not be using openblas but other LAPACK/BLAS in "-llapack -lblas" in the first build line, and I am not sure why you are using "-ff2c" in the second build line.