Changes between Initial Version and Version 1 of Ticket #57007


Ignore:
Timestamp:
Aug 21, 2018, 7:44:03 AM (6 years ago)
Author:
olupton (Olli Lupton)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57007 – Description

    initial v1  
    11With the most recent verison(s) of the root6 port I have had problems compiling local code linking against ROOT.
    22
    3 The problem seems to be that in the default MacPorts installation of root6 the ROOT headers are accessible both at:
    4 /opt/local/libexec/root6/include/root (returned by `root-config --incdir`)
    5 and:
    6 /opt/local/include/root{,6}
     3The problem seems to be that in the default MacPorts installation of root6 the ROOT headers are accessible both at `/opt/local/libexec/root6/include/root` (returned by `root-config --incdir`) and `/opt/local/include/root{,6}`
    74
    85And since 6.14 at least one header with the same name exists at multiple levels of the header file structure:
     6{{{
    97MD5 (/opt/local/libexec/root6/include/root/RConfig.h) = c2c2d44a3228fcbf9943048bfca2cb27
    108MD5 (/opt/local/libexec/root6/include/root/ROOT/RConfig.h) = 5d2a7a998a363947acd947487a666bea
     9}}}
    1110
    1211(see e.g. https://root.cern.ch/doc/v614/ROOT_2RConfig_8h.html and the non-existence of the same page for 6.12)
    1312
    14 When (automatically-generated) code tries to include the latter, i.e. #include <ROOT/RConfig.h>, then, if /opt/local/include is in the include path, /opt/local/include/root/RConfig.h is found instead (with a warning about non-portable filenames because the case doesn't match, -Wnonportable-include-path), and compilation fails because the wrong one of the two RConfig.h is picked up (errors like "error: use of undeclared identifier 'R__likely'" -- included so hopefully Google finds this ticket).
     13When (automatically-generated) code tries to include the latter, i.e. `#include <ROOT/RConfig.h>`, then, if `/opt/local/include` is in the include path, `/opt/local/include/root/RConfig.h` is found instead (with a warning about non-portable filenames because the case doesn't match, -Wnonportable-include-path), and compilation fails because the wrong one of the two RConfig.h is picked up (errors like `error: use of undeclared identifier 'R__likely'` -- included so hopefully Google finds this ticket).
    1514
    16 A minimal workaround is to remove the /opt/local/include/root{,6} symlinks and make sure /opt/local/libexec/root6/include/root is in the include path for compilation. This seems a bit ugly, but so do all the other solutions...
     15A minimal workaround is to remove the `/opt/local/include/root{,6}` symlinks and make sure `/opt/local/libexec/root6/include/root` is in the include path for compilation. This seems a bit ugly, but so do all the other solutions...
    1716
    1817Possibilities I see:
    19 - Remove /opt/local/include/root{,6} symlinks: seems wrong to not have the headers somewhere under /opt/local/include
    20 - Move the headers one directory up the tree under /opt/local/include, i.e.  ln -s /opt/local/libexec/root6/include/root/RConfig.h /opt/local/include/RConfig.h repeated for every ROOT header: involves a large number of links, but does integrate ROOT into the /opt/local tree a bit better.
    21 - Consider it a bug on my part that /opt/local/include is in the include path when compiling against ROOT: seems unreasonable, many other packages' headers are only available here.
    22 - Consider it a bug on my part that /opt/local/include comes before /opt/local/libexec/root6/include in the include path: doesn't seem very robust/reasonable to expect all external dependencies to respect this convention
     18- Remove `/opt/local/include/root{,6}` symlinks: seems wrong to not have the headers somewhere under `/opt/local/include`
     19- Move the headers one directory up the tree under `/opt/local/include`, i.e. `ln -s /opt/local/libexec/root6/include/root/RConfig.h /opt/local/include/RConfig.h` repeated for every ROOT header: involves a large number of links, but does integrate ROOT into the /opt/local tree a bit better.
     20- Consider it a bug on my part that `/opt/local/include` is in the include path when compiling against ROOT: seems unreasonable, many other packages' headers are only available here.
     21- Consider it a bug on my part that `/opt/local/include` comes before `/opt/local/libexec/root6/include` in the include path: doesn't seem very robust/reasonable to expect all external dependencies to respect this convention