Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit bf08840

Browse files
authored
Set PYTHONPATH for nrnivmodl-core workflow (#199)
- when cmake is run, PYTHONPATH is setup correctly and nmodl with sympy can be used. - for nrnivmodl-core workflow, PYTHONPATH needs to be set in the makefile so that nrnivmodl is self contained.
1 parent 0cfa056 commit bf08840

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ if (ENABLE_NMODL)
124124
else()
125125
set(ENV{PYTHONPATH} "${nmodl_PYTHONPATH}:$ENV{PYTHONPATH}")
126126
endif ()
127+
set(NMODL_PYTHONPATH $ENV{PYTHONPATH})
127128
endif ()
128129

129130

extra/nrnivmodl_core_makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ $(OBJS_DIR)/%.obj: $(MODC_DIR)/%.ispc | $(OBJS_DIR)
135135
# Build ispc files with mod2c/nmodl
136136
$(mod_ispc_files): $(MODC_DIR)/%.ispc: $(MODS_PATH)/%.mod | $(MODC_DIR)
137137
@printf " -> $(C_GREEN)MOD2C$(C_RESET) $<\n"
138+
PYTHONPATH=@NMODL_PYTHONPATH@ \
138139
MODLUNIT=$(datadir_mod2c)/nrnunits.lib \
139140
$(mod2c_install_bin) $< -o $(MODC_DIR)/ @nmodl_arguments_ispc@
140141

@@ -144,6 +145,7 @@ $(mod_ispc_c_files): $(MODC_DIR)/%.cpp: $(MODC_DIR)/%.ispc
144145
# Build cpp files with mod2c/nmodl
145146
$(mod_c_files): $(MODC_DIR)/%.cpp: $(MODS_PATH)/%.mod | $(MODC_DIR)
146147
@printf " -> $(C_GREEN)MOD2C$(C_RESET) $<\n"
148+
PYTHONPATH=@NMODL_PYTHONPATH@ \
147149
MODLUNIT=$(datadir_mod2c)/nrnunits.lib \
148150
$(mod2c_install_bin) $< -o $(MODC_DIR)/ @nmodl_arguments_c@
149151

0 commit comments

Comments
 (0)