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

Support RHEL8 on PowerPC architecture #1700

Open
alexlin0 opened this issue Apr 26, 2024 · 7 comments
Open

Support RHEL8 on PowerPC architecture #1700

alexlin0 opened this issue Apr 26, 2024 · 7 comments

Comments

@alexlin0
Copy link
Contributor

Found this in a round-about way. I was trying to compile Trick on a PowerPC machine running Redhat 8. Could not compile Trick. I found that sections of code with "#if __linux" were not getting included. I found that linux was used on my machine instead. But while experimenting I found that __linux is defined if we don't use the --std=c++11 argument. It's been years since this was added. The default version of g++ 8 (the default version that comes with RHEL8) is now c++14. Removing this argument throughout Trick makefiles will compile Trick code to a more recent c++ standard and fixes my build.

alexlin0 added a commit that referenced this issue Apr 26, 2024
Removed --std=c++11 from makefiles and where it would be added to
generated makefiles.
@alexlin0
Copy link
Contributor Author

alexlin0 commented Apr 26, 2024

Nope, can't do it. Found a couple of lines on some machines that still require the use of --std=c++11. Changing the title to my underlying purpose, support RHEL 8 on PowerPC.

Accomplish this by changing __linux to __linux __ in preprocessor statements.

@alexlin0 alexlin0 changed the title Remove --std=c++11 as the default c++ version Support RHEL8 on PowerPC architecture Apr 26, 2024
@dandexter
Copy link

I know you are trying to get Trick to compile on RHEL 8 on PowerPC, but what about emulations that need to be compiled with -std=c++11? Would there be any problem with the Trick executive and supporting trick code that gets added to the simulation when the sim is compiled with -std=c++11? If you find a way that support c++11 that does not depend on __linux then perhaps this is not even a problem.

alexlin0 added a commit that referenced this issue Apr 26, 2024
Did a global replace of __linux with __linux__
@alexlin0
Copy link
Contributor Author

I thought I read that the default compiler versions on RHEL and Mac were already supporting c++ 14 or newer by default. I thought that removing c++11 would work without issues. I was wrong. Somewhere there is still a dependency. I reverted that change and am trying a different way.

@dandexter
Copy link

The issue I'm thinking of is IEEE 1516-2010 uses deprecated APIs and that causes compile problems for c++14 and I have to set -std=c++11 for RHEL 8 or newer. I just wanted to share that some users may have to use c++ 11 to compile simulations and I wanted to make sure there would not be any issues for any fix you come up with.

@alexlin0
Copy link
Contributor Author

Do you have a plan to change the code relying on deprecated APIs? Eventually Trick should not specify which c++ version to use to compile, it could conflict with what the user wants. The user should always have the capability to specify the c++ standard in TRICK_CPPFLAGS.

@dandexter
Copy link

The IEEE 1516-2010 provides APIs and libraries that are targeted to the c++ 11 standard. The next version of the HLA standard (i.e. HLA 4) is going through balloting right now but it is my understanding that the APIs and libraries will also be c++ 11. So no we can't change the deprecated APIs and it will be that way for the foreseeable future.

@dandexter
Copy link

dandexter commented Apr 26, 2024

I think it will be okay for Trick to be compiled without specifying a C++ standard, but when we compile the simulation we do.

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

No branches or pull requests

2 participants