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

Use environment variable JULIA_CXX_RTTI to switch RTTI on or off #313

Merged
merged 1 commit into from
May 31, 2017

Conversation

oschulz
Copy link
Contributor

@oschulz oschulz commented Dec 30, 2016

RTTI defaults to off, as before, but can now be switched on at any time (before using Cxx.jl) via

export JULIA_CXX_RTTI=1

without rebuilding Cxx.jl

Addresses #166. It guess it's not full solution (keep #166 open?) - but until one is found, it should make life a lot easier for people who need RTTI (like @jpata and myself). :-)

This includes #311.

@nstiurca
Copy link

nstiurca commented Jan 3, 2017 via email

@jw3126
Copy link
Contributor

jw3126 commented Jan 9, 2017

+1 from me too!

@oschulz
Copy link
Contributor Author

oschulz commented Jan 21, 2017

Rebased to current master.

@oschulz
Copy link
Contributor Author

oschulz commented Feb 5, 2017

@Keno, I saw you changed settings to

Cxx->CI->getLangOpts().RTTI = 1;
Cxx->CI->getLangOpts().RTTIData = 1;

on the current master. Do you think this PR might still be useful for people who want to switch RTTI off (in that case, I'd can adapt the PR to the current master). Or should we just close this?

@Keno
Copy link
Collaborator

Keno commented Feb 5, 2017

Yes, I still want to do something about this. Not quite sure which direction though. Let me do some pondering.

@oschulz
Copy link
Contributor Author

oschulz commented Feb 5, 2017

Sure - as the default is RTTI on now, I'm happy. ;-)

@jpata
Copy link
Contributor

jpata commented Feb 10, 2017

RTTI was switched off again in the HEAD 194e99a#diff-3602d1988f104dde976bc98109e34a33R1384

It seems simply switching it on again breaks Cxx.jl

@oschulz
Copy link
Contributor Author

oschulz commented Feb 13, 2017

RTTI was switched off again in the HEAD ... It seems simply switching it on again breaks Cxx.jl

@Keno , I guess you're currently changing some deeper things, there? I can stay with the previous version for a while, but we can get RTTI back as an option, can't we? Pretty please? ;-)

@oschulz
Copy link
Contributor Author

oschulz commented Mar 15, 2017

This works again (I've rebased on the current master). @Keno, would you consider merging this? I know you're looking for better solution, long-term - but for now, it would make things a lot easier for people who need RTTI. Deprecating/ignoring the JULIA_CXX_RTTI env variable in the future - when it's not required anymore - shouldn't be a problem after all, right?

@oschulz
Copy link
Contributor Author

oschulz commented Apr 3, 2017

@Keno, gentle bump.

@oschulz
Copy link
Contributor Author

oschulz commented May 31, 2017

@Keno, I have a bunch of people who are interested to give Julia a shot for a new project right now, but a lot will depend on compatibility with ROOT, so we need Cxx with RTTI. It would ease things a lot if I don't have to get people to install a special branch of Cxx.jl ... would you be willing to merge this PR?

@oschulz
Copy link
Contributor Author

oschulz commented May 31, 2017

Seems to work fine with Julia v0.6-RC2 as well

@Keno
Copy link
Collaborator

Keno commented May 31, 2017

You know what, sure. I've been wanting to do better than this, but I don't have the time and as they say, the perfect is the enemy of the good.

@Keno Keno merged commit 062a994 into JuliaInterop:master May 31, 2017
@oschulz
Copy link
Contributor Author

oschulz commented May 31, 2017

Thanks!!

@oschulz
Copy link
Contributor Author

oschulz commented May 31, 2017

@Keno, when do you plan the next release of Cxx?

@vsaase
Copy link

vsaase commented Aug 25, 2017

when setting JULIA_CXX_RTTI to 1 I get the following error on using Cxx

error: run-time type information was disabled in PCH file but is currently enabled
<built-in>:1:10: fatal error: 'Cxx.h' file not found
#include "Cxx.h"

sorry, I am a Julia beginner, found the solution: rebuild the package: Pkg.build("Cxx")

@skariel
Copy link

skariel commented Apr 24, 2018

@vsaase Doing Pkg.build("Cxx") should fix this (the PCH error thing)

@Keno
Copy link
Collaborator

Keno commented Apr 24, 2018

You may have to delete the Cxx.ji file under ~/.julia somewhere (not at my computer at the moment, so can't look up the exact path). We should probably generate separate .ji files depending on the RTTI setting.

@oschulz oschulz deleted the rtti-env-var branch May 4, 2018 16:03
@stevengj
Copy link
Contributor

With Julia 1.3 and the current Cxx.jl release, I get:

julia> ENV["JULIA_CXX_RTTI"]=1
1

julia> using Cxx
error: run-time type information was disabled in PCH file but is currently enabled
<built-in>:1:10: fatal error: '/Cxx.h' file not found
#include "/Cxx.h"

However, if I force a recompile by re-launching Julia and doing build Cxx before the above code, then it compiles.

(It's really unfortunate that Cxx.jl requires a global setting for this, which is not very composable.)

@oschulz
Copy link
Contributor Author

oschulz commented May 18, 2020

Yes, Keno and me never came up with a better way to handle this. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants