-
Notifications
You must be signed in to change notification settings - Fork 13
/
OpenGL-2020-GCCcore-9.3.0.eb
225 lines (208 loc) · 8.7 KB
/
OpenGL-2020-GCCcore-9.3.0.eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# This file is part of JSC's public easybuild repository (https://github.com/easybuilders/jsc)
easyblock = 'Bundle'
name = 'OpenGL'
version = '2020'
homepage = 'http://www.opengl.org/'
description = """
Open Graphics Library (OpenGL) is a cross-language, cross-platform application programming interface (API) for rendering
2D and 3D vector graphics. Mesa is an open-source implementation of the OpenGL specification - a system for rendering
interactive 3D graphics. NVIDIA supports OpenGL and a complete set of OpenGL extensions, designed to give a maximum
performance on NVIDIA GPUs.
This is a GL vendor neutral dispatch (GLVND) installation with Mesa and NVIDIA in the same lib-directory. Mesa or NVIDIA
OpenGL is set individually for each XScreen.
"""
toolchain = {'name': 'GCCcore', 'version': '9.3.0'}
# swr detects and builds parts specific for AVX and AVX2. If we use
# -xHost, this always gets overwritten and will fail.
toolchainopts = {'optarch': False}
builddependencies = [
('Python', '3.8.5'),
('binutils', '2.34'),
('flex', '2.6.4'),
('Bison', '3.6.4'),
('Autotools', '20200321'),
('pkg-config', '0.29.2'),
('expat', '2.2.9'),
('libxml2', '2.9.10'),
('Meson', '0.55.0', '-Python-%(pyver)s'),
('Ninja', '1.10.0'),
('CMake', '3.18.0'),
]
dependencies = [
('zlib', '1.2.11'),
('nettle', '3.6'),
('libdrm', '2.4.99'),
('LLVM', '10.0.1'),
('X11', '20200222'),
('libunwind', '1.4.0'),
('nvidia-driver', 'default', '', SYSTEM),
]
default_easyblock = 'ConfigureMake'
default_component_specs = {
'sources': [SOURCE_TAR_GZ],
'start_dir': '%(name)s-%(version)s',
}
local_pkg_config = ('export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:%(installdir)s/lib/pkgconfig && '
'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:%(installdir)s/lib64/pkgconfig && ')
components = [
# A vendor neutral dispatch layer
('libglvnd', '1.3.2', {
'source_urls': [
'https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v%(version)s/'
],
'sources': ['%(name)s-v%(version)s.tar.gz'],
'start_dir': '%(name)s-v%(version)s',
'checksums': ['6332c27f4c792b09a3eb1d7ae18c2d6ff6a0acaf3a746489caf859e659fca2f7'],
'preconfigopts': './autogen.sh && '
}),
# Mesa for software rendering, not hardware rendering.
('Mesa', '20.1.4', {
# We build:
# - llvmpipe: the high-performance Gallium LLVM driver (only possible with glx=gallium-xlib)
# - swr: Intel's OpenSWR
'easyblock': 'MesonNinja',
'source_urls': [
'https://mesa.freedesktop.org/archive/',
'https://mesa.freedesktop.org/archive/%(version)s',
'ftp://ftp.freedesktop.org/pub/mesa/%(version)s',
'ftp://ftp.freedesktop.org/pub/mesa/older-versions/%(version_major)s.x/%(version)s',
'ftp://ftp.freedesktop.org/pub/mesa/older-versions/%(version_major)s.x',
],
'sources': [SOURCELOWER_TAR_XZ],
'checksums': [
'6800271c2be2a0447510eb4e9b67edd9521859a4d565310617c4b359eb6799fe',
],
'start_dir': '%(namelower)s-%(version)s',
'separate_build_dir': True,
'preconfigopts': local_pkg_config,
'configopts': (' -D libdir=%(installdir)s/lib'
' -D gbm=true'
' -D glx=auto'
' -D osmesa=gallium'
' -D llvm=true'
' -D shared-llvm=true'
' -D dri-drivers=""'
' -D gallium-drivers="swr,swrast"'
' -D swr-arches=avx,avx2,skx,knl'
' -D vulkan-drivers=""'
' -D platforms=x11,drm,surfaceless'
' -D glvnd=true'
' -D libunwind=true'
' -D egl=true'
' -D gles1=true -Dgles2=true'
' -D shared-glapi=true'
' -D gallium-omx=disabled'
' -D gallium-media=omx,va,vdpau,xvmc'
' -D buildtype=release'),
}),
# OpenGL Utility Library - offers higher level GL-graphics functions
('glu', '9.0.1', {
'preconfigopts': local_pkg_config,
'source_urls': [
'ftp://ftp.freedesktop.org/pub/mesa/glu/'
],
'sources': [
'glu-%(version)s.tar.gz'
],
'checksums': [
'f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7',
],
}),
# OpenGL Extension Wrangler Library - determines which OpenGL extensions are supported at run-time
# This is just GLEW for GLX (which requires DISPLAY to be set) and not GLEW for EGL as GLEW selects GLX/EGL at
# compile-time and not run-time (https://github.com/nigels-com/glew/issues/172#issuecomment-357400019)
# Compile+Load GLEW-EGL on top to enable GLEW for EGL
('glew', '2.2.0', {
'source_urls': [
'https://sourceforge.net/projects/glew/files/glew/snapshots/',
],
'sources': [
'glew-20200115.tgz',
],
'checksums': [
'314219ba1db50d49b99705e8eb00e83b230ee7e2135289a00b5b570e4a4db43a',
],
'skipsteps': ['configure'],
'buildopts': ('GLEW_PREFIX=%(installdir)s GLEW_DEST=%(installdir)s LIBDIR=%(installdir)s/lib '
'LDFLAGS.EXTRA="-L${EBROOTX11}/lib/ -lX11" LDFLAGS.GL="-L%(installdir)s/lib -lGL"'),
'installopts': 'GLEW_PREFIX=%(installdir)s GLEW_DEST=%(installdir)s LIBDIR=%(installdir)s/lib ',
'install_cmd': 'make install.all ',
}),
# MESA demos - offers the important command 'eglinfo'
('demos', '95c1a57cfdd1ef2852c828cba4659a72575c5c5d', {
'source_urls': [
'https://gitlab.freedesktop.org/mesa/demos/-/archive/%(version)s/',
],
'sources': [SOURCELOWER_TAR_GZ],
'checksums': [
'7738beca8f6f6981ba04c8a22fde24d69d6b2aaab1758ac695c9475bf704249c',
],
'preconfigopts': ('./autogen.sh && ' +
local_pkg_config +
'GLEW_CFLAGS="-I%(installdir)s/include/" GLEW_LIBS="-L%(installdir)s/lib/ -lGLEW -lGL" '
'EGL_CFLAGS="-I%(installdir)s/include/" EGL_LIBS="-L%(installdir)s/lib/ -lEGL" '),
'configopts': '--disable-osmesa ',
}),
]
postinstallcmds = [
'cd %(installdir)s/lib && ln -sf libGL.so.1.7.0 libGL.so.1',
'rm %(installdir)s/lib/*.la',
'cd %(installdir)s/lib && ln -sf ${EBROOTNVIDIA}/lib64/libEGL_nvidia.so.0 .',
'cd %(installdir)s/lib && ln -sf ${EBROOTNVIDIA}/lib64/libGLX_nvidia.so.0 .',
'cd %(installdir)s/lib && ln -sf libGLX_mesa.so.0 libGLX_indirect.so.0',
'cd %(installdir)s/lib && ln -sf ${EBROOTNVIDIA}/lib64/libGLESv1_CM_nvidia.so.1 .',
'cd %(installdir)s/lib && ln -sf ${EBROOTNVIDIA}/lib64/libGLESv2_nvidia.so.2 .',
# EGL vendor ICDs
(
'{ cat > %(installdir)s/share/glvnd/egl_vendor.d/10_nvidia.json; } << \'EOF\'\n'
'{\n'
' \"file_format_version\" : \"1.0.0\",\n'
' \"ICD\" : {\n'
' \"library_path\" : \"libEGL_nvidia.so.0\"\n'
' }\n'
'}\n'
'EOF'
),
(
'{ cat > %(installdir)s/share/glvnd/egl_vendor.d/50_mesa.json; } << \'EOF\'\n'
'{\n'
' \"file_format_version\" : \"1.0.0\",\n'
' \"ICD\" : {\n'
' \"library_path\" : \"libEGL_mesa.so.0\"\n'
' }\n'
'}\n'
'EOF'
),
# correct pkg-config of GLEW
'sed -i "/^libdir=/c\libdir=\${exec_prefix}\/lib" %(installdir)s/lib/pkgconfig/glew.pc',
'sed -i "/^prefix=/c\prefix=%(installdir)s" %(installdir)s/lib/pkgconfig/glew.pc',
]
modextravars = {
'__EGL_VENDOR_LIBRARY_FILENAMES': ('%(installdir)s/share/glvnd/egl_vendor.d/10_nvidia.json:'
'%(installdir)s/share/glvnd/egl_vendor.d/50_mesa.json'),
'EGL_PLATFORM': 'surfaceless',
'EGL_DRIVER': 'swr',
'EGL_LOG_LEVEL': 'fatal',
'GALLIUM_DRIVER': 'swr',
'KNOB_MAX_WORKER_THREADS': '65535',
}
modluafooter = '''
add_property("arch","gpu")
conflict("Mesa")
conflict("libGLU")
'''
sanity_check_paths = {
'files': [
'lib/libEGL_mesa.%s' % SHLIB_EXT, 'lib/libOSMesa.%s' % SHLIB_EXT,
'lib/libGLESv1_CM.%s' % SHLIB_EXT, 'lib/libGLESv2.%s' % SHLIB_EXT,
'include/GL/glext.h', 'include/GL/glx.h',
'include/GL/osmesa.h', 'include/GL/gl.h', 'include/GL/glxext.h',
'include/GLES/gl.h', 'include/GLES2/gl2.h', 'include/GLES3/gl3.h',
'lib/libOpenGL.%s' % SHLIB_EXT,
'lib/libGLEW.a', 'lib/libGLEW.%s' % SHLIB_EXT,
'bin/glewinfo', 'bin/visualinfo',
'include/GL/glew.h', 'include/GL/glxew.h', 'include/GL/wglew.h',
],
'dirs': []
}
moduleclass = 'vis'