- Thank you received: 108
Apple Silicon
4 years 1 week ago #3317
by joachim
Apple Silicon was created by joachim
Please let us know if someone is going to get an Apple computer with the new CPU, and likes to build and test NGSolve on it.
Joachim
Joachim
4 years 22 hours ago - 4 years 18 hours ago #3377
by alex.v
Replied by alex.v on topic Apple Silicon
Hi Joachim,
I recently got one of the new computers and I'll take a stab at this. I'll follow along with the instructions here .
I will post back with updates.
Alex
EDIT 2:
Python was support was not a core requirement right now, I wanted it to compile so I turned it off with
to focus on just the c++ version.
the cmake command now works without crashing. The same can't me said about make:
I don't know what to replace '-march=native' with.
EDIT 1:
Having problems with the "cmake $NGROOT/ngsolve-src"
The python headers (PythonLibs) are usually handled by installing python through Homebrew (mac's 3rd party package manager), but Homebrew is not yet available been updated to the new architecture ( and it might take a while ).
I am going to see how homebrew usually installs those headers and see if I can do it manually.
That, or if anyone has ideas I am open to them.
I recently got one of the new computers and I'll take a stab at this. I'll follow along with the instructions here .
I will post back with updates.
Alex
EDIT 2:
Python was support was not a core requirement right now, I wanted it to compile so I turned it off with
Code:
cmake -DUSE_PYTHON=OFF $NGROOT/ngsolve-src
the cmake command now works without crashing. The same can't me said about make:
Code:
-- Found Git: /usr/bin/git (found version "2.24.3 (Apple Git-128)")
[ 0%] Built target ng_generate_version_file
[ 1%] Building CXX object libsrc/core/CMakeFiles/ngcore.dir/archive.cpp.o
clang: error: the clang compiler does not support '-march=native'
make[8]: *** [libsrc/core/CMakeFiles/ngcore.dir/archive.cpp.o] Error 1
make[7]: *** [libsrc/core/CMakeFiles/ngcore.dir/all] Error 2
make[6]: *** [all] Error 2
make[5]: *** [dependencies/src/netgen-stamp/netgen-build] Error 2
make[4]: *** [CMakeFiles/netgen.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [dependencies/Stamp/netgen_project/netgen_project-build] Error 2
make[1]: *** [CMakeFiles/netgen_project.dir/all] Error 2
make: *** [all] Error 2
I don't know what to replace '-march=native' with.
EDIT 1:
Having problems with the "cmake $NGROOT/ngsolve-src"
Code:
CMake Error at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "3")
Call Stack (most recent call first):
/usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.19/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/SuperBuild.cmake:54 (find_package)
CMakeLists.txt:73 (include)
The python headers (PythonLibs) are usually handled by installing python through Homebrew (mac's 3rd party package manager), but Homebrew is not yet available been updated to the new architecture ( and it might take a while ).
I am going to see how homebrew usually installs those headers and see if I can do it manually.
That, or if anyone has ideas I am open to them.
Last edit: 4 years 18 hours ago by alex.v.
4 years 15 hours ago #3378
by joachim
Replied by joachim on topic Apple Silicon
Hi Alex,
thank you very much for testing.
Can you install Python (I would try version 3.9 first) natively from python.org ?
To avoid the '-march=native' problem, you can call cmake with
-DUSE_NATIVE_ARCH=OFF
(or just remove it from CMakeLists.txt).
Joachim
thank you very much for testing.
Can you install Python (I would try version 3.9 first) natively from python.org ?
To avoid the '-march=native' problem, you can call cmake with
-DUSE_NATIVE_ARCH=OFF
(or just remove it from CMakeLists.txt).
Joachim
4 years 8 hours ago #3380
by alex.v
Replied by alex.v on topic Apple Silicon
Hi Joachim,
I tried just c++ again with that flag since it would be quick. It threw out a large number of errors and then stopped compiling. I have attached the output for the cmake and make commands.
I will try installing python and see if I can get that part running.
Alex
I tried just c++ again with that flag since it would be quick. It threw out a large number of errors and then stopped compiling. I have attached the output for the cmake and make commands.
I will try installing python and see if I can get that part running.
Alex
Attachments:
4 years 7 hours ago #3381
by joachim
Replied by joachim on topic Apple Silicon
can you replace the files in netgen/libsrc/core by these two files and try again:
1. replace rdtsc intrinsic by __builtin_readcyclecounter()
2. remove _mm_pause (not necessary, only optimization)
I found it from here:
stackoverflow.com/questions/44349757/rdtsc-equivalent-for-ios
Joachim
1. replace rdtsc intrinsic by __builtin_readcyclecounter()
2. remove _mm_pause (not necessary, only optimization)
I found it from here:
stackoverflow.com/questions/44349757/rdtsc-equivalent-for-ios
Joachim
Attachments:
3 years 11 months ago #3436
by matthiash
Replied by matthiash on topic Apple Silicon
The latest git version is now supporting the Apple M1 device!
NGSolve can be compiled with the following steps:
- Install Python Installer (note that this is thew new "universal2" installer, opposed to the "intel" one)
- Install CMake Installer (same as above, a new universal installer)
- Install Xcode command line tools:
Run the following code to download/build/install NGSolve
Currently the linker issues a lot of warnings about different visibilities, we are about to fix this.
As usual, set some environment variables to use NGSolve from the command line. Put these lines in the .bash_profile file in your home directory:
Any feedback is welcome
Best,
Matthias
NGSolve can be compiled with the following steps:
- Install Python Installer (note that this is thew new "universal2" installer, opposed to the "intel" one)
- Install CMake Installer (same as above, a new universal installer)
- Install Xcode command line tools:
Code:
sudo xcode-select --install
Run the following code to download/build/install NGSolve
Code:
git clone https://github.com/ngsolve/ngsolve.git
cd ngsolve
git submodule update --init --recursive
mkdir build
cd build
/Applications/CMake.app/Contents/bin/cmake ..
make -j5 install
Currently the linker issues a lot of warnings about different visibilities, we are about to fix this.
As usual, set some environment variables to use NGSolve from the command line. Put these lines in the .bash_profile file in your home directory:
Code:
export PATH=/Applications/Netgen.app/Contents/MacOS:$PATH
export PYTHONPATH=/Applications/Netgen.app/Contents/Resources/lib/python3.9/site-packages:$PYTHONPATH
Any feedback is welcome
Best,
Matthias
Time to create page: 0.109 seconds