jorgensd / dolfinx_mpc

Extension for dolfinx to handle multi-point constraints.
https://jorgensd.github.io/dolfinx_mpc/
MIT License
30 stars 12 forks source link

Error with Compiling on Mac M1 #88

Open jorgenin opened 10 months ago

jorgenin commented 10 months ago

Hi I'm trying to compile MPC for a Mac M1 with dolfinx 0.7.0. It seems like I'm getting a few issues with the compilation.

The first issue is the following:

Screenshot 2023-10-30 at 11 02 31 PM

I changed then the import headers from:

Screenshot 2023-10-30 at 11 00 28 PM

To:

Screenshot 2023-10-30 at 11 03 24 PM

But then I get a new issue:

Screenshot 2023-10-30 at 11 04 24 PM

I'm thinking that because of the above issues I'm just having a problem with the exact imports / files I have. I was wondering if there were any suggestions on how to fix this.

Best, Jorge

jorgensd commented 10 months ago

How did you install dolfinx?

jorgenin commented 10 months ago

I installed it by compiling from source. I'm using the 0.7.0 post 0

jorgensd commented 10 months ago

I installed it by compiling from source. I'm using the 0.7.0 post 0

Could you add your exact commands for building dolfinx here, then I will see if I can recreate it (i dont have a Mac, so a bit tricky to test).

jorgenin commented 10 months ago

Thanks a lot for the help:

so right now I'm doing: cmake -DCMAKE_INSTALL_PREFIX=/usr/local/dolfinx_real ../ then: make then: make install

Lastly I pip install the dolfinx python into

/usr/local/dolfinx_real/lib/python3.11/dist-packages

jorgenin commented 10 months ago

I then add that directory to the Python path (when I'm using dolfinx) so far it's worked out great. I can run dolfinx and haven't had any issues with it. I also wanted to clarify. I'm not having issues with the initial library compile of MPC:

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build-dir cpp/ ninja -j3 install -C build-dir

These two commands seem to work fine and install.

It's just the final command :

python3 -m pip install python/. --upgrade

Which breaks things. I've tried just running cmake --build in the python folder to try to debug it but it still has similar issues.

tbrandvik commented 9 months ago

Did you ever manage to fix this problem? I'm getting the same error at the moment when compiling for Apple.

jorgenin commented 9 months ago

No sadly I have not fixed it. I've been working on linux recently so I haven't needed to fix it but if anyone has I would love to hear how to.

jorgensd commented 9 months ago

As far as Im aware, the conda build of 0.6.0 works ln M1