我正在尝试在 Windows 上为 Cygwin 安装软件“Seismic Unix”。
在正常情况下,下面描述的问题可能会通过再次下载 Cygwin 并简单地重新安装所有软件包来解决 - 问题是:我真的不能这样做,因为我现在在南大西洋的一艘研究船上与 50 人共享 190 kb/s 的带宽。因此,我能做的最好的事情就是下载或更新单个软件包。然而,为了做到这一点,我首先需要知道导致错误消息的原因。
当我尝试安装时出现问题。错误消息如下:
fcat.c: In function ‘main’:
fcat.c:35:14: error: storage size of ‘buf’ isn’t known
struct stat buf;
^~~
In file included from fcat.c:26:0:
/usr/local/su2/include/cwp.h:713:15: warning: implicit declaration of function open64’ [-Wimplicit-function-declaration]
#define open open64
^
fcat.c:43:8: note: in expansion of macro ‘open’
fd = open(av[ic], O_RDONLY);
^~~~
/usr/local/su2/include/cwp.h:720:15: warning: implicit declaration of function fstat64’ [-Wimplicit-function-declaration]
#define fstat fstat64
^
fcat.c:45:3: note: in expansion of macro ‘fstat’
fstat(fd, &buf);
^~~~~
fcat.c:35:14: warning: unused variable ‘buf’ [-Wunused-variable]
struct stat buf;
^~~
make[2]: *** [Makefile:24: /usr/local/su2/bin/fcat] Error 1
make[2]: Leaving directory '/usr/local/su2/src/cwp/main'
make[1]: *** [Makefile:8: INSTALL] Error 2
make[1]: Leaving directory '/usr/local/su2/src/cwp'
make: *** [Makefile:85: cwpstuff] Error 2
/usr/local/su2/是Seismic Unix的目录。我安装了很多适用于类似软件(称为 Madagascar)的软件包,但显然不适用于 Seismic Unix。我发现一些帖子解释了当 gcc 未找到/最新时有时会出现此错误消息。我检查了好几次,它是最新的。此外,我尝试在 Cygwin 的 Ash 终端中使用“rebaseall”,因为这显然修复了主安装后安装的单个软件包的问题,但到目前为止没有任何效果。
有人有一些可以帮助我的想法吗?
编辑:感谢 Steeldriver 我已经解决了make install
. Cygwin 文件的配置在 Windows 上安装 Seismic Unix所说的实际上是在 /config 文件夹中并调用的Makefile.config_Cygwin_32
(见注释)。这让我可以通过大多数make xxxinstall
命令。
但是,现在最后一步又出现了另一个错误消息:make sfinstall
。我收到以下错误:
make[4]: Entering directory '/usr/local/su2/src/Sfio/src/lib/sfio/Stdio_s'
cc -c -I. -I.. -O -Dvt_threaded=0 stdfgetc.c
In file included from /usr/include/sys/errno.h:11:0,
from /usr/include/errno.h:9,
from ../vthread.h:14,
from ../sfhdr.h:58,
from stdio_s.h:11,
from stdfgetc.c:1:
/usr/include/sys/reent.h:285:26: error: conflicting types for ‘__FILE’
typedef struct __sFILE64 __FILE;
^~~~~~
In file included from stdfgetc.c:1:0:
stdio_s.h:8:25: note: previous declaration of ‘__FILE’ was here
typedef struct _sfio_s *__FILE;
^~~~~~
make[4]: *** [Makefile:25: stdfgetc.o] Error 1
make[4]: Leaving directory '/usr/local/su2/src/Sfio/src/lib/sfio/Stdio_s'
make[3]: *** [Makefile:146: mkstdio_s] Error 2
make[3]: Leaving directory '/usr/local/su2/src/Sfio/src/lib/sfio'
make[2]: *** [Makefile:79: install] Error 2
make[2]: Leaving directory '/usr/local/su2/src/Sfio/src/lib/sfio'
make[1]: *** [Makefile:7: INSTALL] Error 2
make[1]: Leaving directory '/usr/local/su2/src/Sfio'
make: *** [Makefile:129: sfinstall] Error 2
有人知道在这里做什么吗?在我一开始没有这样做之后,我使用新解压的源 tarball 再次尝试了每一步,但错误消息仍然存在。
答案1
以下过程适用于 64 位 cygwin
cp configs/Makefile.config_Cygwin_32 Makefile.config
将 Makefile.config 修补为
--- configs/Makefile.config_Cygwin_32 2015-03-17 16:36:38.000000000 +0100
+++ Makefile.config 2018-01-28 19:37:35.224138200 +0100
@@ -34,7 +34,7 @@
LINEHDRFLAG =
XDRFLAG = # -DSUXDR
ENDIANFLAG = -DCWP_LITTLE_ENDIAN
-LARGE_FILE_FLAG = # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 # -D_LARGEFILE64_SOURCE
CWP_FLAGS = $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG) $(LINEHDRFLAG)
@@ -59,10 +59,10 @@
# use both X11 path conventions
#-----------------------------------------------------------------------
-IX11 = /usr/X11/include
-LX11 = /usr/X11/lib
-IMOTIF = /usr/X11R6/include
-LMOTIF = /usr/X11R6/lib
+IX11 = /usr/include/X11
+LX11 = /usr/lib
+IMOTIF = /usr/include/X11
+LMOTIF = /usr/lib
LD_LIBRARY_PATH += $(CWPROOT)/lib:${LX11}:${LMOTIF}
@@ -91,7 +91,7 @@
CC = gcc
#OPTC = -g -std=c99 -Wall -pedantic -Wno-long-long
-OPTC = -O -std=c99 -Wall -pedantic -Wno-long-long
+OPTC = -O -Wall -pedantic -Wno-long-long
CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) -D_BSD_SOURCE -D_POSIX_SOURCE
FC = gfortran
附加补丁make sfinstall
--- Sfio/src/lib/sfio/Stdio_b/sfstdio.h~ 2018-01-28 20:36:09.022523600 +0100
+++ Sfio/src/lib/sfio/Stdio_b/sfstdio.h 2018-01-28 21:21:12.331496700 +0100
@@ -26,7 +26,7 @@
/* Linux7.2 requires __FILE in wchar.h - we fake it here */
#include "FEATURE/sfio"
-#if _typ___FILE
+#if defined(_typ___FILE) && !defined(__CYGWIN__)
typedef FILE *__FILE;
#endif
--- Sfio/src/lib/sfio/Stdio_s/stdio_s.h~ 2002-09-14 03:01:15.000000000 +0200
+++ Sfio/src/lib/sfio/Stdio_s/stdio_s.h 2018-01-28 20:33:16.400954500 +0100
@@ -4,7 +4,7 @@
#include "FEATURE/sfio"
-#if _typ___FILE /* Redhat7.3 requires __FILE in wchar.h */
+#if defined(_typ___FILE) && !defined(__CYGWIN__) /* Redhat7.3 requires __FILE in wchar.h */
typedef struct _sfio_s *__FILE;
#endif