Comments (6)
This build script for mfem works for Mac M1: https://github.com/conda-forge/mfem-feedstock/blob/main/recipe/build.sh
Have you run make config
when building mfem? It looks like it is trying to compile for x86 (see e.g. the warning for __builtin_ia32_paddd
)
from glvis.
Hi all,
I'm running MFEM
and GLVis
on my M1 for a year and I never had any issues. I've tried different commits of both software packages and it always worked fine. Both, MFEM
and GLVis
are in my home folder, e.g. ~/mfem
and ~/glvis
. I compile both packages with cmake, e.g.
cd ~/mfem
mkdir build
cd build
cmake ..
make -j8
and
cd ~/glvis
mkdir build
cd build
cmake ..
make -j8
Note that GLVis
requires a few external dependencies that can be installed via brew
. The following list might not be exhaustive, but I believe I had to install the following packages:
sdl2
glew
glm
libpng
fontconfig
But Cmake
should guide you through this process of installing missing dependencies (if there are any). This works on M1 without any problems. To run GLVis
, I execute
glvis/build/glvis
in my home folder. Executing an MFEM example such as ex16
should then be able to communicate with the running GLVis
server. E.g. try
cd ~/mfem/build/examples
make ex16
./ex16
Hope that helps, good luck!
from glvis.
Hi @supriome,
Unfortunately I don't have access to an M1 mac to try to reproduce this, but looking at the error this doesn't seem to be an issue inside GLVis.
I know other folks have gotten MFEM to work on M1 macs, see mfem/mfem#2273.
Does your MFEM build works, e.g. does "make test" work there?
from glvis.
ping: @matthiasdiener and @samuelpmishLLNL, in case you can help.
from glvis.
@supriome
I got the same error message, where MFEM would compile but glvis would not. Tried all of the solutions posted, as well as confirming homebrew and command line tools were up to date. The MFEM build was confirmed to be compiled for arm64. It seems to be a linking issue with clang via apple command line tools. The line where compilation fails on my M1 Mac is:
> g++ -O3 -std=c++11 -I../mfem-4.4 -DGLVIS_MULTISAMPLE=4 -DGLVIS_MS_LINEWIDTH=1.0 -DGLVIS_OGL3 -DGLVIS_USE_LOGO -I/opt/X11/include/freetype2 -I/usr/local/include -I/usr/local/include -I/opt/homebrew/include -DGLVIS_USE_LIBPNG -o lib/aux_vis.o -c lib/aux_vis.cpp
It seems that when using make or gmake, there is an issue with clang trying to compile with x86 for a few of the libraries, starting with libGL. Instead of compiling via llvm installed through homebrew, it tries to install with the apple command line version of clang. Here is the filepath for the first error thrown:
In file included from lib/gl/renderer.cpp:12:
In file included from lib/gl/renderer.hpp:20:
In file included from lib/gl/platform_gl.hpp:17:
In file included from /usr/local/include/SDL2/SDL.h:38:
In file included from /usr/local/include/SDL2/SDL_cpuinfo.h:102:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/immintrin.h:13:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/x86gprintrin.h:15:
I tried using:
> echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
which didn't fix the issue.
To fix this, I edited the makefile search path lines for glew, SDL2, gym, and OpenGL (lines 166, 172, 177, 178, and 182) to force compilation via llvm installed via homebrew:
166: GLEW_SEARCH_PATHS = $(BREW_PREFIX) $(abspath ../glew)
172: SDL_SEARCH_PATHS := $(BREW_PREFIX) $(abspath ../SDL2)
177: GLM_SEARCH_PATHS = \
178: $(if $(BREW_PREFIX), $(BREW_PREFIX)/include) $(abspath ../glm)
182: OPENGL_SEARCH_PATHS = $(BREW_PREFIX) /usr /usr/local /opt/local
Compiled MFEM with:
> gmake serial -j 4
Compiled with GLVIS with:
> gmake MFEM_DIR=../mfem-4.4 -j 4
This is probably just a quick and dirty way to fix it, but it worked for me. I have tested and verified functionality with the MFEM examples. Also I did not try with cmake, so that might work.
from glvis.
Thank you @congunter
from glvis.
Related Issues (20)
- Support variable order spaces HOT 7
- Optional build dependencies incomplete HOT 5
- Visualize actual domain boundary of parallel meshes HOT 4
- glvis and mingw(msys2) HOT 10
- glvis support for windows HOT 4
- Movies HOT 3
- CMake tries to install GLVis, although it build glvis HOT 4
- Significant increase in memory usage HOT 3
- build with intel fails HOT 14
- Update CI to test installation with both GNU make and CMake
- Failed to initialize SDL: No available video device HOT 4
- Scalar fields with MapType INTEGRAL do not display properly HOT 1
- make install is broken on 4.2? "not a member of mfem::Geometry" HOT 1
- Screenshot does not behaves reliably in glvs script HOT 2
- glvis over x2go connection to remote sever results in FATAL: window and/or OpenGL context creation failed. HOT 4
- Fail to display Hex mesh of GMSH format HOT 2
- Change colorbar number format HOT 4
- Wrong vertex ids with ncmesh HOT 3
- Space mouse support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glvis.