-
Notifications
You must be signed in to change notification settings - Fork 90
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
Migrate to all-in-one CMake-based build configuration #20
base: master
Are you sure you want to change the base?
Conversation
427fd29
to
ea03e12
Compare
Ping. Please give us a timeline when this change is desired. Here is some users' story with this PR. An NVIDIA engineer who works on CUDA libraries for C++, also a fan of APL and J, decided to start a LiveSteam working on converting the J codebase to C++20. He was able to figure out how the CMake-based build works without prior-knowledge of CMake or Ninja (and didn't read my PR comment either, and wasted some time because of that). In the end, he recreated his jsource repo by branching off my PR rather than jsoftware upstream 🤷 I did not get involved in those live streams and was aware of that only after YouTube pushed me a recommendation. Now that repository has 11 contributors and nobody seemed to complain about the build system. They iterate on it, improved how unit tests run, and even added documentation generation as a part of the build process. |
Zhihaoy,
The idea of moving to cmake is interesting. But perhaps not of immediate
general interest to jsource users. I will get back to you directly (outside
the forum) to see if there is a way forward that is of benefit to everyone.
/Eric
…On Mon, Feb 8, 2021 at 1:03 PM zhihaoy ***@***.***> wrote:
Ping. Please give us a timeline when this change is desired.
Here is some users' story with this PR.
An NVIDIA engineer who works on CUDA libraries for C++, also a fan of APL
and J, decided to start a LiveSteam
<https://www.youtube.com/playlist?list=PLVFrD1dmDdvfVhYLU_iKkV67X9XqCJLWe>
working on converting the J codebase to C++20. He was able to figure out
<https://youtu.be/afico3BW-Is> how the CMake-based build works without
prior-knowledge of CMake or Ninja (and didn't read my PR comment either,
and wasted some time because of that). In the end, he recreated his jsource
repo <https://github.com/codereport/jsource> by branching off my PR
rather than jsoftware upstream 🤷
I did not get involved in those live streams and was aware of that only
after YouTube pushed me a recommendation.
Now that repository has 11 contributors and nobody seemed to complain
about the build system. They iterate on it, improved how unit tests run,
and even added documentation generation as a part of the build process.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEBRCHWXBGRWVKUSBVXU6WLS6ARPJANCNFSM4TQ5XJXA>
.
|
49faf49
to
6c8c367
Compare
MSBuild has a bug right now, it cannot distinguish C and C++ sources. We cannot add flags based on that.
The always_inline attribute does not imply C99 inline in some versions of GCC. See also https://bugzilla.mozilla.org/show_bug.cgi?id=697810
Rebased on top of I'm now maintaining |
08b755a
to
c16b927
Compare
c6377af
to
1528769
Compare
b0d5e67
to
2455187
Compare
c695434
to
f379f4c
Compare
I started a thread in the mailing list at http://jsoftware.com/pipermail/source/2020-November/001353.html.
If accepted, this PR will
It is tested on Windows and Linux, inside and outside Visual Studio 2019, with Clang and GCC.
It should work on Mac as well.
How to use:
I suggest check out mycmake-new
branch and try the following. Because when the change is applied on top ofmaster
,jconsole
crashes on Windows when exiting, which implies an issue inmaster
.Visual Studio 2019
To build, select "Open" -> "CMake..." or "Folder..." from the menu in Visual Studio 2019.
To debug, select "jconsole.exe (jsrc\jconsole)" as the debug target and run.
To run unit tests, "Test" -> "Run CTests for j."
Linux
Please install cmake >= 3.17 and ninja. If you cannot find a recent software repository, you can open an Anaconda environment and install them there. And then, execute
under the
jsource
root directory. The last argument, "build," is for specifying the build directory. It can be anything, but I will use "build" for the rest of the article.The above command generates a Ninja multi-configuration build. Now running
will build j, jconsole in Debug, and prepare for unit tests. If we found JDK, we will also build jnative.
The executable is now usable with
It loads
jlibrary
under yourjsource
repository.T run unit tests against the Debug executable and libraries:
Do the Release build:
Run unit tests against the Release executable and libraries:
If you find this command being too verbose, you can use the
ctest
tool:Note that the Release artifacts and Debug artifacts can coexist. The Release executable is at
under the
jsource
root directory.If you made changes to any source file, running ninja will do an incremental build. If you made changes to
CMakeLists.txt
, running ninja will incrementally reconfigure. If you totally messed up,rm -fr build
.You can switch compilers to Clang with
Developer Command Prompt for VS 2019
If
clang-cl
is in yourPATH
, you can specify the compilers withDiscussion
Rationale, details, plan, questions are all in the email I sent to the mailing list. Here is a quick summary I brought up for discussion:
READLINE
?