Skip to content

Commit

Permalink
configure: explicitly check that OpenGL version is sufficient
Browse files Browse the repository at this point in the history
Also provide more useful error message, with a link to the wiki entry on
OpenGL and remote display. Fixes #218.
  • Loading branch information
jdtournier committed Apr 15, 2015
1 parent 9dba40d commit 6595a4b
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions configure
Expand Up @@ -345,6 +345,15 @@ def compile (source, compiler_flags = [], linker_flags = []):
return ret[1]


def compare_version (needed, observed):
needed = [ float(n) for n in needed.split()[0].split('.') ]
observed = [ float(n) for n in observed.split()[0].split('.') ]
for n in zip (needed, observed):
if n[0] > n[1]:
return False
return True





Expand Down Expand Up @@ -1003,19 +1012,34 @@ int main (int argc, char *argv[]) {
}
''', cpp_flags + qt_cflags, ld_flags + qt_ldflags)
report (gl_test.strip() + '\n')
if 'NOT SUPPORTED' in gl_test:
if not compare_version ('3.3', gl_test):
raise RuntimeError
except:
try:
gl_test
report ('''
WARNING: not all required OpenGL extensions are supported (see above).
Some of the graphical user interface components may not be stable on
this system.
WARNING: your OpenGL implementation does not support version 3.3.
''')
except:
report ('''not found
except:
report ('''not found
WARNING: no OpenGL implementation found.
Some of the graphical user interface components may not be stable on
this system.
''')

report ('''
You will still be able to build MRtrix3, but you will NOT be
able to run the graphical user interface components in this
environment.
For more information, please refer to:
https://github.com/jdtournier/mrtrix3/wiki/troubleshooting-on-Linux#opengl-version-33-not-supported
If you are running within a remote X11 forwarding environment, please
refer to: https://github.com/jdtournier/mrtrix3/wiki/Remote-display
''')



if system == "darwin":
if '-Wall' in qt_cflags: qt_cflags.remove ('-Wall')
if '-W' in qt_cflags: qt_cflags.remove ('-W')
Expand Down

0 comments on commit 6595a4b

Please sign in to comment.