If you can't compile mod files . . .

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

If you can't compile mod files . . .

Post by ted » Tue Aug 18, 2009 12:25 am

If you can't compile mod files, make sure that you have installed the "developer tools". See
Adding new mechanisms to NEURON
viewtopic.php?f=16&t=260
and also see
Problem: Mknrndll does not work
on the "Troubleshooting the OS X Installer" page
http://www.neuron.yale.edu/neuron/downl ... ac_install

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Sun Aug 10, 2014 8:28 pm

Hi,

I have compiled NEURON-7.3 from source on OSX mavericks (with--nrnpython and with--paranrn).

First I installed the appropriate version of Xcode, and then after the first incidence of the problem reported below, I removed it and reinstalled it. Also I have done the same with 'command line tools'. I am unsure if command line tools is redundant and included in Xcode, but I have done it anyway.

I still get the same problem. I can't compile *.mod files using nrnivmodl. This compilation still works on my Linux system. I think I have read all of the applicable trouble shooting, but I don't think it helps with this particular problem. Ie I have read:

..................
http://www.neuron.yale.edu/neuron/downl ... ac_install
Problem: Mknrndll does not work.
Solution: Install the Development environment that came with your system. The installer may be on your hard drive or on a separate system CD. Check the current OS X page to see if Apple mentions whether using the installer's default choices actually installs enough of the development environment. It is the "XCode" package that you need to install.
If you can't find your system CD, you can download XCode from the Apple web site. Be sure to get the version of XCode that matches your OS version, e.g. 10.4, and processor, e.g. Intel.
..................
and
..................
http://www.neuron.yale.edu/neuron/downl ... ac_install
Problem: Can't compile mod files.
Lion and Mountain Lion both need the latest version of the command line developer tools to compile mod files. Go to http://developer.apple.com/opensource and click on the "Download command line developer tools . . . " link. You'll have to sign in with your Apple ID and password.
..................


I compile a whole bunch of mechanisms, actually the list of mechanisms is repeated twice so its not really as big as it looks (output below)

Below is an example of the output.


MacBook-Pro:expericomp20140421 kappa$ nrnivmodl
/Users/kappa/project/expericomp20140421
AMPA.mod AMPAr.mod ANsyn.mod CA1ih.mod CA1ika.mod CA1ikdr.mod CA1ina.mod CaDynamics_E2.mod Ca_HVA.mod Ca_LVAst.mod GABAa.mod GABAar.mod GABAb.mod GABAbr.mod Gfluct.mod H.mod IA.mod IL.mod IL3.mod Iahp.mod Ican.mod Ih.mod Im.mod K_Pst.mod K_Tst.mod Kaxon.mod Kdend.mod Ksoma.mod LcaMig.mod NMDA.mod NMDAr.mod NaTa_t.mod NaTs2_t.mod Naaxon.mod Nadend.mod Nap_Et2.mod Nasoma.mod SK_E2.mod SKv3_1.mod STDPE2Syn.mod ampa_syn.mod ampanmda.mod bgka.mod burststim2.mod ca.mod cagk.mod cal.mod calH.mod caolmw.mod capr.mod car.mod cat.mod ccanl.mod cp.mod cp2.mod epsp.mod expsid.mod fi.mod field.mod gammastim.mod gap.mod gskch.mod hNa.mod hha2.mod hha_old.mod icaolmw.mod icapr.mod ichan2.mod iholmkop.mod iholmw.mod ihpyrkop.mod infot.mod intf_.mod intfsw.mod kad.mod kahppr.mod kaolmkop.mod kap.mod kapyrkop.mod kca.mod kcaolmw.mod kcpr.mod kdr2.mod kdrbwb.mod kdrolmkop.mod kdrpr.mod kdrpyrkop.mod km.mod kmbg.mod kv.mod misc.mod my_c_code_compiled_as.mod my_exp2syn.mod naf2.mod nafbwb.mod nafolmkop.mod nafpr.mod nafpyrkop.mod nap.mod nca.mod ntIh.mod nthh.mod ntt.mod pregencv.mod regn_stim.mod somacar.mod staley.mod stats.mod updown.mod vecevent.mod vecst.mod xtra2.mod
AMPA.mod AMPAr.mod ANsyn.mod CA1ih.mod CA1ika.mod CA1ikdr.mod CA1ina.mod CaDynamics_E2.mod Ca_HVA.mod Ca_LVAst.mod GABAa.mod GABAar.mod GABAb.mod GABAbr.mod Gfluct.mod H.mod IA.mod IL.mod IL3.mod Iahp.mod Ican.mod Ih.mod Im.mod K_Pst.mod K_Tst.mod Kaxon.mod Kdend.mod Ksoma.mod LcaMig.mod NMDA.mod NMDAr.mod NaTa_t.mod NaTs2_t.mod Naaxon.mod Nadend.mod Nap_Et2.mod Nasoma.mod SK_E2.mod SKv3_1.mod STDPE2Syn.mod ampa_syn.mod ampanmda.mod bgka.mod burststim2.mod ca.mod cagk.mod cal.mod calH.mod caolmw.mod capr.mod car.mod cat.mod ccanl.mod cp.mod cp2.mod epsp.mod expsid.mod fi.mod field.mod gammastim.mod gap.mod gskch.mod hNa.mod hha2.mod hha_old.mod icaolmw.mod icapr.mod ichan2.mod iholmkop.mod iholmw.mod ihpyrkop.mod infot.mod intf_.mod intfsw.mod kad.mod kahppr.mod kaolmkop.mod kap.mod kapyrkop.mod kca.mod kcaolmw.mod kcpr.mod kdr2.mod kdrbwb.mod kdrolmkop.mod kdrpr.mod kdrpyrkop.mod km.mod kmbg.mod kv.mod misc.mod my_c_code_compiled_as.mod my_exp2syn.mod naf2.mod nafbwb.mod nafolmkop.mod nafpr.mod nafpyrkop.mod nap.mod nca.mod ntIh.mod nthh.mod ntt.mod pregencv.mod regn_stim.mod somacar.mod staley.mod stats.mod updown.mod vecevent.mod vecst.mod xtra2.mod
"/Applications/NEURON-7.3/nrn/share/nrn/libtool" --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I"/Applications/NEURON-7.3/nrn/include/nrn" -I"/Applications/NEURON-7.3/nrn/x86_64/lib" -g -O2 -c -o AMPAr.lo `test -f 'AMPAr.c' || echo '/'`AMPAr.c
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I/Applications/NEURON-7.3/nrn/include/nrn -I/Applications/NEURON-7.3/nrn/x86_64/lib -g -O2 -c AMPAr.c -fno-common -DPIC -o .libs/AMPAr.o
In file included from AMPAr.c:265:
../misc.h:8:10: fatal error: 'values.h' file not found
#include <values.h>
^
1 error generated.
make: *** [AMPAr.lo] Error 1
MacBook-Pro:expericomp20140421 kappa$


The problem is here.
In file included from AMPAr.c:265:
../misc.h:8:10: fatal error: 'values.h' file not found
#include <values.h>

but if I deleted AMPAr.mod a similar problem would emerge somewhere else. Other similar errors which would also emerge are related to features.h. I get the sense that nrnivmodl is not properly linked up to some library or something, but since I have done all of the recommended troubleshooting steps I don't know how to remediate this.

The following works however. So I think that my system could compile mod files at some point. Although I get the sense that there might be a difference in creating NEURONs in built mechanisms when building NEURON initially, and compiling mechanisms after NEURON is built.

MacBook-Pro:bin kappa$ ./neurondemo
NEURON -- VERSION 7.3 ansi (1078:2b0c984183df) 2014-04-04
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2014
See http://www.neuron.yale.edu/neuron/credits

loading membrane mechanisms from /Applications/NEURON-7.3/nrn/share/nrn/demo/release/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod
oc>

Any help would be greatly appreciated.
Thanks.
Russell.

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

Re: If you can't compile mod files . . .

Post by ted » Sun Aug 10, 2014 11:28 pm

The fact that neurondemo runs means your installation can compile most mod files (why "most"? more below).
I get the sense that there might be a difference in creating NEURONs in built mechanisms when building NEURON initially, and compiling mechanisms after NEURON is built.
The mechanisms needed by neurondemo are compiled the first time you execute neurondemo. They are not "built into" NEURON nor are they compiled on installation of NEURON. At least that's the case for MSWin and Linux. I don't use OS X but it would surprise me if NEURON under that os differed substantively from the Linux installation.

Two key points here:
1. If some of those mod files are the ones I think they are, you're using some rather arcane code. It is possible that one or more of them contains some trick statements that no longer work; if that is true, its cause needs to be determined and fixed.

2. This version
7.3 ansi (1078:2b0c984183df) 2014-04-04
is aready somewhat dated. There have been many bug fixes since then. Maybe one of them takes care of the problem you're encountering.

So I'd like to ask you to do the following and see if the problem goes away.

A. Delete your current installations of InterViews and NEURON.

B. Get the latest source code from NEURON's mercurial repositories
hg clone http://www.neuron.yale.edu/hg/neuron/iv
hg clone http://www.neuron.yale.edu/hg/neuron/nrn
Then
cd nrn
hg update ansi

C. Install InterViews
cd ../iv
./build.sh
then configure, make, and make install

D. Install NEURON
cd ../nrn
./build.sh
then configure, make, and make install

E. Verify that neurondemo works.

F. In the directory that contains your particular set of mod files, look for the .o and .c files and the .dll that were created by running mknrndll or whatever you run to compile mod files (nrnivmodl under Linux).

G. Run mknrndll and see if it now works.

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Mon Aug 11, 2014 8:14 pm

Hi Ted,

Okay I am using the new build. I compiled without interviews since, the make for interviews fails due to error 'can't find X' and I am not really using it anyway. The same situtation occurs in that $sudo make after_install is able to compile a small basic list of *.mod files as discussed previously however. I still get the same errors when trying to compile the big list of *.mod files.

Is it possible that errors can propogate through .mod files in unpredictable ways. Ie is it possible that error at AMPA.mod is not the main source of the problem? I am going to start deleting mod files now to see if I can improve the situation.

Successfully created x86_64/special
NEURON -- VERSION 7.3 ansi (1119:b3f8ab0f8203) 2014-07-18
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2014
See http://www.neuron.yale.edu/neuron/credits

Additional mechanisms from files
cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod



MacBook-Pro:expericomp20140421 kappa$ nrnivmodl
/Users/kappa/project/expericomp20140421
AMPA.mod AMPAr.mod ANsyn.mod CA1ih.mod CA1ika.mod CA1ikdr.mod CA1ina.mod CaDynamics_E2.mod Ca_HVA.mod Ca_LVAst.mod GABAa.mod GABAar.mod GABAb.mod GABAbr.mod Gfluct.mod H.mod IA.mod IL.mod IL3.mod Iahp.mod Ican.mod Ih.mod Im.mod K_Pst.mod K_Tst.mod Kaxon.mod Kdend.mod Ksoma.mod LcaMig.mod NMDA.mod NMDAr.mod NaTa_t.mod NaTs2_t.mod Naaxon.mod Nadend.mod Nap_Et2.mod Nasoma.mod SK_E2.mod SKv3_1.mod ampa_syn.mod ampanmda.mod bgka.mod burststim2.mod ca.mod cagk.mod cal.mod calH.mod caolmw.mod capr.mod car.mod cat.mod ccanl.mod cp.mod cp2.mod epsp.mod expsid.mod fi.mod field.mod gammastim.mod gap.mod gskch.mod hNa.mod hha2.mod hha_old.mod icaolmw.mod icapr.mod ichan2.mod iholmkop.mod iholmw.mod ihpyrkop.mod infot.mod intf_.mod intfsw.mod kad.mod kahppr.mod kaolmkop.mod kap.mod kapyrkop.mod kca.mod kcaolmw.mod kcpr.mod kdr2.mod kdrbwb.mod kdrolmkop.mod kdrpr.mod kdrpyrkop.mod km.mod kmbg.mod kv.mod misc.mod my_c_code_compiled_as.mod my_exp2syn.mod naf2.mod nafbwb.mod nafolmkop.mod nafpr.mod nafpyrkop.mod nap.mod nca.mod ntIh.mod nthh.mod ntt.mod pregencv.mod regn_stim.mod somacar.mod staley.mod stats.mod updown.mod vecevent.mod vecst.mod xtra2.mod
AMPA.mod AMPAr.mod ANsyn.mod CA1ih.mod CA1ika.mod CA1ikdr.mod CA1ina.mod CaDynamics_E2.mod Ca_HVA.mod Ca_LVAst.mod GABAa.mod GABAar.mod GABAb.mod GABAbr.mod Gfluct.mod H.mod IA.mod IL.mod IL3.mod Iahp.mod Ican.mod Ih.mod Im.mod K_Pst.mod K_Tst.mod Kaxon.mod Kdend.mod Ksoma.mod LcaMig.mod NMDA.mod NMDAr.mod NaTa_t.mod NaTs2_t.mod Naaxon.mod Nadend.mod Nap_Et2.mod Nasoma.mod SK_E2.mod SKv3_1.mod ampa_syn.mod ampanmda.mod bgka.mod burststim2.mod ca.mod cagk.mod cal.mod calH.mod caolmw.mod capr.mod car.mod cat.mod ccanl.mod cp.mod cp2.mod epsp.mod expsid.mod fi.mod field.mod gammastim.mod gap.mod gskch.mod hNa.mod hha2.mod hha_old.mod icaolmw.mod icapr.mod ichan2.mod iholmkop.mod iholmw.mod ihpyrkop.mod infot.mod intf_.mod intfsw.mod kad.mod kahppr.mod kaolmkop.mod kap.mod kapyrkop.mod kca.mod kcaolmw.mod kcpr.mod kdr2.mod kdrbwb.mod kdrolmkop.mod kdrpr.mod kdrpyrkop.mod km.mod kmbg.mod kv.mod misc.mod my_c_code_compiled_as.mod my_exp2syn.mod naf2.mod nafbwb.mod nafolmkop.mod nafpr.mod nafpyrkop.mod nap.mod nca.mod ntIh.mod nthh.mod ntt.mod pregencv.mod regn_stim.mod somacar.mod staley.mod stats.mod updown.mod vecevent.mod vecst.mod xtra2.mod
"/Applications/NEURON-7.3/nrn/share/nrn/libtool" --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I"/Applications/NEURON-7.3/nrn/include/nrn" -I"/Applications/NEURON-7.3/nrn/x86_64/lib" -g -O2 -c -o AMPAr.lo `test -f 'AMPAr.c' || echo '/'`AMPAr.c
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I/Applications/NEURON-7.3/nrn/include/nrn -I/Applications/NEURON-7.3/nrn/x86_64/lib -g -O2 -c AMPAr.c -fno-common -DPIC -o .libs/AMPAr.o
In file included from AMPAr.c:265:
../misc.h:8:10: fatal error: 'values.h' file not found
#include <values.h>
^
1 error generated.
make: *** [AMPAr.lo] Error 1

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Mon Aug 11, 2014 8:36 pm

Hi Ted,

I deleted a lot of mechanisms, especially AMPA*.mod, GABA*.mod and NMDA*.mod but I still seem to be having the problems. I don't want to delete the file field.mod because I am doing an extracellular potential simulation. Please let me know if you have any other ideas :)

MacBook-Pro:expericomp20140421 kappa$ nrnivmodl
/Users/kappa/project/expericomp20140421
CA1ih.mod CA1ika.mod CA1ikdr.mod CA1ina.mod CaDynamics_E2.mod Ca_HVA.mod Ca_LVAst.mod Gfluct.mod H.mod IL.mod IL3.mod Iahp.mod Ican.mod Im.mod K_Pst.mod K_Tst.mod NaTa_t.mod NaTs2_t.mod Naaxon.mod Nadend.mod Nap_Et2.mod SK_E2.mod SKv3_1.mod ampa_syn.mod ampanmda.mod ca.mod caolmw.mod capr.mod cp.mod cp2.mod epsp.mod expsid.mod fi.mod field.mod gammastim.mod gap.mod icaolmw.mod icapr.mod iholmkop.mod iholmw.mod ihpyrkop.mod infot.mod intf_.mod intfsw.mod kahppr.mod kaolmkop.mod kapyrkop.mod kcaolmw.mod kcpr.mod kdr2.mod kdrbwb.mod kdrolmkop.mod kdrpr.mod kdrpyrkop.mod kmbg.mod kv.mod misc.mod naf2.mod nafbwb.mod nafolmkop.mod nafpr.mod nafpyrkop.mod nap.mod ntIh.mod nthh.mod ntt.mod pregencv.mod staley.mod stats.mod updown.mod vecevent.mod vecst.mod xtra2.mod
CA1ih.mod CA1ika.mod CA1ikdr.mod CA1ina.mod CaDynamics_E2.mod Ca_HVA.mod Ca_LVAst.mod Gfluct.mod H.mod IL.mod IL3.mod Iahp.mod Ican.mod Im.mod K_Pst.mod K_Tst.mod NaTa_t.mod NaTs2_t.mod Naaxon.mod Nadend.mod Nap_Et2.mod SK_E2.mod SKv3_1.mod ampa_syn.mod ampanmda.mod ca.mod caolmw.mod capr.mod cp.mod cp2.mod epsp.mod expsid.mod fi.mod field.mod gammastim.mod gap.mod icaolmw.mod icapr.mod iholmkop.mod iholmw.mod ihpyrkop.mod infot.mod intf_.mod intfsw.mod kahppr.mod kaolmkop.mod kapyrkop.mod kcaolmw.mod kcpr.mod kdr2.mod kdrbwb.mod kdrolmkop.mod kdrpr.mod kdrpyrkop.mod kmbg.mod kv.mod misc.mod my_c_code_compiled_as.mod naf2.mod nafbwb.mod nafolmkop.mod nafpr.mod nafpyrkop.mod nap.mod ntIh.mod nthh.mod ntt.mod pregencv.mod staley.mod stats.mod updown.mod vecevent.mod vecst.mod xtra2.mod
"/Applications/NEURON-7.3/nrn/share/nrn/libtool" --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I"/Applications/NEURON-7.3/nrn/include/nrn" -I"/Applications/NEURON-7.3/nrn/x86_64/lib" -g -O2 -c -o field.lo `test -f 'field.c' || echo '/'`field.c
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I/Applications/NEURON-7.3/nrn/include/nrn -I/Applications/NEURON-7.3/nrn/x86_64/lib -g -O2 -c field.c -fno-common -DPIC -o .libs/field.o
In file included from field.c:198:
../misc.h:8:10: fatal error: 'values.h' file not found
#include <values.h>
^
1 error generated.
make: *** [field.lo] Error 1


Thanks for any help.

Russell.

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

Re: If you can't compile mod files . . .

Post by ted » Mon Aug 11, 2014 9:25 pm

R_Jarvis wrote:I compiled without interviews since, the make for interviews fails due to error 'can't find X' and I am not really using it anyway.
That's too bad. Using NEURON without being able to use its gui tools for model specification and display of simulation results is a bit like trying to drive a car while blindfolded. What release of OS X are you using, is it 32 bit or 64 bit, and if it's 64 bit have you installed X11 (would expect that to be part of XQuartz)?
R_Jarvis wrote:Is it possible that errors can propogate through .mod files in unpredictable ways
No.
is it possible that error at AMPA.mod is not the main source of the problem?
Maybe, if that file tries to include some .c or .h file that doesn't exist. Looks like values.h is missing. I'd expect that to be included with the "developer tools"

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Tue Aug 12, 2014 12:29 am

Hi Ted,

I forgot to mention previously All of NEURON, Python and MPI work togethor, just not NMDOL compilation. I do find working this way to be like driving a car blindfolded I am familiar with the GUI tools, its just that I am debugging code designed to work with MPI on HPC. Different morphologies exist on different CPUs. I am mainly using python to plot membrane potentials/spike trains. I think you can access many menu items, programatically anyway.

I did install XQuartz, as described here: http://www.neuron.yale.edu/neuron/downl ... ilestd_osx
However I feel that some initial step is required to help the compiler find the X11 environment.

The instructions for compiling parallel NEURON with Python on OSX are a bit more elaborate at the LFPy website. I wonder if I should consider any of the stated options too.
http://compneuro.umb.no/LFPy/information.html

./configure --prefix=/Applications/NEURON-7.3/nrn --with-iv=/Applications/NEURON-7.3/iv \
--with-x --x-includes=/usr/X11/include/ --x-libraries=/usr/X11/lib/ \
--with-nrnpython=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python \
--host=x86_64-apple-darwin10.7.0 --build=x86_64-apple-darwin10.7.0

My current system is 64 bit (the one that is causing all of these problems, the *.mod files previously successfully compiled on 32 bit Linux system, and also a 64bit CENTOS HPC environment for that matter).

Here are some results of $system_profiler

OSX Mavericks. 13.3.0 Darwin Kernel Version 13.3.0


Xcode:

Version: 5.1.1

Obtained from: Mac App Store

Last Modified: 11/08/2014 9:16 am

Kind: Intel

64-Bit (Intel): Yes

Signed by: Apple Mac OS Application Signing, Apple Worldwide Developer Relations Certification Authority, Apple Root CA

Location: /Applications/Xcode.app



Install Command Line Developer Tools:



Version: 1.0

Obtained from: Apple

Last Modified: 26/09/2013 10:47 am

Kind: Intel

64-Bit (Intel): Yes

Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA

Location: /System/Library/CoreServices/Install Command Line Developer Tools.app



Install Command Line Developer Tools:


Version: 1.0

Obtained from: Apple

Last Modified: 26/09/2013 10:47 am

Kind: Intel

64-Bit (Intel): Yes

Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA

Location: /System/Library/CoreServices/Install Command Line Developer Tools.app


Thanks again for any help.
Russell.

hines
Site Admin
Posts: 1526
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines » Tue Aug 12, 2014 8:56 am

Although values.h is present on many machines, apparently it is a nonstandard file. When I look at the version of that file on my ubunutu 12.04 machine it says:

Code: Select all

/* Old compatibility names for <limits.h> and <float.h> constants.
...
/* This interface is obsolete.  New programs should use
   <limits.h> and/or <float.h> instead of <values.h>.  */
When I search for values.h in modeldb. I occasionally see repairs of this type. eg. in the lytton99 model vecst.mod.orig has
#include <values.h> /* contains MAXLONG */
but in vecst.mod it reads
#include <float.h> /* contains MAXLONG */

You may wish to return to the dmg you have been using or try
http://www.neuron.yale.edu/ftp/neuron/v ... 10.7.5.dmg
With regard to building from sources, it is not clear to me why you would have an x11 problem during configuration if you installed xquartz and xcode command line tools, but a clue about what went wrong would be available
in config.log.

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Sat Aug 16, 2014 11:23 pm

I tried susbstitting #include <values.h> for #include <limits.h> and also separatly #include <float.h>. However this lead to different problems.
I decided to dual boot 64 bit Linux instead. Everything works on linux, possibly because of differences in the development environment.

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Tue Dec 09, 2014 5:54 pm

Hi,
I recently reinstalled NEURON on Yosemite with new version of XQuartz, updated Xtools, and neuron-7.4 from mercurial. Now Interviews compiles (new version of XQuartz), however NMODL still will not compile due to same error. The AMPAr.NMODL file compiles in linux without any modification. However on OS X Yosemite:

mpicc -DHAVE_CONFIG_H -I. -I.. -I/Applications/NEURON-7.4/nrn-7.4/include/nrn -I/Applications/NEURON-7.4/nrn-7.4/x86_64/lib -g -O2 -c AMPAr.c -fno-common -DPIC -o .libs/AMPAr.o
In file included from AMPAr.c:265:
../misc.h:8:10: fatal error: 'values.h' file not found
#include <values.h>

1 error generated.
make: *** [AMPAr.lo] Error 1

Thanks for any help.

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Tue Dec 09, 2014 6:12 pm

Also the script /nrn/src/mac/after_install.sh script still compiles a working selection of NMODL mechanisms. I wonder which lines in this script are responsible for building the *.mod files? I should try building the mod files in the directory using this method of compiling them instead of the regular $nrnivmodl way as a check.

Also I got another error for interviews post compilation (nrngui does revert to a useable nrniv prompt after this error however).

NEURON -- VERSION 7.4 (1196:92359406f65c) 92359406f65c
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2014
See http://www.neuron.yale.edu/neuron/credits

AttributeError: 'module' object has no attribute '_has_scipy'
/Applications/NEURON-7.4/nrn-7.4/x86_64/bin/nrniv: No attribute: _has_scipy
in /Applications/NEURON-7.4/nrn-7.4/share/nrn/lib/hoc/nrngui.hoc near line 2
nrnmainmenu()
^

hines
Site Admin
Posts: 1526
Joined: Wed May 18, 2005 3:32 pm

Re: If you can't compile mod files . . .

Post by hines » Wed Dec 10, 2014 6:17 am

What error results when you replace values.h with limits.h and also use
#include <float.h>

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Thu Dec 11, 2014 1:18 am

Hi,

>>What error results when you replace values.h with limits.h and also use
#include <float.h>

Thanks for reply.

If I substitute values.h for limits.h and also add #include "float.h" on just the file 'field.mod' for example then it compiles with warnings and generates the following:

field
Translating field.mod into field.c
Notice: VERBATIM blocks are not thread safe
Notice: Use of POINTER is not thread safe.
"/Users/kappa/nrn-7.3/share/nrn/libtool" --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I"/Users/kappa/nrn-7.3/include/nrn" -I"/Users/kappa/nrn-7.3/x86_64/lib" -g -O2 -c -o field.lo `test -f 'field.c' || echo '/'`field.c
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I/Users/kappa/nrn-7.3/include/nrn -I/Users/kappa/nrn-7.3/x86_64/lib -g -O2 -c field.c -fno-common -DPIC -o .libs/field.o
field.c:212:86: warning: implicit declaration of function 'hxe' is invalid in C99 [-Wimplicit-function-declaration]
if (num>NSW) { printf("FIELD initwrec() WARN: can only store %d ww vecs\n",NSW); hxe();}
^
field.c:215:13: warning: implicit declaration of function 'list_vector_px2' is invalid in C99 [-Wimplicit-function-declaration]
cap = list_vector_px2(ob, k, &wwo[k], &ww[k]);
^
field.c:217:65: warning: format specifies type 'int' but the argument has type 'double' [-Wformat]
printf("FIELD initwrec ERR w-vecs size err: %d,%d,%d",k,wwsz,cap); hxe(); }
~~ ^~~~
%f
field.c:40:14: note: expanded from macro 'wwsz'
#define wwsz _p[2]
^~~~~
field.c:369:37: warning: implicit declaration of function 'vector_newsize' is invalid in C99 [-Wimplicit-function-declaration]
for (k=0;k<(int)nsw;k++) wwo[k]=vector_newsize(ww[k],wwsz);
^
field.c:369:36: warning: incompatible integer to pointer conversion assigning to 'double *' from 'int' [-Wint-conversion]
for (k=0;k<(int)nsw;k++) wwo[k]=vector_newsize(ww[k],wwsz);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
"/Users/kappa/nrn-7.3/share/nrn/libtool" --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I"/Users/kappa/nrn-7.3/include/nrn" -I"/Users/kappa/nrn-7.3/x86_64/lib" -g -O2 -c -o mod_func.lo mod_func.c
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I/Users/kappa/nrn-7.3/include/nrn -I/Users/kappa/nrn-7.3/x86_64/lib -g -O2 -c mod_func.c -fno-common -DPIC -o .libs/mod_func.o
"/Users/kappa/nrn-7.3/share/nrn/libtool" --tag=CC --mode=link mpicc -module -g -O2 -headerpad_max_install_names -o libnrnmech.la -rpath "/Users/kappa/nrn-7.3/x86_64/lib" field.lo mod_func.lo -L"/Users/kappa/nrn-7.3/x86_64/lib" -lnrnoc -loc -lmemacs -lnrnmpi -lscopmath -lsparse13 -lreadline -lncurses -L"/Users/kappa/nrn-7.3/x86_64/lib" "/Users/kappa/nrn-7.3/x86_64/lib/libnrniv.la" -livoc -lneuron_gnu -lmeschach -lsundials -livos
libtool: link: mpicc -Wl,-undefined -Wl,dynamic_lookup -o .libs/libnrnmech.0.so -bundle .libs/field.o .libs/mod_func.o -L/Users/kappa/nrn-7.3/x86_64/lib /Users/kappa/nrn-7.3/x86_64/lib/libnrnoc.dylib /Users/kappa/nrn-7.3/x86_64/lib/liboc.dylib -L/usr/X11/lib -lX11 /Users/kappa/nrn-7.3/x86_64/lib/libmemacs.dylib /Users/kappa/nrn-7.3/x86_64/lib/libnrnmpi.dylib /Users/kappa/nrn-7.3/x86_64/lib/libscopmath.dylib /Users/kappa/nrn-7.3/x86_64/lib/libsparse13.dylib -lreadline -lncurses /Users/kappa/nrn-7.3/x86_64/lib/libnrniv.dylib /Users/kappa/nrn-7.3/x86_64/lib/libivoc.dylib /Users/kappa/nrn-7.3/x86_64/lib/libneuron_gnu.dylib /Users/kappa/nrn-7.3/x86_64/lib/libmeschach.dylib /Users/kappa/nrn-7.3/x86_64/lib/libsundials.dylib /Users/kappa/nrn-7.3/x86_64/lib/libivos.dylib -g -O2
libtool: link: (cd ".libs" && rm -f "libnrnmech.so" && ln -s "libnrnmech.0.so" "libnrnmech.so")
libtool: link: ( cd ".libs" && rm -f "libnrnmech.la" && ln -s "../libnrnmech.la" "libnrnmech.la" )
Successfully created x86_64/special
bash-3.2$ ls
field.mod x86_64
bash-3.2$

I could probably use sed to make this substition in all of the mod files. Do you think this would also work in linux? Otherwise the substitution could reduce the portability of the code.

Also as would be expected all of the files in /Applications/NEURON-7.4/nrn-7.4/share/nrn/demo/release compile fine with the command $nrnivmodl.

Thanks for help.

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

Re: If you can't compile mod files . . .

Post by ted » Sat Dec 13, 2014 6:48 pm

Code: Select all

as would be expected all of the files in /Applications/NEURON-7.4/nrn-7.4/share/nrn/demo/release compile fine with the command $nrnivmodl.
That's good. I'm puzzled about why it is necessary to do anything to other mod files.
I could probably use sed to make this substition in all of the mod files. Do you think this would also work in linux? Otherwise the substitution could reduce the portability of the code.
I'm running Linux, and it has never been necessary to do that to mod files. Why the problem happens for you is a puzzle to me.

R_Jarvis

Re: If you can't compile mod files . . .

Post by R_Jarvis » Mon Jan 05, 2015 11:32 pm

[quote="ted"]That's good. I'm puzzled about why it is necessary to do anything to other mod files.[quote]

I answered too hastily above, sorry for the confustion. No modifications are required for the other mod files, its only required to adapt misc.h.

Post Reply