Opened 10 years ago

Closed 6 years ago

#41572 closed enhancement (wontfix)

root: switch to external FreeType once "unknown type name 'FT_Glyph'; did you mean 'FTGlyph'" is fixed

Reported by: mojca (Mojca Miklavec) Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: root5 root6

Description

Compiling the latest Root 5.34.12 (on top of the latest FT 2.5.1 ;) the compilation on 10.7 fails with:

/usr/bin/clang++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude -DR__HAVE_CONFIG     -pthread -o graf2d/graf/src/TPaveLabel.o -c /path/to/work/root/graf2d/graf/src/TPaveLabel.cxx
In file included from /path/to/work/root/graf2d/graf/src/TMathText.cxx:15:
include/TTF.h:51:4: error: unknown type name 'FT_Glyph'; did you mean 'FTGlyph'?
   FT_Glyph   fImage; // glyph image
   ^~~~~~~~
   FTGlyph
include/ftglyph.h:25:19: note: 'FTGlyph' declared here
class FTGL_EXPORT FTGlyph
                  ^
In file included from /path/to/work/root/graf2d/graf/src/TMathText.cxx:15:
include/TTF.h:51:15: error: field type 'FTGlyph' is an abstract class
   FT_Glyph   fImage; // glyph image
              ^
include/ftglyph.h:49:32: note: unimplemented pure virtual method 'Render' in 'FTGlyph'
        virtual const FTPoint& Render( const FTPoint& pen) = 0;
                               ^
