-
Notifications
You must be signed in to change notification settings - Fork 74
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
OpenEMS fails to build on Mac OS 14.1.2 #190
Comments
This issue appears to be related to #108, but the thread concludes the issue was fixed. @biergaizi @aWZHY0yQH81uOYvH - Any chance this is similar or identical issue? |
@arkorobotics I believe this is a different problem. Could you provide your full I ran into macOS build problems recently and a PR that should fix it is waiting here: thliebig/openEMS#137 |
Sure thing! Here's the Unrelated Side Quest Below...As an aside, I tried pulling the latest master for OpenEMS-Project and building from source using the following steps:
I added the line from the PR you mentioned to ...but then got an HDF5 dependency error asking for version 1.8, which appears to be deprecated, so I changed HDF5 requirements in Doing so seems to have fixed the HDF5 error, but now I'm gettin new error about QT6
Not sure if this is useful or if you have seen this before, but I'm trying a different build/install avenue in the meantime. |
Your log file does contain some issues related to the Boost thread library, which is what my PR should fix. (For some reason the default C++ stdlib version clang is compiling with is very old??) There are also some issues related to openEMS itself, but hopefully that's just a result of the previous errors...
Homebrew adds lots of magic arguments to the CMake line, so it may fix those other errors you ran into when compiling manually. (e.g. Qt6 is a dependency in Homebrew, but may not be symlinked to a place where CMake can find it by default) |
Ah good to know! Hopefully the PR resolves these issues. Also, I got the manual build to work after making two more modifications:
I'm not sure if it's my machine's configuration or not, but do you think it's worth adding qt6 to the Mac Install Requirements Wiki Page and updating all |
Yeah, that wiki page should probably be updated. It's a dependency for the UI elements, not the core openEMS program itself (but this repo builds everything). The dependencies Homebrew is using are listed here. Also not really sure why there's an explicit version of HDF5 specified in the |
For those who'd like to build openEMS-Project for macOS 14.1.2 as of 3/9/2024, here's what worked for me:
... and any remaining install instructions here: https://docs.openems.de/install/clone-build-install.html#build-and-install |
Should I create a PR with the version requirement removed? |
Are you sure that HDF5 change is needed? That actually should be the minimum required version, according to this CMake output:
Builds fine on my system with HDF5 1.14.3 plus the change from my PR. |
|
Fair point! Not sure why I got build errors before, and now I'm regretting having not kept the log files. |
Maybe it wasn't symlinked, or just couldn't find it, similar to Qt6? |
Looks like almost everything installed correctly except the python interface. One remaining issue now is that I can't get any of the Tutorials to run. For example:
I originally tried the
Any ideas what the issue might be? I feel I'm close to getting this all to work! |
Your first attempt there appears to have tried to install it into the macOS-supplied python, which didn't end well (some parts didn't install or there's some path issue). I would try to remove what it installed so it doesn't cause any further problems. You second attempt looks pretty close, and appears you just need Cython, which you should be able to get through Homebrew. I'd recommend trying to install in a virtual environment. Homebrew's Python gets overwritten when it's upgraded, as does the system Python IIRC. You also need root to install to system Python. I also have a draft PR here that installs the Python bindings with Homebrew. I believe it worked last time I tried, but it's still a draft since I don't know the best way to depend on Python packages in Homebrew. |
This is turning into a doozy. I tried what you suggested with creating a virtual environment. After sourcing it and installing the requirements, I again tried
So I tried to CSXCAD manually using I thought I was home free, but after running
I'm starting to run out of ideas as why I'm struggling to build and run this. Could this be an arm arch issue? |
I just set up another branch in my forks of these repos with the two patches I've mentioned combined, and now my brew formula that installed the python bindings no longer works... It's getting rather exhausting trying to keep this working since someone somewhere changes something that breaks the whole build process for an otherwise straightforward C++ project every couple months. Anyways... maybe try this? Assuming you've installed openEMS through Brew at this point, perhaps it can't find the libraries.
|
Now we're cooking with fire! Although the command above did not work exactly as expected (result showed it could not find the lib), it lead me to go hunting for it. After some digging I realized I had installed it in
Seems like a good step forward. At least the "debug whac-a-mole" game has finally come to an end, and I can start mess with the tool. Honestly, I commend you and the team for your efforts. I can only imagine how difficult it must be keeping up with this ever changing dependency codebase and build environment. OpenEMS is a powerful tool and folks like you, who take the time out of their day, to help folks install and use it are the champion of champions. Thank you! |
Cool, glad I could be of some help! I'm only really flagged as a contributor because I've been doing this same kind of thing, fixing random weird build issues, primarily on macOS because Brew always uses the latest libraries. I've hardly even interacted with the actual main authors of this project. Honestly Homebrew doesn't seem to play well with Python packages for some reason, so it's probably best to do what you did + install the main tool from Homebrew once that's fixed. |
For reference, as of
May need some other Python dependencies, but should be obvious based on the errors. When the changes get merged, uninstalling my fork and changing back to the official |
FWIW - I tried your command list and still needed |
I bet it's because you're on ARM and Homebrew doesn't install in Also could be a matter of whether you're invoking the |
Also if you still need |
If you would like, I think I fixed the Brew formula that should automatically install the Python bindings. Works on my Intel Mac and an M1 machine. It's on the Uninstall old openEMS and remove official tap if you haven't already
Tap my fork and check out the
Try Python bindings, this time without any manual installation or virtual environments
(assuming the first If this works, I'll update my PR (#169) and hopefully that can get merged. |
Having been using openEMS for several months, I tried re-installing it on my Mac, using OSX14.4, with similar results to you. My workaround for this was to do - which gets things compiling, but not installing. I have attached the log file, as I'm not sure where to go from here. I will try the manual install process outlined above, hopefully it will work. Before I broke things openEMS was working really well - I was able to compare results of a planar transformer with the same design in Keysight Momentum, and the inductance differences were in the order 0.2%, and k was better than that. |
@valgamaa I'm not sure why messing with the hdf5 version affects anything. Those errors you were running into with the Homebrew install are related to the Boost Thread library, which should be fixed by this PR: thliebig/openEMS#137 My testing branch I mentioned above includes that fix, as well as a new method for installing the Python bindings. It compiles and installs fine for me with the default hdf5 (1.14.3) that is referenced by the current Brew formula, but perhaps you mean it doesn't work when trying to use certain features of openEMS? I have found that installing on Mac using methods outside the recommended Homebrew formula can be particularly temperamental. |
This is the log file after changing the hdf5 version. Before, I just got the error referenced in the link I posted, and didn't get any further.
I'm trying that now, looking good so far (but it hasn't completed yet).
Yes, I try to stick with 'vanilla' Homebrew as I'm not very knowledgeable about all of this. |
@aWZHY0yQH81uOYvH I can confirm that your branch works with OSX 14.4. I'm going to revert the links to hdf5 now before I forget.. Thanks for your efforts, I wouldn't have been able to solve the boost problem myself. |
Nice! Also don't forget to un-tap my branch and switch back to the official one once those PRs get merged eventually. |
I'm running into build issues while installing OpenEMS using the Installing Ready-Made Packages for macOS.
Has anyone seen the following build error?
Machine: MacBook Pro M3 Max
macOS: Sonoma 14.1.2
Build error occurs while running
brew install --HEAD openems
:The text was updated successfully, but these errors were encountered: