Skip to content

Avoid bash warning/error for empty if block#298

Merged
nrnhines merged 2 commits into
neuronsimulator:masterfrom
BlueBrain:pr/nrnvimodl-bash
Oct 31, 2019
Merged

Avoid bash warning/error for empty if block#298
nrnhines merged 2 commits into
neuronsimulator:masterfrom
BlueBrain:pr/nrnvimodl-bash

Conversation

@pramodk

@pramodk pramodk commented Oct 30, 2019

Copy link
Copy Markdown
Member

With #296, we get following warning (syntax error) from bash:

libtool: link: (cd ".libs" && rm -f "libnrnmech.so" && ln -s "libnrnmech.so.0.0.0" "libnrnmech.so")
libtool: link: ( cd ".libs" && rm -f "libnrnmech.la" && ln -s "../libnrnmech.la" "libnrnmech.la" )
Successfully created x86_64/special
neuron/x86_64/bin/nrnivmodl: line 177: syntax error near unexpected token `fi'

This is because the resultant section in nrnivmodl becomes:

if false ; then
#if false ; then
fi

and above empty if block is not syntax error.

In this PR I added empty bash statement using :

Thanks to @jorblancoa for pointing this out!

@pramodk pramodk requested a review from nrnhines October 30, 2019 14:13
Comment thread bin/nrnivmodl.in Outdated
@NRNMECH_DLL_STYLE_TRUE@@MAC_DARWIN_TRUE@if false ; then
@NRNMECH_DLL_STYLE_TRUE@@MAC_DARWIN_FALSE@if false ; then
@NRNMECH_DLL_STYLE_FALSE@if false ; then
: #for empty if block

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would replace the ':' with false

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok done

@nrnhines nrnhines merged commit b31237f into neuronsimulator:master Oct 31, 2019
@pramodk pramodk mentioned this pull request Oct 31, 2019
@pramodk pramodk deleted the pr/nrnvimodl-bash branch October 31, 2019 13:19
pramodk added a commit that referenced this pull request Dec 2, 2019
* digittoint not standard on linux
* Use neuron.test() instead of rxd specific test.
* update submodules : iv as well as coreneuron (#302)
* Array for spike compression may not be allocated in some circumstances. (#293)
* Remove legacy options for purify and mpitrace library of bg-q (#296)
* Avoid bash warning/error for empty if block (#298)
* add back the run_all.py travis_cl test
* Reviewed all assert for necessary side effects. (#306) (#307)
  30 converted from assert to nrn_assert. So work properly with NDEBUG
  defined.

Co-authored-by: Pramod Kumbhar <pramod.kumbhar@epfl.ch>
Co-authored-by: Michael Hines <michael.hines@yale.edu>
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.

2 participants