Skip to content

Commit

Permalink
CMake workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Nov 11, 2024
1 parent 4b62e56 commit ea049c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ option(
NRN_ENABLE_ARCH_INDEP_EXP_POW
"Provides use_exp_pow_precision(style) function so that exp and pow produce same results on all platforms"
${NRN_ENABLE_ARCH_INDEP_EXP_POW_DEFAULT})
if (NRN_ENABLE_ARCH_INDEP_EXP_POW)
set(NRN_ENABLE_ARCH_INDEP_EXP_POW 1)
else()
set(NRN_ENABLE_ARCH_INDEP_EXP_POW 0)
endif()
# This can be helpful in very specific CI build configurations, where ccache is used *and* different
# CI builds are built under different directories.
option(NRN_AVOID_ABSOLUTE_PATHS
Expand Down
2 changes: 1 addition & 1 deletion bin/nrnivmodl.in
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ ${base_name// /\\ }.cpp: ${f}.mod \$(NOCMODL)
./${base_name// /\\ }.o: ${base_name// /\\ }.cpp
@printf \" -> \$(C_GREEN)Compiling\$(C_RESET) ${PWD}/\$<\\\n\"
\$(CXXCOMPILE) -I\"$dir_name\" \$(INCLUDES) @CMAKE_CXX_COMPILE_OPTIONS_PIC@ -c \"${PWD}/\$<\" -o \$@
\$(CXXCOMPILE) -I\"$dir_name\" \$(INCLUDES) @CMAKE_CXX_COMPILE_OPTIONS_PIC@ -DNRN_ENABLE_ARCH_INDEP_EXP_POW=@NRN_ENABLE_ARCH_INDEP_EXP_POW@ -c \"${PWD}/\$<\" -o \$@
" >> "$MODMAKE"
done

Expand Down
2 changes: 2 additions & 0 deletions src/nocmodl/nocpout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,10 @@ void parout() {
\n#if !NRNGPU\
\n#undef exp\
\n#define exp hoc_Exp\
\n#if NRN_ENABLE_ARCH_INDEP_EXP_POW\
\n#undef pow\
\n#define pow hoc_pow\
\n#endif\
\n#endif\n\
");
if (protect_include_) {
Expand Down

0 comments on commit ea049c1

Please sign in to comment.