Hello,
I'm having some problem compiling ngspice32 on RHEL 7.8.
I downloaded the master branch, moved in and then followed these steps:
mkdir release
./autogen.sh
cd release
../configure --without-x --prefix=/home/rizzi/MyPackage/ngspice-compile/ngspice-32 CFLAGS="-m64 -O2" LDFLAGS="-m64 -s"
make clean
make
But something goes wrong and I recieve this error at the end of make's logfile:
...
...
../../misc/.libs/libmisc.a(string.o): In function `scannum':
string.c:(.text+0x4c0): multiple definition of `scannum'
test_cx_mag.o:test_cx_mag.c:(.text+0x40): first defined here
../../misc/.libs/libmisc.a(string.o): In function `tvprintf':
string.c:(.text+0x3a3): undefined reference to `controlled_exit'
collect2: error: ld returned 1 exit status
make[3]: *** [test_cx_mag] Error 1
make[3]: Leaving directory `/home/rizzi/MyPackage/ngspice-ngspice/release/src/maths/cmaths'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/rizzi/MyPackage/ngspice-ngspice/release/src/maths'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rizzi/MyPackage/ngspice-ngspice/release/src'
make: *** [all-recursive] Error 1
Please find attached the complete make's logfile.
Any help would be much appreciated.
There is some ancient code which creates problems here. I will consider removing it. I am not sure why this is working in all other setups known to me, but not in yours. You may try removing the code by editing
ngspice\src\maths\cmaths\Makefile.am
Remove the following passage
and try compiling again, starting with ./autogen.sh.
Last edit: Holger Vogt 2020-08-11
Thanks a lot for your quick reply!
The compiling still fails but this time with the following message:
As before you can find attached the make.log
Related
ngspice: ngspice
We have inline functions defined in a header stringutil.h that are included several times.
Try compiling with flag
-std=c99It wroked!
I rolled back to the master branch --without deleting the passage you mentioned-- and just added
-std=c99to theCFLAGSwhen calling../configure "...".Thanks a lot!
The ticket can be closed for me.
[edit, noticed it was a bug to be fixed]
I see the same issue on centos 7, but don't understand the fix. Could it be clarified please?
Last edit: J Jacob Wikner 2020-10-13
Centos 7 uses an old compiler which has a different (old) standard for handling inline functions. Adding the flag
-std=c99will lead gcc to use the newer standard. This will not be added to ngspice because it is Centos-specific.The bug fix to
undefined reference to controlled_exitis available in ngspice git master. Early during compilation some executables are generated to test some math functions. At this stage the file containing function 'controlled_exit' has not yet being compiled. The math function test is outdated and has now been removed (to be available only with an extra configure flag).
Last edit: Holger Vogt 2020-10-13