nrnivmodl compiling in Linux

Post Reply
dzocchi

nrnivmodl compiling in Linux

Post by dzocchi »

I'm using ubuntu 2.6.38 and installed Neuron from the 32 bit deb file. When trying to compile mod files from another model, I get the following error:

/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [libnrnmech.la] Error 1

I have been searching the forums but can't really find anything that helps much. Does anyone know what the problem could be?

Thanks!
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: nrnivmodl compiling in Linux

Post by ted »

Use your distribution's package manager to discover and install the package(s) that it needs for development or compilation of programs that use ncurses.

A comment: despite its general excellence in most other areas, Ubuntu has been the principal source of questions like this. For some reason or other, it doesn't offer users a simple option like "install everything I need to develop and compile programs written in C or C++."
tom_morse
Posts: 44
Joined: Wed May 18, 2005 10:23 pm
Location: Yale University School of Medicine
Contact:

Re: nrnivmodl compiling in Linux

Post by tom_morse »

In ubuntu it is convenient to use synaptic as a package manager. If you don't have it you can add it with a command like

Code: Select all

sudo apt-get install synaptic
When I used synaptic to discover what was missing (I typed ncurses in the synaptic search box when i received the ncurses missing message) I cured the problem by installing libncurses5-dev (in synaptic you can mark it for install and then apply).
sanjaybioe
Posts: 14
Joined: Sun Apr 24, 2011 11:35 pm

Re: nrnivmodl compiling in Linux

Post by sanjaybioe »

Dear Tom, what if it is opensuse 13.1? I too get the same error on lncurses.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: nrnivmodl compiling in Linux

Post by ted »

Use your distribution's package manager to discover and install the package(s) that it needs for development or compilation of programs that use ncurses.
oren
Posts: 55
Joined: Fri Mar 22, 2013 1:03 am

Re: nrnivmodl compiling in Linux

Post by oren »

Hi usually when I get this problem in a new computer (ubuntu) I do the following:

Code: Select all

sudo apt-get install libncurses-dev
luadam4c
Posts: 1
Joined: Wed Mar 28, 2018 6:44 pm

Re: nrnivmodl compiling in Linux

Post by luadam4c »

I needed this as well (Ubuntu 18.04 LTS):

Code: Select all

sudo apt-get install gcc
For some reason synaptic didn't pick this up.
rgerkin
Posts: 10
Joined: Fri Oct 06, 2017 11:38 am

Re: nrnivmodl compiling in Linux

Post by rgerkin »

If anyone gets here running NEURON with a miniconda installation, this is why it is happening and how to solve it:

Your default gcc may be on the miniconda path (/path/to/miniconda/bin), and it will look in your miniconda path for libraries, too (/path/to/miniconda/lib). apt-get won't install the ncurses libraries there, and miniconda's gcc won't look to where it does install. But you can do:

Code: Select all

conda install -c anaconda ncurses
And then run nrnivmodl as:

Code: Select all

nrnivmodl -loadflags "-L/path/to/miniconda/lib"
and then nrnivmodl will find the ncurses libraries and your mod files should compile.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: nrnivmodl compiling in Linux

Post by ted »

Thanks, rgerkin. Installation and configuration tips are always welcome.
Post Reply