Trouble during 'make install'

hlinden
Posts: 4
Joined: Wed Nov 06, 2013 7:44 am

Trouble during 'make install'

Post by hlinden » Wed Nov 06, 2013 8:36 am

Hello,

I am trying to install Neuron on a computer running OSX 10.9 and have followed the instructions at http://www.neuron.yale.edu/neuron/downl ... ilestd_osx

Everything works fine until I try 'make install', after which I get the following error:

Code: Select all

/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-exec-hook
echo "enter install-exec-hook in nrn/Makefile.am"
enter install-exec-hook in nrn/Makefile.am
if test "--home=/Applications/NEURON-7.3/nrn" != "no" ; then \
		cd src/nrnpython ; \
		/usr/local/bin/python setup.py install --home=/Applications/NEURON-7.3/nrn ;\
	fi
running install
error: must supply either home or prefix/exec-prefix -- not both
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1
Does anyone have an idea what could be wrong here?

Any help is much appreciated!

Best, Henrik

PS. My configure line looks like this:

Code: Select all

../nrn/configure --prefix=$IDIR/nrn --with-iv=$IDIR/iv --with-nrnpython=dynamic CFLAGS='-O3 -Wno-return-type -Wno-implicit-function-declaration -Wno-implicit-int -fPIC' CXXFLAGS='-O3 -Wno-return-type -Wno-implicit-function-declaration -Wno-implicit-int -fPIC'

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

Re: Trouble during 'make install'

Post by hines » Wed Nov 06, 2013 10:34 am

Are you using the latest mercurial repository version? if so what is the result of
hg identify.
Alternatively, it seems that at least most of NEURON got installed and therefore, from a terminal window what is the result of
/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv -version
Lastly, what is the location and version of Python from
which python
python
This will help me try to reproduce the problem on my 10.9 os.

hlinden
Posts: 4
Joined: Wed Nov 06, 2013 7:44 am

Re: Trouble during 'make install'

Post by hlinden » Wed Nov 06, 2013 10:56 am

I believe I am using the most recent mercurial. Here are the outputs:

hg identify:
01f9410e41bc (Release 7.3) tip

/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv --version:
NEURON -- Release 7.3 (980:01f9410e41bc) 01f9410e41bc

which python:
/usr/local/bin/python

python:
Python 2.7.5 (default, Nov 5 2013, 22:13:48)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

I have installed Python via Brew.

I first tried installing the .dmg file for Mac, but deleted it manually from Applications before installing Neuron from the source files (since I wanted to be a able to configure manually), perhaps that is where the conflict comes from?

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

Re: Trouble during 'make install'

Post by hines » Wed Nov 06, 2013 12:08 pm

The above versions mentioned are exactly what I have on my machine and I'm unable to reproduce the problem.
Try the following. From a terminal window, cd to the nrn/src/nrnpython folder and execute
python setup.py install --home=/Applications/NEURON-7.3/nrn
and see if you get the same error. If so, try
python setup.py install --prefix=/Applications/NEURON-7.3/nrn/lib
When successful, the neuron module should be in /Applications/NEURON-7.3/nrn/lib/python

hlinden
Posts: 4
Joined: Wed Nov 06, 2013 7:44 am

Re: Trouble during 'make install'

Post by hlinden » Wed Nov 06, 2013 12:44 pm

When executing the first line you proposed I did get the same error message as before. But the second line worked!

After this I added the two following lines to my .bash_profile, and now everything seems to work fine.

Code: Select all

export PATH=/Applications/NEURON-7.3/nrn/x86_64/bin:$PATH
export PYTHONPATH=/Applications/NEURON-7.3/nrn/lib/lib/python2.7/site-packages:$PYTHONPATH
Is there a check I can do to make sure everything now has been installed properly?

Thanks a lot for the help!

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

Re: Trouble during 'make install'

Post by hines » Wed Nov 06, 2013 1:26 pm

