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

nrnivmodl under cmake no longer uses symbolic links. #850

Merged
merged 18 commits into from
Dec 6, 2020
Merged

Conversation

nrnhines
Copy link
Member

@nrnhines nrnhines commented Nov 29, 2020

Fixes #846

Keeps the legacy style for autotools.
nocmodl has a -o output_dir option following BlueBrain/mod2c#8
Instead of symbolic links, nrnivmod creates makefile include file that defines the rules for individual mod and c file for nrnivmodl_makefile_cmake.in. The rules for mod generated c files is more robust as the location of the mod file is added as an -I argument. The rules for external $cfiles are more robust as the compile happens at the location of the c file.

Tested on linux for autotools and cmake on modeldb regression and tested with

nrnivmodl test.mod ../ringtest/mod ../dcmdt \
  /home/hines/models/reduced_dentate/mechanisms/tca \
  ../ca1dDemo/NMDA.mod`

The latter test does all files in first two relative path folders, an explicit full path mod file without specifying the suffix, and an explicit relative path mod file with the suffix.

Copy link
Member

@pramodk pramodk left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Have some minor suggestion about var names.

Generating makefile and including that in another makefile is not the pattern I used before. But it might come handy.

I tested generated wheel and BBP models by building this PR from source. This works fine.

bin/nrnivmodl.in Outdated Show resolved Hide resolved
bin/nrnivmodl.in Outdated Show resolved Hide resolved
bin/nrnivmodl.in Outdated Show resolved Hide resolved
bin/nrnivmodl_makefile_cmake.in Show resolved Hide resolved
bin/nrnivmodl_makefile_cmake.in Outdated Show resolved Hide resolved
bin/nrnivmodl_makefile_cmake.in Outdated Show resolved Hide resolved
src/nmodl/modl.c Show resolved Hide resolved
Copy link
Member

@pramodk pramodk left a comment

Choose a reason for hiding this comment

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

Some minor questions/comments for improvement.

By the way, nrnivmodl and makefile is really becoming convoluted. I hope Nico's new implementation from coreneuron will be ready soon and can be used here as well.

src/nmodl/modl.c Show resolved Hide resolved
src/nmodl/modl.c Show resolved Hide resolved
src/nmodl/modl.c Show resolved Hide resolved
bin/nrnivmodl.in Show resolved Hide resolved
bin/nrnivmodl.in Show resolved Hide resolved
@nrnhines nrnhines merged commit 41ec0b2 into master Dec 6, 2020
@nrnhines nrnhines deleted the fix/mod-ln branch December 6, 2020 22:29
@pramodk
Copy link
Member

pramodk commented Dec 6, 2020

@nrnhines : we need to backport some of the important fixes to v7.8 (e.g. v7.8.2) and then we can release new wheels for the same.

nrnhines added a commit that referenced this pull request Dec 8, 2020
* nrnivmodl under cmake no longer uses symbolic links.

* windows has different signature for mkdir

* missed one

* .libs/libnrnmech.sh may not be a symlink.

* Accept reviewer suggestions.

-I<mod_file_location> before $(INCLUDES)

* Uniform 2 space per level indentation.
  But note that Make rules require a tab for indentation.

* Handle spaces in paths to mod file

* extern cfiles can be a ';' separated list of c files

* extern cfiles now is extern nrnivmodl_cfiles to list ';' separated c files.

* nrnivmodl file and folder name arg checking.

* print args only on error

* add some comments

Co-authored-by: Pramod Kumbhar <pramod.kumbhar@epfl.ch>
nrnhines added a commit that referenced this pull request Dec 10, 2020
* nrnivmodl under cmake no longer uses symbolic links.

* windows has different signature for mkdir

* missed one

* .libs/libnrnmech.sh may not be a symlink.

* Accept reviewer suggestions.

-I<mod_file_location> before $(INCLUDES)

* Uniform 2 space per level indentation.
  But note that Make rules require a tab for indentation.

* Handle spaces in paths to mod file

* extern cfiles can be a ';' separated list of c files

* extern cfiles now is extern nrnivmodl_cfiles to list ';' separated c files.

* nrnivmodl file and folder name arg checking.

* print args only on error

* add some comments

Co-authored-by: Pramod Kumbhar <pramod.kumbhar@epfl.ch>
@pramodk pramodk mentioned this pull request Apr 19, 2022
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.

nrnivmodl errors when symlinks are not supported
2 participants