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

Added a command line installation section to the README. #72

Merged
merged 4 commits into from
Jan 18, 2022

Conversation

sbrozell
Copy link
Contributor

@sbrozell sbrozell commented Dec 7, 2021

See #71 .

Scott Brozell added 2 commits December 7, 2021 14:29
The example command sequence worked on
Linux login04 3.10.0-1160.36.2.el7.x86_64 schrodinger#1 SMP Thu Jul 8 02:53:40 UTC 2021 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.9 (Maipo)
cmake version 3.17.2
gcc version 9.1.0 (GCC)
boost/1.72.0
@sbrozell sbrozell mentioned this pull request Dec 7, 2021
@sbrozell sbrozell changed the title Added a command line installation section. Added a command line installation section to the README. Dec 7, 2021
Copy link
Collaborator

@ricrogz ricrogz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Scott, sorry for the delay in reviewing this. Thank you very much for your contribution. I have added a few suggestions below.

README.md Outdated
Comment on lines 78 to 80
building is via [Make](https://en.wikipedia.org/wiki/Make_(software));
and testing can be performed by running a custom built program. Here is an
example command sequence:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake can be instructed to generate the build instructions for different build generators (see the -G option in the CMake documentation: https://cmake.org/cmake/help/latest/manual/cmake.1.html). make is just the default option (e.g., make won't be available on windows systems).

Suggested change
building is via [Make](https://en.wikipedia.org/wiki/Make_(software));
and testing can be performed by running a custom built program. Here is an
example command sequence:
and testing can be performed by running a custom built program. Here is an
example command sequence building via [Make](https://en.wikipedia.org/wiki/Make_(software)) and the `gcc` compiler:

README.md Outdated
Comment on lines 82 to 92
```bash
git clone git@github.com:schrodinger/maeparser.git maeparser
cd maeparser
mkdir build
cd build
export CC=gcc
export VERBOSE=yes
cmake `pwd/..`
make
test/unittest
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```bash
git clone git@github.com:schrodinger/maeparser.git maeparser
cd maeparser
mkdir build
cd build
export CC=gcc
export VERBOSE=yes
cmake `pwd/..`
make
test/unittest
```
```bash
# "clone" a local copy of the code from github
$ git clone git@github.com:schrodinger/maeparser.git maeparser
# set up the build configuration
$ cd maeparser
$ mkdir build
$ cd build
$ export CC=gcc
$ export VERBOSE=yes
$ cmake `pwd/..`
# Run the build
$ make
# Run the tests
$ test/unittest

README.md Outdated
Comment on lines 94 to 100
Defining CC ensures that the first
[compiler](https://en.wikipedia.org/wiki/Compiler) in one's
[PATH](https://en.wikipedia.org/wiki/PATH_(variable)) is used,
and defining VERBOSE enables viewing the gory details of compiling and
[linking](https://en.wikipedia.org/wiki/Linker_(computing))
that will be necessary to reproduce when one builds one's own program
that uses the maeparser library.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments here:

  • There might be other compilers installed, but setting CC requires one specific compiler, not necessarily in the PATH (CC can also be specified with an absolute path to the compiler, and in such case, it doesn't have to be in the PATH variable).

  • The "gory details" are not required to use maeparser in one's code (the default output level is enough for that), but they are useful if there's trouble.

Suggested change
Defining CC ensures that the first
[compiler](https://en.wikipedia.org/wiki/Compiler) in one's
[PATH](https://en.wikipedia.org/wiki/PATH_(variable)) is used,
and defining VERBOSE enables viewing the gory details of compiling and
[linking](https://en.wikipedia.org/wiki/Linker_(computing))
that will be necessary to reproduce when one builds one's own program
that uses the maeparser library.
Defining CC ensures that the specified
[compiler](https://en.wikipedia.org/wiki/Compiler) is used in the build
(in the example, it will be the first instance of `gcc` in one's [PATH](https://en.wikipedia.org/wiki/PATH_(variable))),
and defining VERBOSE enables viewing the gory details of compiling and
[linking](https://en.wikipedia.org/wiki/Linker_(computing))
that will be necessary for debugging or reporting issues if the build fails.

@sbrozell
Copy link
Contributor Author

sbrozell commented Jan 5, 2022

Hi Ric,

Happy New Year !

I may be living in a different universe than you all.
By command line, i was focused on Linux mainly and Mac minorly. I don't expect any of this section will be of interest to Windows users although i haven't used windows for years, ie, once upon a time make existed in cygwin.

The comments among the commands are ok, but the dollar signs will thwart simple cut-n-pasting --- a
minor snag.

Good point on CC.

Note that it is "the gory details of compiling", which the VERBOSE=1 option to make emits, not a high verbosity of maeparser that i was advocating; the former were necessary for me to see to get a simple test built.

I'll tweak.

scott

@sbrozell
Copy link
Contributor Author

sbrozell commented Jan 5, 2022

I pushed the edits.

Copy link
Collaborator

@ricrogz ricrogz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookss good to me. @d-b-w, would you mind having a look too?

@ricrogz ricrogz requested a review from d-b-w January 11, 2022 14:03
Trying to skate the line between "what is idiomatic" and "what is useful to someone new to this tool". Hope it helps. Thanks for helping us out with this, btw.
Copy link
Collaborator

@d-b-w d-b-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping us with our documentation!

README.md Outdated
[Unix-like](https://en.wikipedia.org/wiki/Unix-like)
operating system follows a typical configure, build, and test procedure.
Configuration is via [CMake](https://en.wikipedia.org/wiki/CMake),
and testing can be performed by running a custom built program. Here is an
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the line "and testing can be performed by running a custom built program". The project uses the idiomatic make test or ctest command to run all unit tests.

README.md Outdated
make

# Run the custom testing
test/unittest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctest or make test

test/unittest is currently valid, but we will probably add future tests. ctest and make test are pretty standard mechanisms for running unit tests in a C++ world. (see, for example: https://github.com/cpp-best-practices/cpp_starter_project#running-the-tests)

cd maeparser
mkdir build
cd build
export CC=gcc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that this was needed. I'd expect that either:

  • cmake figures out which compiler you want
  • or you're in a more advanced build environment, in which case I'd expect the container or build environment to set this.

@d-b-w d-b-w merged commit 3d8412f into schrodinger:master Jan 18, 2022
@d-b-w
Copy link
Collaborator

d-b-w commented Jan 18, 2022

Thanks for this, @sbrozell !

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.

3 participants