verilator-3.872 compile error in new cygwin installation #914
Labels
area: configure/compiling
Issue involves configuring or compilating Verilator itself
resolution: fixed
Closed; fixed
Author Name: Matthew Barr
Original Redmine Issue: 914 from https://www.veripool.org
Original Date: 2015-04-29
Original Assignee: Wilson Snyder (@wsnyder)
Short story: in include/verilatedos.h on line 142 consider changing:
to:
This fixes compilation error in new cygwin installations due to conflicting uint32_t definitions, and should continue to work with older cygwin installations. Details are below.
Thanks and Best Regards,
Matt Barr
I just installed 32-bit Cygwin under Windows 7 and tried to re-build and re-install verilator-3.872. After ./configure I ran make and got the following compilation error:
make[2]: Entering directory '/home/Matt/Verilator/verilator-3.872/src/obj_dbg'
Compile flags: g++ -I/usr/local/include -MMD -I. -I.. -I.. -I../../include -DYYDEBUG -ggdb -DVL_DEBUG -MP -DDEFENV_SYSTEMC="" -DDEFENV_SYSTEMC_ARCH="" -DDEFENV_SYSTEMC_INCLUDE="" -DDEFENV_SYSTEMC_LIBDIR="" -DDEFENV_SYSTEMPERL="" -DDEFENV_SYSTEMPERL_INCLUDE="" -DDEFENV_VERILATOR_ROOT="/usr/local/share/verilator"
g++ -I/usr/local/include -MMD -I. -I.. -I.. -I../../include -DYYDEBUG -ggdb -DVL_DEBUG -MP -DDEFENV_SYSTEMC="" -DDEFENV_SYSTEMC_ARCH="" -DDEFENV_SYSTEMC_INCLUDE="" -DDEFENV_SYSTEMC_LIBDIR="" -DDEFENV_SYSTEMPERL="" -DDEFENV_SYSTEMPERL_INCLUDE="" -DDEFENV_VERILATOR_ROOT="/usr/local/share/verilator" -c ../Verilator.cpp
In file included from ../config_build.h:81:0,
from ../V3Global.h:24,
from ../Verilator.cpp:21:
../../include/verilatedos.h:146:24: error: conflicting declaration ‘typedef long unsigned int uint32_t’
typedef unsigned long uint32_t; ///< 32-bit unsigned type (backward compatibility)
^
In file included from /usr/include/sys/types.h:62:0,
from ../config_build.h:70,
from ../V3Global.h:24,
from ../Verilator.cpp:21:
/usr/include/sys/_stdint.h:32:20: note: previous declaration as ‘typedef __uint32_t uint32_t’
typedef __uint32_t uint32_t ;
^
../Makefile_obj:279: recipe for target 'Verilator.o' failed
In include/verilatedos.h we have (line 137):
typedef unsigned char uint8_t; ///< 8-bit unsigned type (backward compatibility)
typedef unsigned short int uint16_t; ///< 16-bit unsigned type (backward compatibility)
typedef unsigned char vluint8_t; ///< 8-bit unsigned type
typedef unsigned short int vluint16_t; ///< 16-bit unsigned type
typedef int32_t vlsint32_t; ///< 32-bit signed type
typedef uint32_t vluint32_t; ///< 32-bit unsigned type
typedef unsigned long uint32_t; ///< 32-bit unsigned type (backward compatibility)
typedef long vlsint32_t; ///< 32-bit signed type
typedef unsigned long vluint32_t; ///< 32-bit unsigned type
In cygwin's /usr/include/sys/_stdint.h we have (line 30):
#ifdef ___int32_t_defined
typedef __int32_t int32_t ;
typedef __uint32_t uint32_t ;
#define __int32_t_defined 1
#endif
It appears that cygwin now defines ___int32_t_defined while verilatedos.h is looking for __uint32_t_defined. It has been year or more since I built verilator, but this used to work and it appears there has since been a change on the cygwin side.
The text was updated successfully, but these errors were encountered: