Necessary environment for custom NEURON compilation

Post Reply
neuromau
Posts: 95
Joined: Mon Apr 20, 2009 7:02 pm

Necessary environment for custom NEURON compilation

Post by neuromau » Mon Oct 07, 2013 2:05 pm

Hello, I'm following the directions for compiling the standard NEURON 7.3 dist on my Windows 8 64-bit machine using 64-bit Cygwin (http://neuron.yale.edu/neuron/download/compile_mswin). I get errors during make. Not sure if I am missing some Cygwin packages; here are some relevant ones I have installed:
Cygwin Package Information
Package Version Status
bash 4.1.11-2 OK
binutils 2.23.52-5 OK
bzip2 1.0.6-2 OK
cygwin 1.7.25-1 OK
gcc-core 4.8.1-3 OK
gcc-g++ 4.8.1-3 OK
gzip 1.4-1 OK
m4 1.4.17-1 OK
make 3.82.90-1 OK
The configure command works fine, but then I run into trouble with the make command:
IV-Win/cursor.cpp: In static member function 'static void ivCursor::init()':
IV-Win/cursor.cpp:90:29: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
arrow = new Cursor(cp2int IDC_ARROW);
libtool: link: cannot find the library `../../lib/libIVhines.la' or unhandled argument `../../lib/libIVhines.la'
I tried setting some environmental variables that had previously been blank, but the errors still appeared:

Code: Select all

export CPATH=/cygdrive/c/cygwin64/usr/include/
export LIBRARY_PATH=/cygdrive/c/cygwin64/lib
export LD_LIBRARY_PATH=/cygdrive/c/cygwin64/lib
The whole make log is below:
$ make
Making all in src
make[1]: Entering directory `/cygdrive/c/neuron/iv/src'
Making all in lib
make[2]: Entering directory `/cygdrive/c/neuron/iv/src/lib'
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c Dispatch/dispatcher.cpp -DDLL_EXPORT -DPIC -o Dispatch/.libs/dispatcher.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c Dispatch/iohandler.cpp -DDLL_EXPORT -DPIC -o Dispatch/.libs/iohandler.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-Win/bitmap.cpp -DDLL_EXPORT -DPIC -o IV-Win/.libs/bitmap.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-Win/brush.cpp -DDLL_EXPORT -DPIC -o IV-Win/.libs/brush.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-Win/canvas.cpp -DDLL_EXPORT -DPIC -o IV-Win/.libs/canvas.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-Win/canvas16.cpp -DDLL_EXPORT -DPIC -o IV-Win/.libs/canvas16.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-Win/color.cpp -DDLL_EXPORT -DPIC -o IV-Win/.libs/color.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I../include -g -O2 -c IV-Win/cursor.cpp -DDLL_EXPORT -DPIC -o IV-Win/.libs/cursor.o
In file included from /usr/include/w32api/windows.h:72:0,
from ../include/IV-Win/MWlib.h:42,
from IV-Win/cursor.cpp:34:
IV-Win/cursor.cpp: In static member function 'static void ivCursor::init()':
IV-Win/cursor.cpp:90:29: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
arrow = new Cursor(cp2int IDC_ARROW);
^
IV-Win/cursor.cpp:91:33: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
crosshairs = new Cursor(cp2int IDC_CROSS);
^
IV-Win/cursor.cpp:94:35: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
hourglass = new Cursor(cp2int IDC_WAIT);
^
IV-Win/cursor.cpp:95:35: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
upperleft = new Cursor(cp2int IDC_SIZENWSE);
^
IV-Win/cursor.cpp:96:36: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
upperright = new Cursor(cp2int IDC_SIZENESW);
^
IV-Win/cursor.cpp:97:32: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
lowerleft = new Cursor(cp2int IDC_SIZENESW);
^
IV-Win/cursor.cpp:98:36: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
lowerright = new Cursor(cp2int IDC_SIZENWSE);
^
Makefile:482: recipe for target `IV-Win/cursor.lo' failed
make[2]: *** [IV-Win/cursor.lo] Error 1
make[2]: Leaving directory `/cygdrive/c/neuron/iv/src/lib'
Making all in include
make[2]: Entering directory `/cygdrive/c/neuron/iv/src/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/cygdrive/c/neuron/iv/src/include'
Making all in bin
make[2]: Entering directory `/cygdrive/c/neuron/iv/src/bin'
Making all in idemo
make[3]: Entering directory `/cygdrive/c/neuron/iv/src/bin/idemo'
g++ -DHAVE_CONFIG_H -I. -I. -I../../include -g -O2 -c -o main.o main.cpp
/bin/sh ../../../libtool --mode=link g++ -g -O2 -mwindows -e _mainCRTStartup -o idemo main.o ../../lib/libIVhines.la -lgdi32 -lcomdlg32
libtool: link: cannot find the library `../../lib/libIVhines.la' or unhandled argument `../../lib/libIVhines.la'
Makefile:124: recipe for target `idemo' failed
make[3]: *** [idemo] Error 1
make[3]: Leaving directory `/cygdrive/c/neuron/iv/src/bin/idemo'
make[2]: Leaving directory `/cygdrive/c/neuron/iv/src/bin'
make[1]: Leaving directory `/cygdrive/c/neuron/iv/src'
Thanks

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

Re: Necessary environment for custom NEURON compilation

Post by hines » Tue Oct 08, 2013 4:50 am

IV-Win/cursor.cpp:90:29: error: cast from 'LPSTR {aka char*}' to 'int' loses precision [-fpermissive]
It appears that you might not have the latest repository code for InterViews. For example
http://www.neuron.yale.edu/hg/neuron/iv ... 622c9ebb60
contains a specific fix for the above problem and there have also been 10 subsequent change sets as well.

neuromau
Posts: 95
Joined: Mon Apr 20, 2009 7:02 pm

Re: Necessary environment for custom NEURON compilation

Post by neuromau » Tue Oct 08, 2013 5:47 am

Correct, I was using the standard 7.3 code. I had assumed my environment was missing something and didn't think to try a newer version, sorry. I now pulled in the latest code from Mercurial and ran build.sh on version (19:44d6ec5724f4), and I'm not sure if the warnings it gave can be ignored, so I tried ignoring them, but got other warnings during the configure step, so I stopped. Both logs are below.

I have these versions:
automake - 1.14
autoconf - 2.6.9
libtool - 2.4.2

When I ran build.sh, it gave:
$ ./build.sh
aclocal-1.14: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:247: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
m4/withmpi.m4:136: AC_NRN_WITH_METIS is expanded from...
configure.in:247: the top level
libtoolize -c -f -i
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./config.guess'
libtoolize: copying file `./config.sub'
libtoolize: copying file `./install-sh'
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
configure.in:247: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
m4/withmpi.m4:136: AC_NRN_WITH_METIS is expanded from...
configure.in:247: the top level
automake-1.14: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:247: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
m4/withmpi.m4:136: AC_NRN_WITH_METIS is expanded from...
configure.in:247: the top level
configure.in:197: installing './compile'
configure.in:12: installing './missing'
automake-1.14: warning: autoconf input should be named 'configure.ac', not 'configure.in'
src/e_editor/Makefile.am:22: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/e_editor/Makefile.am: installing './depcomp'
src/gnu/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/ivoc/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.in: installing './ylwrap'
src/ni_pci_6229/Makefile.am:18: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/nmodl/Makefile.am:14: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/nrniv/Makefile.am:100: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/nrnjava/Makefile.am:27: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/nrnmpi/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/nrnoc/Makefile.am:90: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:91: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:95: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:96: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:100: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:101: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:105: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:106: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:110: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:111: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:115: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:116: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:120: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:121: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:125: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:126: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:130: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:131: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:135: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:136: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:140: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:141: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:145: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:146: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:150: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:151: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:155: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:156: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:160: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:161: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:165: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:166: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:170: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:171: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:175: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:176: warning: *F: non-POSIX variable name
src/nrnoc/Makefile.am:56: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/nrnpython/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/oc/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/sundials/cvodes/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/sundials/ida/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/sundials/shared/Makefile.am:17: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/uxnrnbbs/Makefile.am:6: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
depcomp already extended to handle xlc. No change to file.
configure.in:247: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
/usr/src/packages/autoconf/26/64/autoconf2.5-2.69-2/src/autoconf-2.69/lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
m4/withmpi.m4:136: AC_NRN_WITH_METIS is expanded from...
configure.in:247: the top level

