Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime cxxmodules aarch64 #212

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builtins/glew/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target_compile_options(GLEW PRIVATE ${GLEW_DEFINITIONS})
target_include_directories(GLEW INTERFACE $<BUILD_INTERFACE:${GLEW_INCLUDE_DIR}>)
target_link_libraries(GLEW PRIVATE OpenGL::GL OpenGL::GLU)

add_library(GLEW::GLEW ALIAS GLEW)
target_link_libraries(GLEW::GLEW INTERFACE GLEW)

set(GLEW_LIBRARY $<TARGET_FILE:GLEW> CACHE INTERNAL "")
set(GLEW_LIBRARIES GLEW::GLEW CACHE INTERNAL "")
Expand Down
6 changes: 0 additions & 6 deletions cmake/modules/RootBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,6 @@ elseif(APPLE)
set(x11_defvalue OFF)
endif()

# Current limitations for modules:
#---Modules are disabled on aarch64 platform (due ODR violations)
if(CMAKE_SYSTEM_PROCESSOR MATCHES aarch64)
set(runtime_cxxmodules_defvalue OFF)
endif()

# builtin_openssl is only supported on macOS
if(builtin_openssl AND NOT APPLE)
message(FATAL_ERROR ">>> Option 'builtin_openssl' is only supported on macOS.")
Expand Down
19 changes: 13 additions & 6 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ if(cocoa)
if(APPLE)
set(x11 OFF CACHE BOOL "Disabled because cocoa requested (${x11_description})" FORCE)
set(builtin_freetype ON CACHE BOOL "Enabled because needed for Cocoa graphics (${builtin_freetype_description})" FORCE)
if(NOT opengl)
message(FATAL_ERROR "Option \"cocoa=ON\" requires \"opengl=ON\"!")
endif()
else()
message(STATUS "Cocoa option can only be enabled on MacOSX platform")
set(cocoa OFF CACHE BOOL "Disabled because only available on MacOSX (${cocoa_description})" FORCE)
Expand Down Expand Up @@ -607,7 +604,9 @@ endif()
find_package(Python3 3.8 COMPONENTS ${python_components})

#---Check for OpenGL installation-------------------------------------------------------
if(opengl)
# OpenGL is required by various graf3d features that are enabled with opengl=ON,
# or by the Cocoa-related code that always requires it.
if(opengl OR cocoa)
message(STATUS "Looking for OpenGL")
if(APPLE)
set(CMAKE_FIND_FRAMEWORK FIRST)
Expand Down Expand Up @@ -635,10 +634,17 @@ if(NOT WIN32 AND NOT APPLE)
set(opengl OFF CACHE BOOL "OpenGL requires x11" FORCE)
endif()
endif()
# The opengl flag enables the graf3d features that depend on OpenGL, and these
# features also depend on asimage. Therefore, the configuration will fail if
# asimage is off. See also: https://github.com/root-project/root/issues/16250
if(opengl AND NOT asimage)
message(FATAL_ERROR "OpenGL features enabled with \"opengl=ON\" require \"asimage=ON\"")
endif()

#---Check for GLEW -------------------------------------------------------------------
# Opengl is "must" requirement for Glew.
if(opengl AND NOT builtin_glew)
# Glew is required by various graf3d features that are enabled with opengl=ON,
# or by the Cocoa-related code that always requires it.
if((opengl OR cocoa) AND NOT builtin_glew)
message(STATUS "Looking for GLEW")
if(fail-on-missing)
find_package(GLEW REQUIRED)
Expand All @@ -665,6 +671,7 @@ endif()

if(builtin_glew)
list(APPEND ROOT_BUILTINS GLEW)
add_library(GLEW::GLEW INTERFACE IMPORTED GLOBAL)
add_subdirectory(builtins/glew)
endif()

Expand Down
11 changes: 2 additions & 9 deletions graf2d/cocoa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(GCocoa
"-framework Cocoa"
"-framework OpenGL"
${FREETYPE_LIBRARIES}
RGlew
GLEW::GLEW
)

target_include_directories(GCocoa PRIVATE ${CMAKE_SOURCE_DIR}/graf3d/gl/inc)
Expand All @@ -48,11 +48,4 @@ target_include_directories(GCocoa PRIVATE ${CMAKE_SOURCE_DIR}/graf3d/gl/inc)
target_compile_options(GCocoa PRIVATE -ObjC++ -Wno-deprecated-declarations)
target_include_directories(GCocoa PRIVATE ${FREETYPE_INCLUDE_DIRS})

if(opengl) # special case when cocoa is enabled but not opengl (i.e. gminimal=ON)
target_include_directories(GCocoa PRIVATE ${OPENGL_INCLUDE_DIR})
else()
target_include_directories(GCocoa PRIVATE
${CMAKE_SOURCE_DIR}/graf3d/gl/inc
)
endif(opengl)

