gcc bug: ___gxx_personality_v0 undefined

Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

I was trying to compile neuron 7.1.333 with the latest cygwin with gcc-4 and g++-4 as compiler but I repeatedly have seen the error

Code: Select all

make nrniv.exe
../ivoc/nrnmain.o:nrnmain.cpp:(.eh_frame+0x11): undefined reference to `___gxx_personality_v0'

please see http://www.cocoabuilder.com/archive/mes ... 0/17/54208 For more info

I have tried different configurations, including:
./configure --prefix=`pwd` --with-iv=$IV -->

Code: Select all

/home/keivan/neuron/nrn/src/gnu/d_vec.h:98: undefined reference to `__Unwind_SjLj_Resume'
./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe"
./configure --prefix=`pwd` --with-iv=$IV CC="gcc.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe"
also i have compiled mpich2 in cygwin as was demonstrated in previous posts in this forum.

Code: Select all

make nrniv.exe
../ivoc/nrnmain.o:nrnmain.cpp:(.eh_frame+0x11): undefined reference to `___gxx_personality_v0'

The code configures and compiles but then this linker error arise.
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: gcc bug: ___gxx_personality_v0 undefined

Post by hines »

The nrn/src/mswin/nrncygso.sh.in script is specific to gcc-3.4.4 . To fix
replace
CXX=gcc
with
CXX=@CXX@
and the line
-L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -lstdc++ -lgcc \
with
-L/usr/lib/gcc/i686-pc-cygwin/4.3.2 -lstdc++ -lgcc_s -lgcc \
and run configure again.
Unfortunately, I continue to have a problem with InterViews with this compiler and have
successful only with the configure option --without-iv and removing the line
-L${IVLIBDIR} -lIVhines \
in the nrncygso.sh.in file

I will continue to try to fix InterViews + cygwin + g++-4 and if successful will
post again under this heading.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

Thank you hines. I have compiled neuron with iv with the following environment variables

Code: Select all

export LD_LIBRARY_PATH=/lib:${LD_LIBRARY_PATH}
export PATH=$HOME/neuron/mpich2/$CPU/bin:$PATH
export LD_LIBRARY_PATH=$HOME/neuron/mpich2/$CPU/lib:${LD_LIBRARY_PATH}
and following configuration

Code: Select all

./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" FFLAGS="-O3 -march=core2 -fno-builtin"
src compiled without error.
but there is no dll?

Code: Select all

src/mswin/cygnrniv.dll  --> instead there is only a dll named "nrniv.dll"
so I run "make mswin" and installed the latest alpha version of neuron with the installer (a downloaded version) and merged the the c:\marshalnrn\nrn with nruron 7.1 directory --> but when double clicking nrngui icon, nothing happens (just rxvt appears and disappears suddenly).

then I run "make install" and tried to run nrngui command as in linux --> bash recognized the command but nothing happened.

then I decided to do the whole processes from mpich2 to neuron -->
mpich2 -->

Code: Select all

export KEIVANFLAGS="-fno-builtin -march=core2 -pipe"
./configure --prefix=$HOME/neuron/mpich2/$CPU --with-device=ch3:nemesis --enable-fast=O3 --enable-timer-type=linux86_cycle MPICH2LIB_CFLAGS="$KEIVANFLAGS" MPICH2LIB_CXXFLAGS="$KEIVANFLAGS" MPICH2LIB_FFLAGS="$KEIVANFLAGS" MPICH2LIB_F90FLAGS="$KEIVANFLAGS" CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4" CFLAGS="-DDLL_EXPORT -DPIC" CXXFLAGS="-DDLL_EXPORT -DPIC" "pac_cv_f77_sizeof_integer=4" "pac_cv_f77_sizeof_double_precision=8"
iv -->

Code: Select all

./configure --prefix=`pwd` CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" FFLAGS="-O3 -march=core2 -fno-builtin"	LIBS="-L/home/keivan/mpich2/$CPU/lib -lmpi"	LDFLAGS="-e _mainCRTStartup"
nrn -->

Code: Select all

./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" FFLAGS="-O3 -march=core2 -fno-builtin"
the whole code compiles without error but files execute nothing (rxvt appears and disapears)
I want to try the whole thing without compiler flags.
nrn -->

Code: Select all

./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe"
just compiled neuron --> the same result
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: gcc bug: ___gxx_personality_v0 undefined

Post by hines »

As I mentioned above, there is a problem with InterViews + g++-4 + cygwin.
Everything seems to build but iv/i686/bin/idemo does not pop up anything on the
screen and ./idemo exits immediately. So, until this problem is fixed, I recommend
falling back to gcc-3.4.4
If you insist on compiling nrn with g++-4 then you MUST use the --without-iv
configure option or else fix InterViews to the point where idemo runs.

I don't think there is anything wrong with the code (works with that compiler on linux)
and suspect the autotools environment
and in particular libtool in regard to building shared libraries that make use of mswindows graphics.
The program refuses to load and even a printf("hello\n"); as the first line fails to execute. It seems like
a missing library. Since there are no error messages, I'm at a loss as to how to narrow down the
problem.
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: gcc bug: ___gxx_personality_v0 undefined

Post by hines »

After searching for "you can't do that without a process to debug" which comes up with gdb
I found a hint that worked for g++-4.
Configure with LDFLAGS='-Wl,--enable-auto-import'
Now src/nrniv/nrniv will load (do not worry about the resource error, it is in the wrong place to run).
You will also need to add it to the nrncygso.sh somewhere but I haven't experimented with that
yet.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

my "/usr/lib/" is an empty directory
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

I have compiled nrn with the suggested LDFLAG -->

Code: Select all

./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" FFLAGS="-O3 -march=core2 -fno-builtin" LDFLAGS='-Wl,--enable-auto-import'
compiled without error but still there is no success running nrngui -->
Do i have to compile IV with that LDFLAG too?
Last edited by Keivan on Tue Jun 14, 2011 1:51 pm, edited 1 time in total.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

it seems that the correct position of libraries in cygwin 2009 is "/etc/alternatives" --> I am going to try that
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

I have compiled IV and neuron with this new address but was not successful (as previpus).

Code: Select all

./configure --prefix=`pwd` CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include" FFLAGS="-O3 -march=core2 -fno-builtin"   LIBS="-L/home/keivan/mpich2/$CPU/lib -L/etc/alternatives -lmpi" LDFLAGS="-e _mainCRTStartup" 

./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include -L/etc/alternatives" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include -L/etc/alternatives" FFLAGS="-O3 -march=core2 -fno-builtin -L/etc/alternatives" LDFLAGS="-Wl,--enable-auto-import" LIBS="-L/home/keivan/mpich2/$CPU/lib -L/etc/alternatives"
I don't know this is helping or not --> size of my compiled nrniv.exe is very smaller than usual.
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

Finally, I find a way to compile at least with gcc-3: the problem was that the programmers considered the default directory of libraries is in "/etc/lib/gcc" but in my unmodified fresh install of cygwin they are in "/lib/gcc/(version)". So I changed the ~/neuron/nrn/src/mswin/nrnsygso.sh.in as hines told but to the location --> -L/lib/gcc/i686-pc-cygwin/3.4.4 -lstdc++ -lgcc -lgcc_s
then configured and installed IV and neuron this way -->

Code: Select all

iv --> ./configure --prefix=`pwd` CXXFLAGS="-I/lib/gcc/i686-pc-cygwin/3.4.4/include" CFLAGS="-I/lib/gcc/i686-pc-cygwin/3.4.4/include" FFLAGS="-I/lib/gcc/i686-pc-cygwin/3.4.4/include" LIBS="-L/lib/gcc/i686-pc-cygwin/3.4.4" CXX="g++"
nrn --> ./configure --prefix=`pwd` --with-iv=$IV CXXFLAGS="-I/lib/gcc/i686-pc-cygwin/3.4.4/include" CFLAGS="-I/lib/gcc/i686-pc-cygwin/3.4.4/include" FFL="-I/lib/gcc/i686-pc-cygwin/3.4.4/include" LIBS="-L/lib/gcc/i686-pc-cygwin/3.4.4" CXX="g++"
However, still it would be a good news to hear that some day the neuron could be compiled with gcc-4 --> because I need the compiler flag -march=core2 to optimize the binary.
the other point is that however I could run nrngui but there is no file named cygnrniv.dll???
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: gcc bug: ___gxx_personality_v0 undefined

Post by hines »

I successfully built with g++-4 using:
$HOME/neuron/ivgcc4 --> ./configure --prefix=`pwd` CC=gcc-4 CXX=g++-4 LDFLAGS='-Wl,--enable-auto-import'
make
make install

I have nrn sources in the $HOME/neuron/nrn directory and build and install in an object directory with
$HOME/neuron/nrngcc4 --> ../nrn/configure --prefix=`pwd` --srcdir=../nrn --with-iv=$HOME/neuron/ivgcc4 \
CC=gcc-4 CXX=g++-4 LDFLAGS='-Wl,--enable-auto-import'
make
make mswin # everything in c:/marshalnrn/nrn

One ought to be able to add --with-python and --with-paranrn. See the '#notes about building with mpich2 under cygwin'
in nrn/mswinmpiconf. It is likely the latter MUST also be built with g++-4 in order for mpcxx to wrap the correct g++ compiler.

The configure system changes have been committed to the hg repository
http://www.neuron.yale.edu/hg/neuron/nr ... d58af16783
In particular, you should not have to change nrncygso.sh.in (if you do change it, be sure to execute
sh config.status
in the nrngcc4 directory so nrncygso.sh gets updated.)
You should NOT need any CFLAGS, CXXFLAGS, LIBS
the location --> -L/lib/gcc/i686-pc-cygwin/3.4.4 -lstdc++ -lgcc -lgcc_s
I'm surprised this worked because -lgcc_s does not exist with 3.4.4. perhaps you were actually compiling with g++-4
What is your gcc set to? (that is a rhetorical question.)
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

I have compiled neuron with the latest development code as follow -->
MPICH2

Code: Select all

cd ~/neuron/mpich2
./configure --prefix=$HOME/neuron/mpich2/$CPU --with-device=ch3:nemesis --enable-fast=O3 --enable-timer-type=linux86_cycle MPICH2LIB_CFLAGS="$KEIVANFLAGS" MPICH2LIB_CXXFLAGS="$KEIVANFLAGS" MPICH2LIB_FFLAGS="$KEIVANFLAGS" MPICH2LIB_F90FLAGS="$KEIVANFLAGS" CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4" CFLAGS="-DDLL_EXPORT -DPIC" CXXFLAGS="-DDLL_EXPORT -DPIC" "pac_cv_f77_sizeof_integer=4" "pac_cv_f77_sizeof_double_precision=8"
make >& build.stdout #but did not do "make install"
iv

Code: Select all

cd ../iv
 ./configure --prefix=`pwd` CC="gcc-4.exe" CXX="g++-4.exe" F77="gfortran-4.exe" F90="gfortran-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include -I/home/keivan/mpich2/src/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include -I/home/keivan/mpich2/src/include" FFLAGS="-O3 -march=core2 -fno-builtin -I/home/keivan/mpich2/$CPU/include -I/home/keivan/mpich2/src/include" LIBS="-L/home/keivan/mpich2/$CPU/lib -lmpi" LDFLAGS="-e _mainCRTStartup"
make -j3
make install
nrn --> I changed ./src/mswin/nrncygso.sh.in

Code: Select all

mpich=/home/hines/mpich2-1.0.7 --> to mpich=/home/keivan/neuron/mpich2 #the source directory of my mpich2
/home/hines/mpich2-1.0.7/src/binding/f77/setbot.o --> to /home/keivan/neuron/mpich2/src/binding/f77/setbot.o

Code: Select all

cd ../nrn
./configure --prefix=`pwd` --with-iv=$IV CC="gcc-4.exe" CXX="g++-4.exe" CXXFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include -I/home/keivan/mpich2/src/include" CFLAGS="-O3 -march=core2 -fno-builtin -mwindows -I/home/keivan/mpich2/$CPU/include -I/home/keivan/mpich2/src/include" LDFLAGS="-Wl,--enable-auto-import"
make -j3
make mswin
The code compiled without any error but the nrniv.dll (which I guess is the correct name of cygnrniv.dll?) is not created
there is no such dll in c:\marshalnrn\nrn or ~/neuron/nrn/src/mswin
copying this missing dll from the original installer, neuron.exe become operational
if instead of "make mswin" do "make install" I can use the "nrngui" command to launch neuron but its performance is very slow compared to the neuron installed with installer or the one become operational with cpoying missing dlls.

I could not progress further what should I do?
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: gcc bug: ___gxx_personality_v0 undefined

Post by hines »

I could not progress further what should I do?
Were you able to reproduce my successful build? i.e after 'make mswin'
you can execute c:/marshalnrn/nrn/bin/nrniv
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Re: gcc bug: ___gxx_personality_v0 undefined

Post by Keivan »

Were you able to reproduce my successful build? i.e after 'make mswin'
you can execute c:/marshalnrn/nrn/bin/nrniv
double clicking on the c:/marshalnrn/nrn/bin/nrniv.exe (4.5 KB in size) --> leads to error message: "This application has failed to start because nrniv.dll was not found. Re-installing the application may fix this problem"

I installed nrn-7.1.alpha-315-setup.exe and moved and replaced the c:/marshalnrn/nrn/bin/nrniv.exe (4.5 KB) with nrn71/bin/nrniv.exe (270 KB) and overwrite it --> double clicking on it again --> leads to error message: "This application has failed to start because cyggcc_s.dll was not found. Re-installing the application may fix this problem"
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: gcc bug: ___gxx_personality_v0 undefined

Post by hines »

I understand that you are having problems. What I don't know is whether you were able to use the
configure statements I indicated above to make a working version. i.e no python and no mpi and no flags
other than the ones I indicated.

I've successfully built now with --with-paranrn and --with-nrnpython but need to adjust
nrncygso.sh.in so it is a bit more robust in other environments.
Post Reply