diff --git a/Golden_Repo/o/OpenGL/OpenGL-2022a-GCCcore-11.3.0.eb b/Golden_Repo/o/OpenGL/OpenGL-2022a-GCCcore-11.3.0.eb new file mode 100644 index 0000000000000000000000000000000000000000..110b96b086dbbc9316ba15371493acc7e8c98d07 --- /dev/null +++ b/Golden_Repo/o/OpenGL/OpenGL-2022a-GCCcore-11.3.0.eb @@ -0,0 +1,236 @@ +easyblock = 'Bundle' + +name = 'OpenGL' +version = '2022a' + +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': '11.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.10.4'), + ('binutils', '2.38'), + ('flex', '2.6.4'), + ('Bison', '3.8.2'), + ('Autotools', '20220317'), + ('pkgconf', '1.8.0'), + ('Mako', '1.2.0'), + ('expat', '2.4.8'), + ('libxml2', '2.9.13'), + ('Meson', '0.62.1'), + ('Ninja', '1.10.2'), + ('CMake', '3.23.1'), +] + +dependencies = [ + ('zlib', '1.2.12'), + ('nettle', '3.8'), + ('libdrm', '2.4.110'), + ('LLVM', '14.0.3'), + ('X11', '20220504'), + ('libunwind', '1.6.2'), + ('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.4.0', { + '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': ['33b8b993adf47a21bc1c46bcf970927edeb9884390d5b09b1aed051d600c0b2f'], + 'preconfigopts': './autogen.sh && ' + }), + # Mesa for software rendering, not hardware rendering. + ('Mesa', '22.0.3', { + # We build: + # - llvmpipe: the high-performance Gallium LLVM driver (only possible with glx=gallium-xlib) + # - swr: Intel's OpenSWR (was removed from 22.x) + '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': [ + '9f2b30f5276a9abaf71aafc6979685e2636189de1a87aea2c9e69744a6d0ebb9', + # o/OpenGL/ofnone-fix.patch + # '37d1c37fd3a8563b9dd78ecd361e5a39440310facd1ed656ca1e12f667b54d6b', + # o/OpenGL/swrllvm-fix.patch + # '8bc00dc99a88684fcf469115914269b716622ef33648cf80c8a80d05d38e9540', + ], + # 'patches': [ + # # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11568 + # 'ofnone-fix.patch', + # # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13267 + # 'swrllvm-fix.patch' + # ], + 'start_dir': '%(namelower)s-%(version)s', + 'separate_build_dir': True, + 'preconfigopts': local_pkg_config, + # https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/meson_options.txt + 'configopts': (' -D libdir=%(installdir)s/lib' + ' -D gbm=enabled' + ' -D glx=auto' + ' -D osmesa=true' + ' -D llvm=enabled' + ' -D shared-llvm=enabled' + ' -D dri-drivers=""' + ' -D vulkan-drivers="swrast"' + ' -D gallium-drivers="swrast"' + # ' -D swr-arches=avx,avx2,skx,knl' + ' -D platforms=x11' # surfaceless taken automatically, see logs + ' -D glvnd=true' + ' -D libunwind=disabled' + ' -D valgrind=disabled' + ' -D egl=enabled' + ' -D gles1=enabled -Dgles2=enabled' + ' -D shared-glapi=enabled' + ' -D gallium-vdpau=disabled' # only for r300, r600, radeonsi, nouveau + ' -D buildtype=release'), + }), + # OpenGL Utility Library - offers higher level GL-graphics functions + ('glu', '9.0.2', { + 'preconfigopts': local_pkg_config, + 'source_urls': [ + 'ftp://ftp.freedesktop.org/pub/mesa/glu/' + ], + 'sources': [ + 'glu-%(version)s.tar.gz' + ], + 'checksums': [ + '24effdfb952453cc00e275e1c82ca9787506aba0282145fff054498e60e19a65', + ], + }), + # 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 = { + # '__GLX_VENDOR_LIBRARY_NAME': 'mesa' or 'nvidia' + '__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'