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

Change C++ std to whatever gcc supports #28

Open
ShashaankHari opened this issue Feb 7, 2024 Discussed in #27 · 1 comment
Open

Change C++ std to whatever gcc supports #28

ShashaankHari opened this issue Feb 7, 2024 Discussed in #27 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@ShashaankHari
Copy link

Discussed in #27

Originally posted by ShashaankHari February 7, 2024
I use jupyter on browser and vscode, primarily on vscode,. How do i change the C++ standard so that it is easier to change standard of code. i check the kernel.py

114 self.standard = "c++14" # default standard if none is specified
121 subprocess.call(['g++', filepath, '-std=c++14', '-Wno-unused-but-set-variable', '-Wno-unused-parameter', '-Wno-unused-variable', '-ldl', '-w', '-o', self.master_path])
163 cflags = ['-pedantic', '-fPIC', '-std=c++14', '-w', '-shared', '-Wno-unused-but-set-variable', '-Wno-unused-parameter', '-Wno-unused-variable'] + cflags

What can I do to change the standard per nootbook basis, because if it uses native gcc then it sure can support newer versions too right?

And in that case we can use the same kernel for running C programs

using fstrings f'std={self.standard}' in all the places is one suggestion.

How do i pass the std for the particular nootbook on vscode/browser?

@shiroinekotfs shiroinekotfs self-assigned this Feb 9, 2024
@shiroinekotfs shiroinekotfs added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 9, 2024
@shiroinekotfs
Copy link
Owner

I see your question covered quite a lot of questions about my kernel, so I will answer them separately.


How do i change the C++ standard so that it is easier to change standard of code. i check the kernel.py

The current C++ kernel - version 1.0.0a7, uses the C++ 14 standard. The plan for other C++ standards only happens in the future, when the kernel reaches its stable state, not alpha or beta state.

If you ask about adding compile flags for your code, you can try //%cflags:. Add it before any C++ code you wanna run

//%cflags: <your flag>

What can I do to change the standard per nootbook basis, because if it uses native gcc then it sure can support newer versions too right?

I don't get your question. If you're asking about the support of the g++ process, it's your installed g++ in your machine. And surely, you can uninstall, download the newer/older one, or even compile from the source and then install it.

The reason I have made a short description is "C++ kernel for Jupyter. Easily adopt and deploy for testing environment." is because of the different organizations and people with different gcc/g++ environments, and they want to test which is the test setup, by running samples on our C++ kernel.


And in that case we can use the same kernel for running C programs

using fstrings f'std={self.standard}' in all the places is one suggestion.

Well, yes. I had thought that way, but as I mentioned earlier, it should be an option only when the kernel is ready to be in production. You have to wait, but not too long.


How do i pass the std for the particular nootbook on vscode/browser?

At least you cannot because of the restriction I have made to the application. If you find a way to break that wall, feel free to share it with us. I am always happy to hear how and what kind of other developers do on my software.


By the way, thanks for your comments, suggestions, and your concentration on my source code. Honestly, I am having problems when finding a new wind with my kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

2 participants