在 Ubuntu Mate 上安装 STk Scheme 解释器

在 Ubuntu Mate 上安装 STk Scheme 解释器

Scheme 编程语言有一个实现,叫做 STk。伯克利在 YouTube 上发布的计算机科学视频课程就是用这个实现的。我也想在我的计算机上安装它,这样我就可以完全按照他们的课程学习(虽然我已经安装了 MIT/GNU Scheme),但是他们(维护 STk Scheme 解释器的人)没有我可以使用 apt-get 实用程序安装的软件包版本。因此,我去了他们的网站并STk-4.0.1.tar.gz从那里下载了文件这里. 将其解压到/usr/local/src(我使用命令更改了目录的所有权sudo chown $USER /usr/local/src。 Cded 到目录。使用此命令解压 tarball tar -xzvf STk-4.0.1.tar.gz。 Cded 到新创建的目录。现在我尝试通过运行配置脚本来构建应用程序:

$ ./configure
creating cache ./config.cache
checking for ranlib... ranlib
Using 'gcc' compiler
Using '-O2' compilation options
Assumming OS is LINUX
checking for gcc... gcc
checking whether the C compiler (gcc   ) works... yes
checking whether the C compiler (gcc   ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for POSIXized ISC... no
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers 
checking for dnet_ntoa in -ldnet... no
checking for dnet_ntoa in -ldnet_stub... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking fd_set and sys/select... yes
Multiple precision library: libgmp
Hash tables support: yes
Posix support: yes
STklos support: yes
Socket support: yes
Regexp support: yes
Process support: yes
Html support: yes
Base64 support: yes
Locale support: yes
Pixmap Images support: yes
JPEG Images support: yes
Determining options for dynamic loading for LINUX
     Linux: no dynamic loading method chosen

not updating unwritable cache ./config.cache
creating ./config.status
creating Makefile
creating Utils/STk.spec
**** Configuring Src directory
creating cache ./config.cache
checking how to run the C preprocessor... gcc -E
checking for unistd.h... yes
checking for limits.h... yes
checking for sigaction... yes
checking for select... yes
checking for dlopen in -ldl... yes
checking for socket in -lsocket... no
checking for t_accept in -lnsl... no
checking for ANSI C header files... yes
checking for pid_t... yes
checking fd_set and sys/select... yes
not updating unwritable cache ./config.cache
creating ./config.status
creating Makefile
**** Configuring Extensions directory
creating cache ./config.cache
checking how to run the C preprocessor... gcc -E
checking for unistd.h... yes
checking for limits.h... yes
checking for sigaction... yes
not updating unwritable cache ./config.cache
creating ./config.status
creating Makefile
creating stk-genmake
**** Configuring Stack directory
creating cache ./config.cache
checking for gcc... gcc
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for ranlib... ranlib
ln: failed to create symbolic link 'libstack.c': File exists
Stack library configuration
         Machine type:  UNKNOWN_ARCH
    Low level support: 
not updating unwritable cache ./config.cache
creating ./config.status
creating libstack.h
creating Makefile
**** Configuring Tcl directory
creating cache ./config.cache
checking for ranlib... ranlib
checking whether cross-compiling... no
checking for getcwd... yes
checking for opendir... yes
checking for strerror... yes
checking for strstr... yes
checking for strtol... yes
checking for tmpnam... yes
checking for waitpid... yes
checking for strerror... (cached) yes
checking for getwd... yes
checking for wait3... yes
checking for uname... yes
checking for sin... no
checking for -lieee... yes
checking dirent.h... yes
checking how to run the C preprocessor... gcc -E
checking for errno.h... yes
checking for float.h... yes
checking for limits.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for sys/wait.h... yes
checking for unistd.h... yes
checking fd_set and sys/select... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... yes
checking tm_tzadj in struct tm... no
checking tm_gmtoff in struct tm... yes
checking timezone variable... yes
checking proper strstr implementation... yes
checking for strtoul... yes
checking for strtod... yes
checking for strtod... (cached) yes
checking for Solaris strtod bug... ok
checking for ANSI C header files... yes
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for opendir... (cached) yes
checking sys_errlist... yes
checking union wait... yes
checking matherr support... yes
checking for vfork... yes
checking vfork/signal bug... ok
checking for strncasecmp... yes
checking for BSDgettimeofday... no
checking for gettimeofday... yes
checking for gettimeofday declaration... present
checking for -linet... no
checking for net/errno.h... no
checking for connect... yes
checking for gethostbyname... yes
checking system version (for dynamic loading)... ./configure: 1: ./configure: Syntax error: Unterminated quoted string
**** Configuring Tk directory
creating cache ./config.cache
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for unistd.h... yes
checking for limits.h... yes
checking stdlib.h... yes
checking fd_set and sys/select... yes
checking whether cross-compiling... no
checking for ANSI C header files... yes
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for X... libraries , headers 
checking for X11 header files... checking for -lXbsd... no
checking for connect... yes
checking for gethostbyname... yes
checking for sin... no
checking for -lieee... yes
checking for memmove... yes
checking whether char is unsigned... no
checking for strtod... yes
checking for Solaris 2.4 strtod bug... ok
updating cache ./config.cache
creating ./config.status
creating Makefile


SUMMARY
*******
   Your system is  LINUX
   C compiler is: gcc
   Compilation options: -O2
   Dynamic loading enabled: no
   X11 libraries directory:
   X11 headers directory:

   You have chosen the following options
        Multiple precision library:      libgmp
        Hash tables support:             yes
        Posix support:                   yes
        STklos support:                  yes
        Socket support:                  yes
        Regexp support:                  yes
        Process support:                 yes
        Html support:                    yes
        Pixmap Images support:           yes
        Jpeg Images support:             yes
        Base64 support:                  yes
        Locale support:                  yes

If this is correct, you can just type 'make' now at your shell prompt.
Otherwise, rerun configure with proper options (see the README file for
a description of STk configure options.)

现在,我需要使用 make 实用程序来编译应用程序,但我做不到。这是我收到的错误:

$ make
make Tcl
make[1]: Entering directory '/usr/local/src/STk-4.0.1/Tcl'
make[1]: *** No rule to make target 'unix'.  Stop.
make[1]: Leaving directory '/usr/local/src/STk-4.0.1/Tcl'
Makefile:81: recipe for target 'tcl-dir' failed
make: *** [tcl-dir] Error 2

我可能做错了什么事。

答案1

configure我遇到了同样的问题,但现在问题已经解决了。如你所见,脚本中有一个语法错误

Checking system version (for dynamic loading)... ./configure: 1: ./configure: Syntax error: Unterminated quoted string

Configuring Tk directory位于输出部分正上方configure

Tcl/configure因此,在文件的第 3222 行有一个奇怪的引号

system=MP-RAS-`awk '{print $3}' /etc/.relid'`

只需将其转到

system=MP-RAS-`awk '{print $3} /etc/.relid'`

保存并返回主文件夹。./configure再次运行。检查该creating Makefile行是否出现在该节的末尾Configuring Tcl directory

之后我运行了make,但stk没有安装。sudo make install这帮助了我。所以也许如果你sudo make在配置步骤之后运行,你就会成功。

答案2

我怀疑出现此错误的原因是您以用户身份而不是通过调用 sudo 以“root”身份调用 make。它可能正在尝试安装二进制文件/usr/local/bin但无法成功,因为您是以普通用户身份而不是超级用户 root 身份调用它。

调用 make 后,以这种方式调用./configure

sudo make

顺便说一句,您不需要 chown,/usr/local/src您可以以自己的身份从主目录调用 ./configure /home/user/,将源 tarball 下载到主目录,然后仅以 root 身份使用 sudo make 调用 make。如果您希望下载,请以 sudo 身份/usr/local/src进行。

相关内容