-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling on M1 Mac #58
Comments
Thanks for reporting this issue. I do not have an M1 Mac so I cannot replicate your problem. |
The GNAT version should work, as it can compile to x86_64 which is able to run on the newer macs. I will just try some more and post a solution here if I ever find one so that others may avoid this problem in the future. As a side note, have you ever considered publishing a pip package for phcpy or is that simply impossible with the current architecture? |
Hi contributors and future phcpy users with an M1 MacBook! I have managed to build and install everything that was needed and I can now import phcpy into a Python terminal. I am going to briefly explain the steps that I’ve taken to accomplish this, to hopefully save others time in the future. In addition, I think I’ve found some bugs in the project that should be resolved. Bugs
Note that I am completely open to these issues not actually being bugs but my own mistakes. I still listed them in the hopes of improving the library for everyone. Build and installation stepsI will now give a quick overview of the build and installation steps I took to install phcpy on my 2021 MacBook Pro with the M1 chip. I am running on macOS Monterey 12.1. First of all, it’s important to highlight that because these MacBooks work on a newer chip architecture, it is impossible to run everything natively. Apple has however foreseen this and written a really good emulator (Rosetta) that can run Intel apps. Therefore, throughout the build process you should compile everything for x86_64 and not arm64 or aarch64. Having a subset built for x86_64 and another section for arm64 will not work and give you headaches.
Good luck to everyone and thanks for creating this library. I'm hoping to put it to good use now! |
Thank you very much for reporting the bugs and the installation steps for the M1. |
Hi, I wanted to see what the latest is in installing phcpy on M1s. I am not versed in compiling anything from source, and working with an M1 makes everything more complicated. So far I have downloaded the executable macairM1_phcv24p.tar.gz from release v2.4.88, and I have it working just fine with Macaualy2. However, I want to integrate PHCpack in with python, so I need phcpy. From the documentation it looks like I need to compile from source to make the .dylib library. I cloned the repo, changed any "windows" reference in the config folder to "macosx" and tried 'alr build' on the repo. The library builds fine, and moving the .dylib into PHCpack/src/Python/PHCpy and running 'pip install .' technically also builds fine. However, when I import the phcpy library into python, it's clear that something went amiss as I get a warning that the library is not suitable for my architecture, and then errors when I try to solve anything. |
The libPHCpack.dylib has been made successfully to work on M1 mac, using alr 1.2.2, provided by Simon Wright, available at https://github.com/simonjwright The encapsulated library is not supported, commenting in phclib.gpr out the line for Library_Standalone use "encapsulated"; made libPHCpack work in phcpy on the M1. |
Hi,
First of all, I would like to stress that I'm very new at using C/C++/Ada/Fortran and have limited experience in actually building software. My main "expertise" is in Python. I've been toying around with the Python interface of the library on the online portal and wanted to install it locally for usage in my research. However, I have a new MacBook Pro which runs on the M1 processor and it appears as though the compilation process just will not work. The exact problem:
make phcpy2c3.so
ar ruv phcpy2c3.a *.o
The compiler error is that phcpy2c3.a is a FAT file and has two conflicting architectures in it. See below for a complete error message:
The problem is that some parts appear to be compiled to run natively on arm64, while others are compiled to x86_64.
Have you ever encountered this problem before and what can be done to resolve it? Also, if it helps, it also fails to compile
make hello
(with a different error) so I'm probably doing something very elementary wrong. The error when building hello is the following:The text was updated successfully, but these errors were encountered: