Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running make under macOS #1

Open
xiayu87 opened this issue Mar 11, 2021 · 7 comments
Open

Error while running make under macOS #1

xiayu87 opened this issue Mar 11, 2021 · 7 comments

Comments

@xiayu87
Copy link

xiayu87 commented Mar 11, 2021

Macbook M1,
bigSur 11.2

The error generated have summary as:
2 errors generated.
make[2]: *** [subckt.o] Error 1
make[1]: *** [modules] Error 2

Is there any fix? Thanks

@RTimothyEdwards
Copy link
Owner

The actual error messages will be found in "make.log", so please check that file and let me know what the specific error messages are.

@xiayu87
Copy link
Author

xiayu87 commented Mar 12, 2021

As per 'make.log' file the following are the errors generated while running 'make'

Error#1:

gcc -g -I. -I.. -DCAD_DIR="/usr/local/lib" -DBIN_DIR="/usr/local/bin" -DPACKAGE_NAME="irsim" -DPACKAGE_TARNAME="irsim" -DPACKAGE_VERSION="9.7" -DPACKAGE_STRING="irsim\ 9.7" -DPACKAGE_BUGREPORT="[email protected]" -DPACKAGE_URL="" -DIRSIM_VERSION="9.7" -DIRSIM_REVISION="110" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DFAULT_SIM=1 -DPOWER_EST=1 -DUSER_SUBCKT=1 -DSTATS=1 -DCL_STATS=1 -DRANDOM=1 -DHAVE_PTHREADS=1 -DSHDLIB_EXT="" -DNDEBUG -c eval.c
eval.c:217:3: error: implicit declaration of function 'free' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
free((char *)e->enode);
^
1 error generated.
make[2]: *** [eval.o] Error 1

Error#2

gcc -g -I/usr/X11/include -I../base -I. -I.. -DCAD_DIR="/usr/local/lib" -DBIN_DIR="/usr/local/bin" -DPACKAGE_NAME="irsim" -DPACKAGE_TARNAME="irsim" -DPACKAGE_VERSION="9.7" -DPACKAGE_STRING="irsim\ 9.7" -DPACKAGE_BUGREPORT="[email protected]" -DPACKAGE_URL="" -DIRSIM_VERSION="9.7" -DIRSIM_REVISION="110" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DFAULT_SIM=1 -DPOWER_EST=1 -DUSER_SUBCKT=1 -DSTATS=1 -DCL_STATS=1 -DRANDOM=1 -DHAVE_PTHREADS=1 -DSHDLIB_EXT="" -DNDEBUG -DX11 -DXLIB -DNDEBUG -c thread.c
thread.c:123:3: error: implicit declaration of function 'HandleButton' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
HandleButton(&event->xbutton);
^
thread.c:131:3: error: implicit declaration of function 'HandleKey' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
HandleKey(&event->xkey);
^
thread.c:150:3: error: implicit declaration of function 'WindowExposed' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
WindowExposed(&event->xexpose);
^
thread.c:150:3: note: did you mean 'WindowCrossed'?
./ana_glob.h:189:13: note: 'WindowCrossed' declared here
extern void WindowCrossed( /* selected */ );
^
thread.c:154:6: error: implicit declaration of function 'WindowResize' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
WindowResize(&event->xconfigure);
^
thread.c:197:6: error: implicit declaration of function 'WindowResize' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
WindowResize(&event->xconfigure);
^
5 errors generated.
make[2]: *** [thread.o] Error 1

Error#3

gcc -g -I../base -I. -I.. -DCAD_DIR="/usr/local/lib" -DBIN_DIR="/usr/local/bin" -DPACKAGE_NAME="irsim" -DPACKAGE_TARNAME="irsim" -DPACKAGE_VERSION="9.7" -DPACKAGE_STRING="irsim\ 9.7" -DPACKAGE_BUGREPORT="[email protected]" -DPACKAGE_URL="" -DIRSIM_VERSION="9.7" -DIRSIM_REVISION="110" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DFAULT_SIM=1 -DPOWER_EST=1 -DUSER_SUBCKT=1 -DSTATS=1 -DCL_STATS=1 -DRANDOM=1 -DHAVE_PTHREADS=1 -DSHDLIB_EXT="" -DNDEBUG -c subckt.c
subckt.c:416:34: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
out_name_Ub = (char *)malloc(strlen(targv[targc-1]) + 20);
^
subckt.c:416:34: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
subckt.c:457:2: error: implicitly declaring library function 'bzero' with type 'void (void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
NEW_SUBCKT(subptr);
^
../base/net_macros.h:93:4: note: expanded from macro 'NEW_SUBCKT'
bzero( S , sizeof(SubcktT) );
^
subckt.c:457:2: note: include the header <strings.h> or explicitly provide a declaration for 'bzero'
../base/net_macros.h:93:4: note: expanded from macro 'NEW_SUBCKT'
bzero( S , sizeof(SubcktT) );
^
2 errors generated.

@xiayu87
Copy link
Author

xiayu87 commented Mar 12, 2021

The output of './configure' is:

checking build system type... arm-apple-darwin20.3.0
checking host system type... arm-apple-darwin20.3.0
checking target system type... arm-apple-darwin20.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for library containing strerror... none required
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of void *... 8
checking size of unsigned int... 4
checking size of unsigned long... 8
checking size of unsigned long long... 8
checking for gm4... /opt/local/bin/gm4
checking for ld used by GCC... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking size of void *... (cached) 8
checking size of unsigned int... (cached) 4
checking size of unsigned long... (cached) 8
checking size of unsigned long long... (cached) 8
checking whether byte ordering is bigendian... no
checking for ANSI C header files... (cached) yes
checking for setenv... yes
checking for putenv... yes
checking for vfork... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking param.h usability... no
checking param.h presence... no
checking for param.h... no
checking for va_copy... yes
checking for __va_copy... yes
checking for tclConfig.sh...
Can't find Tcl configuration script "tclConfig.sh"
Reverting to non-Tcl compilation
checking for X... libraries /usr/X11/lib, headers /usr/X11/include
checking whether -R must be followed by a space... neither works
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
configure: creating ./config.status
config.status: creating defs.mak
config.status: WARNING: 'defs.mak.in' seems to ignore the --datarootdir setting
configure: "Notice: Use 'make' to compile and 'make install' to install"

@RTimothyEdwards
Copy link
Owner

Oh, I remember coming across this one before. The Mac compiler apparently sets "-Werror" (treat compiler warnings as fatal errors) as a default.

Probably what you want to do is this for "configure":

   CFLAGS="-Wno-error" ./configure

If that doesn't work, then find "CFLAGS =" in the "defs.mak" file and add "-Wno-error" to the list of gcc flags.

@xiayu87
Copy link
Author

xiayu87 commented Mar 12, 2021

I tried both ways and unfortunately I am getting the same error

@xiayu87
Copy link
Author

xiayu87 commented Mar 13, 2021

Could this be due to not declaring the function before calling it, as per the thread below:
https://stackoverflow.com/questions/15850042/xcode-warning-implicit-declaration-of-function-is-invalid-in-c99

@RTimothyEdwards
Copy link
Owner

Well, yes, but there are hundreds if not thousands of such issues in the code, which was written in the 1980s, and rather than try to track them all down and fix them, I depend on the compiler treating them as warnings (or not at all) and continuing on. You might try "CFLAGS = -w" which would completely supress all compiler warnings. I'm not sure why "-Wno-error" doesn't work, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants