[SOLVED] undefined references in makefile?

Post Reply
sdtran
Posts: 4
Joined: Wed Jun 13, 2018 2:38 pm

[SOLVED] undefined references in makefile?

Post by sdtran »

Linux LAPTOP-KJ7BN7BP 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 18.04
Error message:

Code: Select all

../ivoc/ivocmain.o: In function `ivocmain':
/home/sdtran/neuron/nrnsrc/src/ivoc/ivocmain.cpp:354: undefined reference to `__cxa_throw_bad_array_new_length'
./.libs/libnrniv.so: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
./.libs/libnrniv.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) const@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
./.libs/libnrniv.so: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
./.libs/libnrniv.so: undefined reference to `operator delete[](void*, unsigned long)@CXXABI_1.3.9'
./.libs/libnrniv.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'
./.libs/libnrniv.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status
Makefile:746: recipe for target 'nrniv' failed
make[3]: *** [nrniv] Error 1
make[3]: Leaving directory '/home/sdtran/neuron/nrnsrc/src/nrniv'
Makefile:518: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/sdtran/neuron/nrnsrc/src'
Makefile:655: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/sdtran/neuron/nrnsrc'
Makefile:513: recipe for target 'all' failed
make: *** [all] Error 2
NEURON was built from source using this installation method:

Code: Select all

#1
mkdir ~/neuron
mkdir ~/neuron/ivsrc
mkdir ~/neuron/iv
cd ~/neuron/ivsrc
git clone https://github.com/nrnhines/iv.git .
./build.sh
./configure --prefix=$HOME/neuron/iv
make
make install

#2
mkdir ~/neuron/nrnsrc
mkdir ~/neuron/nrn
cd ~/neuron/nrnsrc
git clone https://github.com/nrnhines/nrn.git .
./build.sh
./configure --prefix=$HOME/neuron/nrn --with-iv=$HOME/neuron/iv --with-nrnpython=$HOME/anaconda/bin/python \
    --with-paranrn --with-mpi
# export CFLAGS='-Qunused-arguments'
# export CXXFLAGS='-Qunused-arguments'
cd ~/neuron/nrnsrc/src/nrnmpi
sh mkdynam.sh
cd ~/neuron/nrnsrc
make
make install

#3
create file: ~/neuron/nrnenv
# containing:
export IDIR=$HOME/neuron
export IV=$IDIR/iv
export N=$IDIR/nrn
export CPU=x86_64
export PATH=$IV/$CPU/bin:$N/$CPU/bin:$PATH

in ~/.bashrc or ~/.bash_profile:
source $HOME/neuron/nrnenv
export PATH=$HOME/neuron:$PATH
export PYTHONPATH=$HOME/neuron/nrn/lib/python:$PYTHONPATH
The error message occurs in section #2 when I try to make the file. I'm using gcc 7.3, but gcc 6.4 ultimately produces the same error when I try to make install.

Thanks in advance!
sdtran
Posts: 4
Joined: Wed Jun 13, 2018 2:38 pm

Re: [SOLVED] undefined references in makefile?

Post by sdtran »

configure with CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0'
documentation here
Post Reply