When I then ran the configure command, it gave the following response:
$ ./configure --prefix=`pwd`
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
CYGWIN=yes
MINGW=no
./configure: line 2630: AC_DISABLE_STATIC: command not found
./configure: line 2631: AC_ENABLE_SHARED: command not found
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
./configure: line 3296: AC_PROG_LIBTOOL: command not found
./configure: line 3298: AC_CHECK_LIBM: command not found
./configure: line 3310: AC_CXX_NAMESPACES: command not found
./configure: line 3311: AC_CXX_HAVE_SSTREAM: command not found
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking stream.h usability... no
checking stream.h presence... no
checking for stream.h... no
in ivstream.h, the obuf.open(name, output) does not work with #undef HAVE_STREAM_H
trying the NO_OUTPUT_OPENMODE definition
in ivstream.h, obuf.open(name, std::ios_base::out) does not work with #undef HAVE_STREAM_H
Fix iv-14/src/include/ivstream.h in such a way that configure
does not stop here.
Thanks.

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

Re: Necessary environment for custom NEURON compilation

Post by hines » Tue Oct 08, 2013 11:30 am

in ivstream.h, the obuf.open(name, output) does not work with #undef HAVE_STREAM_H
trying the NO_OUTPUT_OPENMODE definition
in ivstream.h, obuf.open(name, std::ios_base::out) does not work with #undef HAVE_STREAM_H
Fix iv-14/src/include/ivstream.h in such a way that configure
does not stop here.
I generally ignore the warnings until an error can be traced to them. In the above case, the issue is specific to ivstream.h not using the proper system
include files. It is very likely this has nothing to do with the autotools.
Unfortunately, I'm out of town til Oct 23 and don't have access to the windows virtual box that has cygwin 64 installed. So I'm not sure what
#define were finally used to work around the problem. It takes a lot of time to install cygwin 64 but I'll see if I can reproduce the problem on my
mac air as the host for a windows virtual box guest. This is likely to take me a few days.

neuromau
Posts: 95
Joined: Mon Apr 20, 2009 7:02 pm

Re: Necessary environment for custom NEURON compilation

Post by neuromau » Tue Oct 08, 2013 11:54 am

Okay, thanks, I appreciate it! Also, if there's anything you want me to try on my machine, let me know. I don't mind editing files and trying the compile again, if you have some ideas of what edits might work.

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

Re: Necessary environment for custom NEURON compilation

Post by hines » Wed Oct 09, 2013 3:42 am

I see the same problem and it is due to use of a very old automake. Try
export WANT_AUTOMAKE=1.11
and rerun build.sh
Might be a good idea to remove the repository and clone it again.

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

Re: Necessary environment for custom NEURON compilation

Post by hines » Wed Oct 09, 2013 5:30 am

Hold off for a day or so til I have built a cygwin 64 version of NEURON on my laptop. Apparently I had not pushed all the nrn respository changes needed as
I'm ending up having to reproduce all of them on my fresh cygwin64 installation. Anyway, send me an email, and I'll send back a couple of patches for iv and nrn.
I've built InterViews successfully and am a the last stages for nrn. So it shouldn't take too much longer to get a working version. Do you need an MPI enabled
version?

Post Reply