From a terminal window you should be able to launch and exectute the import statement:
/Applications/NEURON-7.3/nrn/x86_64/bin/nrniv -python
from neuron import h

and with
export PYTHONPATH=/Applications/NEURON-7.3/nrn/lib/python
you should be able to execute the same import after launching python.

It is not at all clear to me why your environment allowed an explicit --prefix but refused the --home when installing the neuron module at the end of installation.
if this begins to happen regularly, it may make sense for me to modify the --home arg in the nrn/Makefile.am line that installs the neuron module.

hlinden
Posts: 4
Joined: Wed Nov 06, 2013 7:44 am

Re: Trouble during 'make install'

Post by hlinden » Thu Nov 07, 2013 8:01 am

Everything seems to work fine now in my installation. I also don't know why --home was refused while --prefix worked...
But thanks again for the help!

btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

Re: Trouble during 'make install'

Post by btorb » Fri Nov 08, 2013 6:56 pm

Sorry to enter this discussion but the topic seemed most relevant. I don't even get to the stage of compiling on Maverick (10.9).

"-bash: ./configure: No such file or directory"

I did install xcode and afterwards the command-line-tool (late cotober 2013). So I'm not sure what is going on (and it is the first time on a mac gain since years). Could you kickstart me on what I'm doing wrong. Once I get the ./configure running I'm sure I can follow the advices earlier in the thread from Henrik and Mike.

Thanks.

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

Re: Trouble during 'make install'

Post by hines » Fri Nov 08, 2013 11:47 pm

if you got the code from the mercurial repository, you have to execute
sh build.sh
to create the ./configure script. If that does not work you need to install recent versions of autoconf, automate, and
libtool. Otherwise use the *.tar.gz file from
http://www.neuron.yale.edu/ftp/neuron/v ... 7.3.tar.gz

btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

Re: Trouble during 'make install'

Post by btorb » Sun Nov 10, 2013 1:15 am

Oops. Forgot that one.

But now I run into another problem. Typically mac osx in my opinion:

ImportError: dlopen(/Users/btorb/local/lib/python2.7/site-packages/neuron/hoc.so, 2): Library not loaded: libreadline.6.2.dylib

At this point I compile without any LDFLAGS. Now nrniv works, but I cannot load ("import neuron") into python.

I do have this library. Even more than once and that is most likely the problem (libreadline.6.2.dylib also comes with anaconda which I used to install ipython).

If I evoke python in the directory where that library is located, it works. If I go to another directory it doesn't. If I set LD_LIBRARY_PATH to the directory containing the lib it also doesn't work.

UPDATE: the python versions appear to be messed up. I cannot run the mpi test because it cannot find python
btorb:~/anaconda/lib> mpirun -n 4 nrniv -mpi ~/local/neuron/nrn/src/parallel/test0.hoc
numprocs=4
NEURON -- Release 7.3 (980:01f9410e41bc) 01f9410e41bc
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Macosx comes with a python version, but I also installed the version shipped with anaconda to use (i)python.

While running the same test as python file, executed from the directory containing readline, it works well:
btorb:~/anaconda/lib> mpirun -n 4 python ~/local/neuron/nrn/src/parallel/test0.py
NEURON -- Release 7.3 (980:01f9410e41bc) 01f9410e41bc
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

NEURON -- Release 7.3 (980:01f9410e41bc) 01f9410e41bc
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

NEURON -- Release 7.3 (980:01f9410e41bc) 01f9410e41bc
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

NEURON -- Release 7.3 (980:01f9410e41bc) 01f9410e41bc
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

I am 0 of 1
I am 0 of 1
I am 0 of 1
I am 0 of 1
Any suggestions to convince my mac to load readline from that library without me having to "cd" there?

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

Re: Trouble during 'make install'

Post by hines » Tue Nov 12, 2013 11:37 am

To import neuron from a Python launch you undoubtedly need a PYTHONPATH. For this and some other useful comments see the log message at
http://www.neuron.yale.edu/hg/neuron/nr ... 0f78755a30

RTomsett

Re: Trouble during 'make install'

Post by RTomsett » Thu Apr 03, 2014 5:44 am

I appear to be running into the same issue as btorb, also using the Anaconda-provided Python (I'm on OSX 10.9.2). I got the latest NEURON from the Mercurial repository, and installed in /Applications/NEURON-7.3.

I can run nrngui from the terminal OK, but when I try to import neuron from within Python I get the same message:

Code: Select all

>>> from neuron import h
Traceback (most recent call last):
  File "stdin", line 1, in <module>
  File "/Applications/NEURON-7.3/nrn/lib/python/neuron/__init__.py", line 106, in <module>
    import neuron.hoc
ImportError: dlopen(/Applications/NEURON-7.3/nrn/lib/python/neuron/hoc.so, 2): Library not loaded: libreadline.6.2.dylib
  Referenced from: /Applications/NEURON-7.3/nrn/lib/python/neuron/hoc.so
  Reason: image not found
My .bash_profile looks like this:

Code: Select all

export PATH=/usr/local/bin:$PATH
export PATH="//anaconda/bin:$PATH"
export PYTHONPATH=~/lib/python:$PYTHONPATH
export PYTHONPATH=/Applications/NEURON-7.3/nrn/lib/lib/python2.7/site-packages:$PYTHONPATH

export PATH=$HOME/local/bin:$PATH
export LD_LIBRARY_PATH=$HOME/local/lib/
source ~/neuron/nrnenv
libreadline.6.2.dyblib is at /usr/local/Cellar/readline/6.2.4/lib/libreadline.6.2.dylib so I have tried various options for the --with-readline flag when running ./configure, pointing at/around this directory, but seemingly to no avail...

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

Re: Trouble during 'make install'

Post by hines » Thu Apr 03, 2014 6:34 am

On my mac os x 10.9.2 with xcode command line tools installed, I have a /usr/lib/libreadline.dylib .
You might try an
export LD_LIBRARY_PATH=/usr/local/Cellar/readline/6.2.4/lib
but I'm guessing something else is not quite right in your environment. How did you configure and install NEURON?
Can you launch
nrniv -python

RTomsett

Re: Trouble during 'make install'

Post by RTomsett » Thu Apr 03, 2014 10:57 am

Thanks for the rapid response! I first compiled and installed interviews (from Mercurial repo) as per the Mac install-from-source guidelines. I then installed Neuron by running sh build.sh, then ./configure with the following flags:

Code: Select all

./configure --prefix=/Applications/NEURON-7.3/nrn --with-readline=/usr/local/Cellar/readline/6.2.4/lib  --with-nrnpython=dynamic CFLAGS='-O3 -Wno-return-type -Wno-implicit-function-declaration -Wno-implicit-int -fPIC' CXXFLAGS='-O3 -Wno-return-type -Wno-implicit-function-declaration -Wno-implicit-int -fPIC'
(though to be honest I don't know what the flags after --wit-nrnpython do, I copied them from Henrik's original post...) then make, sudo make install. Unfortunately adding your suggest export doesn't seem to help. I can launch nrniv -python successfully.

However! I think I don't have the XCode command line tools installed - I didn't realise these came separately from the rest of XCode. The update server is down for maintenance for the moment but I'll try again once I've managed to install them and see how that goes.

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

Re: Trouble during 'make install'

Post by hines » Thu Apr 03, 2014 11:57 am

I only download the xcode command line tools instead of the full version of xcode since the former has a size a few hundred megabytes and the latter has a size of a few gigabytes.
I dont' know about the situation nowadays but earlier full versions of xcode came with the command line tools but did not install them unless one used the xcode interface to navigate to a button which installed the command line tools.

I'm guessing the LD_LIBRARY_PATH strategem would work after creating a symbolic link between the
real libreadline.6.2.dylib and a symbolic libreadline.dylib . In fact, one would not need the LD_LIBRARY_PATH if the symbolic link (or even a copy) was in /usr/lib

Post Reply