-
Notifications
You must be signed in to change notification settings - Fork 21
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
ISSUE #85 : Base64-Encoder Executable #93
Conversation
A utility for base64 encoding and decoding of model and model-driver parameter files. This biary executable will be used for compiling shared-libraries of model and model-driver. This utility will be installed in the CMAKE_INSTALL_RELOC_BINDIR.
Specify build and installation instructions for kim_base64_encode. kim_base64_encode is a critical dependant for building model/model-driver shared-libraries. kim_base64_encode must be built before kim-api. kim_base64_encode will be installed in the CMAKE_INSTALL_RELOC_BINDIR for system-wide access during compile-time of model/model-driver shared-libraries.
…ible now. Stylistic changes: base64.hpp moved to KIM_Base64.hpp KIM_Base64.hpp edited to have 2 space indent Function names/variable names to follow PascalCase or camelCase (like other KIM-API files) Doxygen style docstrings TODO: Licensing issue discussion with Ryan
This is a work in progress and the code is not expected to compile at this stage. A number of small changes have been made to port the code from c++11 to c++98. A pending change is to replace the string-literals with escaped characters.
Create the command-line-interface for kim-base64-encode following the docopt.org format keeping inline with other utils/kim-api-* binary executables
@nav-mohan I think the Open suse error stems from the fact that it is using newer OpenSUSE with newer libasan, so now |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #93 +/- ##
==========================================
+ Coverage 45.29% 46.13% +0.83%
==========================================
Files 140 145 +5
Lines 13059 13359 +300
Branches 1338 1354 +16
==========================================
+ Hits 5915 6163 +248
- Misses 6476 6518 +42
- Partials 668 678 +10 ☔ View full report in Codecov by Sentry. |
cpp/src/base64-encode/README
Outdated
`base64-encode` is a simple xxd replacement to convert files | ||
into embeddable C++ source code. Instead of using binary array | ||
it used base64 strings, which makes it much more performant | ||
for large files. Currently only -i option is supported for | ||
compatibility. More options to be released in future. C++ 98 compliant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`base64-encode` is a simple xxd replacement to convert files | |
into embeddable C++ source code. Instead of using binary array | |
it used base64 strings, which makes it much more performant | |
for large files. Currently only -i option is supported for | |
compatibility. More options to be released in future. C++ 98 compliant. | |
`base64-encode` is a straightforward replacement for xxd, | |
designed to convert files into embeddable C++ source code. | |
Unlike binary arrays, it utilizes base64 strings, significantly | |
enhancing performance for large files. Currently, only the -i | |
option is supported for compatibility, with more options | |
planned for future releases. It is compliant with C++98 standards. |
ef8c6f5
to
1ddb0ed
Compare
@nav-mohan Regardinhe Fedora debug is failing while complaining about position independent code. I think we can fix it by including
in the The window test seems to be failing from CRLF file endings, that is bit strange but needs closer looking into. Perhaps I can try manually looking into the generated C++ files on windows when I get time. Perhaps a windows os based macro to write "\r\n" is needed. |
@ipcamit thanks for looking into it. if you cant' acquire a Windows machine, you could execute these Github Actions workflows on your own fork of the repo. |
@ipcamit Some updates:
A quick screenshot to show the output from mingw and gcc when used to encode
As for the Fedora workflow, enabling the PIC flag worked and that build runs successfully now. |
Thank you @nav-mohan for investigating this. I think 2 is a better solution. Then we can remove the |
@ellio167 do you know how to handle the billing issue with the MacOS runners? I looked at the openkim organization billing page and didn't see anything obvious, but as @ipcamit pointed out offline, it might be up to the PR author to pay (since otherwise a malicious actor could bill someone's account just by submitting PRs) |
We've never setup billing for github, I don't think. So, I think the settings for the openkim org as such that nothing non-free can run. I would guess that we could change this and add a payment method (a pcard from one of the AEM staff, I suppose). However, don't know if that's something we want to do... Plus, I don't know anything about setting this up or maintaining/securing it... |
Got it, I'll see if I can figure out what to do here. |
@ilia-nikiforov-umn @ellio167 We can control specific triggers for running the build workflow. |
So what is the the status for this PR? Just want to know if anything is to be done at my end? |
@nav-mohan can you try removing the https://github.com/orgs/community/discussions/102846#discussioncomment-9344474
|
602948d
to
afd1afe
Compare
@ilia-nikiforov-umn thanks for pointing that out. That was one of the issues. |
@nav-mohan Can you please revert most of the changes in the PR so as to minimize the differences between the master devel branch and this PR? In particular, you've merged in changes from an official release which has made changes to essentially all the files by putting a specific version number in the file headers. Changes like this
should be eliminated. Thank you. |
libasan6 is deprecated and has been updated to libasan8 MacOS 10//11 is not supported by Github Actions and has been updated to Mac 13/14 Fortran compiler is not included in mingw-toolchain and must be explicitly installed Fedora requires POSITION_INDEPENDENT_CODE ON when linking a static library (libb64) with a dynamic library (kim-api) Workflows can now be manually triggered through web UI.
Going forward we'll try to store all external libraries in this folder
A small modification to libb64 is required to ensure the output of kim-api-base64-encode returns a valid C++ source-file.
use MacOS-13, MacOS-14 instead of MacOS-13-large, MacOS-14-large use clang++ compiler use gfortran-14 compiler
@ellio167 commits have been squashes/dropped and the branch has been cleaned up. |
I think this is ready; @nav-mohan @ipcamit take a final look to see if any of my refactors are objectionable. |
Looks good to me! |
Looks good to me as well! |
Fixes issue #85
Currently, we use
xxd
and a nativecmake
implementation to encode parameter files for linking into a shared-library.base64-encode
is an executable meant to replace both.It will be installed in the
CMAKE_INSTALL_RELOC_BINDIR
.