neuronsimulator / nrn

NEURON Simulator
http://nrn.readthedocs.io
Other
381 stars 114 forks source link

NEURON + NMODL build failure: can't find Eigen. #2970

Closed 1uc closed 1 month ago

1uc commented 1 month ago

Install both NEURON and NMODL from sources.

Clone both:

git clone git@github.com:neuronsimulator/nrn.git nrn
git clone git@github.com:BlueBrain/nmodl.git

Configure, build & install NEURON:

cd nrn
cmake -DCMAKE_INSTALL_PREFIX=build-demo/install -DNRN_ENABLE_PYTHON=ON -DNRN_ENABLE_TESTS=OFF -DNRN_ENABLE_DOCS=OFF -DNRN_ENABLE_CORENEURON=OFF -DNRN_ENABLE_INTERVIEWS=ON -DNRN_ENABLE_BACKTRACE=ON -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_MPI_DYNAMIC=OFF -DCMAKE_BUILD_TYPE=Debug -B build-demo . 
cmake --build build-demo --parallel --target=install

Configure, build & install NMODL:

cd nmodl
cmake -B build-debug -DCMAKE_INSTALL_PREFIX=build-debug/install -DCMAKE_BUILD_TYPE=Debug -DNMODL_ENABLE_BACKWARD=On -DNMODL_ENABLE_USECASES=On . 
cmake --build build-demo --parallel --target=install

Set up the environment. First NRN:

$ cd nrn
$ cat env.sh
export NRN_HOME=${PWD}
export NRN_INSTALL_DIR=${NRN_HOME}/build-$1/install
export PATH=${NRN_INSTALL_DIR}/bin:${PATH}
export PYTHONPATH=${NRN_INSTALL_DIR}/lib/python:$PYTHONPATH
export PYTHONPATH=${NRN_INSTALL_DIR}/lib:$PYTHONPATH
$ source env.sh demo

then NMODL:

$ cd nmodl
$ cat env.sh
export NMODL_HOME=${PWD}
export NMODL_INSTALL_DIR=${NMODL_HOME}/build-${1}/install
export PATH=${NMODL_INSTALL_DIR}/bin:${PATH}
export PYTHONPATH=${NMODL_INSTALL_DIR}/lib:$PYTHONPATH
$ source env.sh debug

Now, find a MOD file, e.g.:

: The name of this mod file should be `point_suffix`.
NEURON {
    POINT_PROCESS point_suffix
    RANGE x
}

ASSIGNED {
    x
}

INITIAL {
    x = 42
}

(everything needs Eigen) and compile it with:

$ nrnivmodl -nmodl $(which nmodl)
-> Compiling nmodl/test/usecases/suffix/x86_64/no_suffix.cpp
nmodl/test/usecases/suffix/x86_64/no_suffix.cpp:13:10: fatal error: Eigen/Dense: No such file or directory
   13 | #include <Eigen/Dense>
      |          ^~~~~~~~~~~~~
compilation terminated.
pramodk commented 1 month ago

@1uc : that's me! I suggested @matz-e to make Eigen copy into <install/> conditional on CoreNEURON being enabled. Of course, I didn't think about the new NMODL targeting NEURON and needing Eigen. (it came to my mind but I thought it will be needed "later").