target_include_directories(GCocoa PRIVATE ${OPENGL_INCLUDE_DIR})
6 changes: 1 addition & 5 deletions graf2d/cocoa/src/TGCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@

#include "TGCocoa.h"

// We want to pickup ROOT's glew and not the system OpenGL coming from:
// ROOTOpenGLView.h ->QuartzWindow.h->Cocoa.h
// Allowing TU's which include the system GL and then glew (from TGLIncludes)
// leads to gltypes.h redefinition errors.
#include "TGLIncludes.h"
#include <GL/glew.h>

#include "ROOTOpenGLView.h"
#include "CocoaConstants.h"
Expand Down
56 changes: 33 additions & 23 deletions js/build/jsroot.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const version_id = 'dev',

/** @summary version date
* @desc Release date in format day/month/year like '14/04/2022' */
version_date = '2/10/2024',
version_date = '8/10/2024',

/** @summary version id and date
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
Expand Down Expand Up @@ -9790,13 +9790,13 @@ function approximateLabelWidth(label, font, fsize) {
/** @summary array defines features supported by latex parser, used by both old and new parsers
* @private */
const latex_features = [
{ name: '#it{' }, // italic
{ name: '#bf{' }, // bold
{ name: '#it{', bi: 'italic' }, // italic
{ name: '#bf{', bi: 'bold' }, // bold
{ name: '#underline{', deco: 'underline' }, // underline
{ name: '#overline{', deco: 'overline' }, // overline
{ name: '#strike{', deco: 'line-through' }, // line through
{ name: '#kern[', arg: 'float' }, // horizontal shift
{ name: '#lower[', arg: 'float' }, // vertical shift
{ name: '#kern[', arg: 'float', shift: 'x' }, // horizontal shift
{ name: '#lower[', arg: 'float', shift: 'y' }, // vertical shift
{ name: '#scale[', arg: 'float' }, // font scale
{ name: '#color[', arg: 'int' }, // font color
{ name: '#font[', arg: 'int' }, // font face
Expand Down Expand Up @@ -10132,8 +10132,7 @@ function parseLatex(node, arg, label, curr) {
elem.attr('fill', curr.color || arg.color || null);

// set font size directly to element to avoid complex control
if (curr.fisze !== curr.font.size)
elem.attr('font-size', Math.round(curr.fsize));
elem.attr('font-size', Math.max(1, Math.round(curr.fsize)));

if (curr.font?.isSymbol) {
elem.text(replaceSymbols(s, curr.font.isSymbol));
Expand Down Expand Up @@ -10417,16 +10416,18 @@ function parseLatex(node, arg, label, curr) {
continue;
}

if (found.name === '#bf{' || found.name === '#it{') {
if (found.bi) { // bold or italic
const sublabel = extractSubLabel();
if (sublabel === -1) return false;
if (sublabel === -1)
return false;

const subpos = createSubPos();

if (found.name === '#bf{')
subpos.bold = !subpos.bold;
else
subpos.italic = !subpos.italic;
let value;
for (let c = curr; c && (value === undefined && c); c = c.parent)
value = c[found.bi];

subpos[found.bi] = !value;

parseLatex(currG(), arg, sublabel, subpos);

Expand All @@ -10453,7 +10454,7 @@ function parseLatex(node, arg, label, curr) {
label = label.slice(pos + 2);
}

if ((found.name === '#kern[') || (found.name === '#lower[')) {
if (found.shift) {
const sublabel = extractSubLabel();
if (sublabel === -1) return false;

Expand All @@ -10462,9 +10463,12 @@ function parseLatex(node, arg, label, curr) {
parseLatex(currG(), arg, sublabel, subpos);

let shiftx = 0, shifty = 0;
if (found.name === 'kern[') shiftx = foundarg; else shifty = foundarg;
if (found.shift === 'x')
shiftx = foundarg * subpos.rect.width;
else
shifty = foundarg * subpos.rect.height;

positionGNode(subpos, curr.x + shiftx * subpos.rect.width, curr.y + shifty * subpos.rect.height);
positionGNode(subpos, curr.x + shiftx, curr.y + shifty);

shiftX(subpos.rect.width * (shiftx > 0 ? 1 + foundarg : 1));

Expand All @@ -10479,6 +10483,11 @@ function parseLatex(node, arg, label, curr) {
subpos = createSubPos();

gg.attr('href', foundarg);
if (!isBatchMode()) {
gg.on('mouseenter', () => gg.style('text-decoration', 'underline'))
.on('mouseleave', () => gg.style('text-decoration', null))
.append('svg:title').text(`link on ${foundarg}`);
}

parseLatex(gg, arg, sublabel, subpos);

Expand Down Expand Up @@ -73527,10 +73536,10 @@ class TPavePainter extends ObjectPainter {
} else if ((opt === 'postitle') || painter.isDummyPos(pave)) {
const st = gStyle, fp = painter.getFramePainter();
if (st && fp) {
const midx = st.fTitleX, y2 = st.fTitleY;
const midx = st.fTitleX, y2 = st.fTitleY, fsz = st.fTitleFontSize;
let w = st.fTitleW, h = st.fTitleH;

if (!h) h = (y2 - fp.fY2NDC) * 0.7;
if (!h) h = Math.max((y2 - fp.fY2NDC) * 0.7, (fsz < 1) ? 1.1 * fsz : 1.1 * fsz / fp.getFrameWidth());
if (!w) w = fp.fX2NDC - fp.fX1NDC;
if (!Number.isFinite(h) || (h <= 0)) h = 0.06;
if (!Number.isFinite(w) || (w <= 0)) w = 0.44;
Expand Down Expand Up @@ -82308,9 +82317,7 @@ let TH1Painter$2 = class TH1Painter extends THistPainter {

if (show_markers) {
// draw markers also when e2 option was specified
let style = this.options.MarkStyle;
if (!style && (histo.fMarkerStyle === 1)) style = 8; // as in recent ROOT changes
this.createAttMarker({ attr: histo, style }); // when style not configured, it will be ignored
this.createAttMarker({ attr: histo, style: this.options.MarkStyle }); // when style not configured, it will be ignored
if (this.markeratt.size > 0) {
// simply use relative move from point, can optimize in the future
path_marker = '';
Expand Down Expand Up @@ -147115,8 +147122,11 @@ async function drawText$1() {
fact = 0.8;
}

if (is_url)
this.draw_g.attr('href', text.fName).append('title').text(`Link on ${text.fName}`);
if (is_url) {
this.draw_g.attr('href', text.fName);
if (!this.isBatchMode())
this.draw_g.append('svg:title').text(`link on ${text.fName}`);
}

return this.startTextDrawingAsync(this.textatt.font, this.textatt.getSize(w, h, fact, 0.05))
.then(() => this.drawText(arg))
Expand Down
2 changes: 2 additions & 0 deletions js/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
33. Fix - properly redraw TMultiGraph
34. Fix - show empty bin in TProfile2D if it has entries #316
35. Fix - unzooming on log scale was extending range forevever
36. Fix - do not force style 8 for hist markers
37. Fix - ensure minimal hist title height


## Changes in 7.7.4
Expand Down
41 changes: 25 additions & 16 deletions js/modules/base/latex.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadScript, settings, isNodeJs, isStr, source_dir, browser } from '../core.mjs';
import { loadScript, settings, isNodeJs, isStr, source_dir, browser, isBatchMode } from '../core.mjs';
import { getElementRect, _loadJSDOM, makeTranslate } from './BasePainter.mjs';
import { FontHandler, kSymbol, kWingdings, kTimes } from './FontHandler.mjs';

Expand Down Expand Up @@ -236,13 +236,13 @@ function approximateLabelWidth(label, font, fsize) {
/** @summary array defines features supported by latex parser, used by both old and new parsers
* @private */
const latex_features = [
{ name: '#it{' }, // italic
{ name: '#bf{' }, // bold
{ name: '#it{', bi: 'italic' }, // italic
{ name: '#bf{', bi: 'bold' }, // bold
{ name: '#underline{', deco: 'underline' }, // underline
{ name: '#overline{', deco: 'overline' }, // overline
{ name: '#strike{', deco: 'line-through' }, // line through
{ name: '#kern[', arg: 'float' }, // horizontal shift
{ name: '#lower[', arg: 'float' }, // vertical shift
{ name: '#kern[', arg: 'float', shift: 'x' }, // horizontal shift
{ name: '#lower[', arg: 'float', shift: 'y' }, // vertical shift
{ name: '#scale[', arg: 'float' }, // font scale
{ name: '#color[', arg: 'int' }, // font color
{ name: '#font[', arg: 'int' }, // font face
Expand Down Expand Up @@ -578,8 +578,7 @@ function parseLatex(node, arg, label, curr) {
elem.attr('fill', curr.color || arg.color || null);

// set font size directly to element to avoid complex control
if (curr.fisze !== curr.font.size)
elem.attr('font-size', Math.round(curr.fsize));
elem.attr('font-size', Math.max(1, Math.round(curr.fsize)));

if (curr.font?.isSymbol) {
elem.text(replaceSymbols(s, curr.font.isSymbol));
Expand Down Expand Up @@ -863,16 +862,18 @@ function parseLatex(node, arg, label, curr) {
continue;
}

if (found.name === '#bf{' || found.name === '#it{') {
if (found.bi) { // bold or italic
const sublabel = extractSubLabel();
if (sublabel === -1) return false;
if (sublabel === -1)
return false;

const subpos = createSubPos();

if (found.name === '#bf{')
subpos.bold = !subpos.bold;
else
subpos.italic = !subpos.italic;
let value;
for (let c = curr; c && (value === undefined && c); c = c.parent)
value = c[found.bi];

subpos[found.bi] = !value;

parseLatex(currG(), arg, sublabel, subpos);

Expand All @@ -899,7 +900,7 @@ function parseLatex(node, arg, label, curr) {
label = label.slice(pos + 2);
}

if ((found.name === '#kern[') || (found.name === '#lower[')) {
if (found.shift) {
const sublabel = extractSubLabel();
if (sublabel === -1) return false;

Expand All @@ -908,9 +909,12 @@ function parseLatex(node, arg, label, curr) {
parseLatex(currG(), arg, sublabel, subpos);

let shiftx = 0, shifty = 0;
if (found.name === 'kern[') shiftx = foundarg; else shifty = foundarg;
if (found.shift === 'x')
shiftx = foundarg * subpos.rect.width;
else
shifty = foundarg * subpos.rect.height;

positionGNode(subpos, curr.x + shiftx * subpos.rect.width, curr.y + shifty * subpos.rect.height);
positionGNode(subpos, curr.x + shiftx, curr.y + shifty);

shiftX(subpos.rect.width * (shiftx > 0 ? 1 + foundarg : 1));

Expand All @@ -925,6 +929,11 @@ function parseLatex(node, arg, label, curr) {
subpos = createSubPos();

gg.attr('href', foundarg);
if (!isBatchMode()) {
gg.on('mouseenter', () => gg.style('text-decoration', 'underline'))
.on('mouseleave', () => gg.style('text-decoration', null))
.append('svg:title').text(`link on ${foundarg}`);
}

parseLatex(gg, arg, sublabel, subpos);

Expand Down
2 changes: 1 addition & 1 deletion js/modules/core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const version_id = 'dev',

/** @summary version date
* @desc Release date in format day/month/year like '14/04/2022' */
version_date = '2/10/2024',
version_date = '8/10/2024',

/** @summary version id and date
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
Expand Down
7 changes: 5 additions & 2 deletions js/modules/draw/more.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ async function drawText() {
fact = 0.8;
}

if (is_url)
this.draw_g.attr('href', text.fName).append('title').text(`Link on ${text.fName}`);
if (is_url) {
this.draw_g.attr('href', text.fName);
if (!this.isBatchMode())
this.draw_g.append('svg:title').text(`link on ${text.fName}`);
}

return this.startTextDrawingAsync(this.textatt.font, this.textatt.getSize(w, h, fact, 0.05))
.then(() => this.drawText(arg))
Expand Down
4 changes: 2 additions & 2 deletions js/modules/hist/TPavePainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,10 +1398,10 @@ class TPavePainter extends ObjectPainter {
} else if ((opt === 'postitle') || painter.isDummyPos(pave)) {
const st = gStyle, fp = painter.getFramePainter();
if (st && fp) {
const midx = st.fTitleX, y2 = st.fTitleY;
const midx = st.fTitleX, y2 = st.fTitleY, fsz = st.fTitleFontSize;
let w = st.fTitleW, h = st.fTitleH;

if (!h) h = (y2 - fp.fY2NDC) * 0.7;
if (!h) h = Math.max((y2 - fp.fY2NDC) * 0.7, (fsz < 1) ? 1.1 * fsz : 1.1 * fsz / fp.getFrameWidth());
if (!w) w = fp.fX2NDC - fp.fX1NDC;
if (!Number.isFinite(h) || (h <= 0)) h = 0.06;
if (!Number.isFinite(w) || (w <= 0)) w = 0.44;
Expand Down
4 changes: 1 addition & 3 deletions js/modules/hist2d/TH1Painter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,7 @@ class TH1Painter extends THistPainter {

if (show_markers) {
// draw markers also when e2 option was specified
let style = this.options.MarkStyle;
if (!style && (histo.fMarkerStyle === 1)) style = 8; // as in recent ROOT changes
this.createAttMarker({ attr: histo, style }); // when style not configured, it will be ignored
this.createAttMarker({ attr: histo, style: this.options.MarkStyle }); // when style not configured, it will be ignored
if (this.markeratt.size > 0) {
// simply use relative move from point, can optimize in the future
path_marker = '';
Expand Down
Loading