bin/rmkdepend -R -fgraf2d/graf/src/TPaveStats.d -Y -w 1000 -- -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude -DR__HAVE_CONFIG     -pthread -D__cplusplus -- /path/to/work/root/graf2d/graf/src/TPaveStats.cxx
/usr/bin/clang++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude -DR__HAVE_CONFIG     -pthread -o graf2d/graf/src/TPaveStats.o -c /path/to/work/root/graf2d/graf/src/TPaveStats.cxx
2 errors generated.
make: *** [graf2d/graf/src/TMathText.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/path/to/work/root'

Attachments (2)

main.log (934.7 KB) - added by mojca (Mojca Miklavec) 10 years ago.
root's build log
root.diff (2.0 KB) - added by cjones051073 (Chris Jones) 10 years ago.

Download all attachments as: .zip

Change History (26)

Changed 10 years ago by mojca (Mojca Miklavec)

Attachment: main.log added

root's build log

comment:1 Changed 10 years ago by cjones051073 (Chris Jones)

Please explain better exactly what you are doing. I don't understand what you mean by "on top of the latest FT 2.5.1 " ? Which MacPorts port is this ?

comment:2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

The freetype port. It was updated to 2.5.1 today.

comment:3 Changed 10 years ago by cjones051073 (Chris Jones)

Ah right. Just seeing that discussion now ...

comment:4 Changed 10 years ago by mojca (Mojca Miklavec)

I just wanted to confirm that downgrading FreeType leads to a successful compilation.

I filed two tickets upstream:

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 Changed 10 years ago by cjones051073 (Chris Jones)

Hi,

Reading the reports, its not clear to me if this is a ROOT bug, a FreeType bug, or perhaps even a MacPorts bug in the ROOT port file.

However, as a work around I have prepared the attached patch which reverts the build to using ROOT own internal free type build, instead of the external (MacPorts) one. As a point of principle, I have always tried to use the external MacPorts ports wherever possible, but this isn't always possible. At least until this is resolved, the patch offers a fix. Works for me on OSX 10.9.

Chris

Changed 10 years ago by cjones051073 (Chris Jones)

Attachment: root.diff added

comment:6 Changed 10 years ago by mojca (Mojca Miklavec)

I committed r114085, but it would probably be nice to switch back to external library when this gets fixed.

comment:7 Changed 10 years ago by mojca (Mojca Miklavec)

Summary: root: unknown type name 'FT_Glyph'; did you mean 'FTGlyph'root: switch to external FreeType once "unknown type name 'FT_Glyph'; did you mean 'FTGlyph'" is fixed
Type: defectenhancement

comment:8 Changed 10 years ago by cjones051073 (Chris Jones)

Thanks. Reverting back once it is resolved is certainly my plan...

comment:9 Changed 10 years ago by mojca (Mojca Miklavec)

I managed to overcome this particular problem with an ugly patch, replacing

#define FT_GLYPH_H <ftglyph.h>

by

#define FT_GLYPH_H <../freetype2/ftglyph.h>

in $prefix/include/freetype2/config/ftheader.h

See the upstream ticket:

I hope a better solution will be found.

comment:10 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

The upstream ticket has been closed with the comment:

It's not the fault of our library that another library which is based on FreeType uses such a similar header name!

So please file a bug with the makers of ftgl and ask them to rename their headers.

comment:11 Changed 10 years ago by mojca (Mojca Miklavec)

I reported it to https://sourceforge.net/p/ftgl/bugs/41/. Independent of that the ROOT team will try to come up with a solution, so any hints welcome. And yes, MacPorts can implement yet another workaround, but since it's not a pressing issue now that the built-in library works, I would suggest to try to wait for either FTGL or ROOT to come up with a patch first (or maybe only patch it when the next version of FreeType or ROOT gets released).

Last edited 10 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:12 Changed 10 years ago by mojca (Mojca Miklavec)

See https://github.com/root-mirror/root/commit/446a11828dcf577efd15d9057703c5bd099dd148 (as well as https://sft.its.cern.ch/jira/browse/ROOT-5773).

I suspect the fix will be part of 5.34.15, but you can try to backport the patch to existing release if you want.

comment:13 Changed 10 years ago by mojca (Mojca Miklavec)

I tried to switch to external freetype, but I'm afraid that I'm getting exactly the opposite problem now.

comment:14 Changed 10 years ago by mojca (Mojca Miklavec)

Port: root5 root6 added; root removed

I changed the affected port list to root5 and root6 even though I'm not 100% sure if that's really the case. Also, the issue is now "reverse", so the ticket title is not accurate any longer.

comment:15 in reply to:  11 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to mojca@…:

I reported it to https://sourceforge.net/p/ftgl/bugs/41/.

I filed #47716 for getting this resolved in MacPorts ftgl.

comment:16 in reply to:  10 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jonesc@…:

Reading the reports, its not clear to me if this is a ROOT bug, a FreeType bug, or perhaps even a MacPorts bug in the ROOT port file.

Replying to ryandesign@…:

The upstream ticket has been closed with the comment:

It's not the fault of our library that another library which is based on FreeType uses such a similar header name!

So please file a bug with the makers of ftgl and ask them to rename their headers.

Looks like the freetype developers have decided it is their bug after all. freetype 2.6.1's CHANGES file includes these comments:

  II. IMPORTANT CHANGES

    - The header  file layout  has been  changed (again),  moving  all
      header files except `ft2build.h' into a subdirectory tree.

      Doing so  reduces the  possibility of  header file  name clashes
      (e.g., FTGL's  `FTGlyph.h' with FreeType's `ftglyph.h')  on case
      insensitive file systems like Mac OS X or Windows.

So please see if root5 and root6 can now be changed back to using MacPorts freetype.

comment:17 Changed 8 years ago by cjones051073 (Chris Jones)

Use of the builtin freetype appears to be forced when the Cocoa backend (now default) is enabled. So not sure there is much to gain.

comment:18 Changed 8 years ago by mojca (Mojca Miklavec)

Maybe it is only forced with good intentions to make life of Mac users (without a package manager) easier. We could try to file a ticket requesting the option to switch.

comment:19 Changed 8 years ago by cjones051073 (Chris Jones)

I still would like to understand exactly what we gain. Sure, we gain the ability to control the freetype version used, but is that really a major gain ? The increase in build time and binary size is I think pretty small. I would not be in particular favour of making the change, if it only lead to increased instability because of the use of a version of freetype not tested against ROOT by upstream (using Cocoa, and thus the builtin version is probably the only version upstream test on a Mac).

comment:20 Changed 6 years ago by cjones051073 (Chris Jones)

Closing this, as the current builds seem to work just fine.

comment:21 Changed 6 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed

comment:22 Changed 6 years ago by mojca (Mojca Miklavec)

Yes, built-in freetype works, but I still have a feeling that we could use the one provided by MacPorts.

comment:23 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: closedreopened

comment:24 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: wontfix
Status: reopenedclosed

We shouldn't state that we've fixed something we haven't fixed. If we've decided not to fix something, that's what we should state.

Note: See TracTickets for help on using tickets.