全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
987 1
2020-06-23

Author: Daniel tulips liu


许可 GNU General Public License

/*
 * Copyright (C) 2020 Daniel tulips liu
 *
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * It is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * For a copy of the GNU General Public License,
 * see <http://www.gnu.org/licenses/>.
 */

cygwin64 编译 dynare team workping paper 006

tulipsliu@TulipsPC ~
$ apt-cyg install matio
grep: /etc/setup/installed.db: No such file or directory
Installing matio
Unable to locate package matio

tulipsliu@TulipsPC ~
$ cd E:/matio-1.5.17

tulipsliu@TulipsPC /cygdrive/e/matio-1.5.17
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for pgcc... no
checking for icc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of ob ject 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 whether gcc understands -c and -o together... yes
checking debug mode... no
checking profile mode... no
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-cygwin/bin/ld.exe
checking if the linker (/usr/x86_64-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-unknown-cygwin file names to x86_64-unknown-cygwin format... func_convert_file_noop
checking how to convert x86_64-unknown-cygwin file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-cygwin/bin/ld.exe option to reload ob ject files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc ob ject... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -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 for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make sets $(MAKE)... (cached) yes
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for pow in -lm... yes
checking for ANSI C header files... (cached) yes
checking for stdarg.h... yes
checking for varargs.h... no
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for struct lconv.decimal_point... yes
checking for struct lconv.thousands_sep... yes
checking for ptrdiff_t... yes
checking for localeconv... yes
checking for getopt_long... internal
checking size of double... 8
checking size of float... 4
checking size of long long... 8
checking size of long... 8
checking size of int... 4
checking size of short... 2
checking size of char... 1
checking size of void *... 8
checking size of size_t... 8
checking for mat_int64_t... int64_t
checking for mat_uint64_t... uint64_t
checking for mat_int32_t... int32_t
checking for mat_uint32_t... uint32_t
checking for mat_int16_t... int16_t
checking for mat_uint16_t... uint16_t
checking for mat_int8_t... int8_t
checking for mat_uint8_t... uint8_t
checking for long double... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking for unsigned long long int... (cached) yes
checking for size_t... yes
checking for intmax_t... yes
checking for uintmax_t... yes
checking for uintptr_t... yes
checking for va_copy() function... yes
checking for vsnprintf()... yes
checking for snprintf()... yes
checking for vasprintf()... yes
checking for asprintf()... yes
checking for matlab... /cygdrive/d/Softwares/Polyspace/R2020a/bin/matlab
/cygdrive/d/Softwares/Polyspace/R2020a/bin/matlab
checking for zlib Library... -lz
checking for HDF5 software... -lhdf5
checking if HDF5 interface is >= v1.8... yes
checking enable MAT v7.3 file support... yes
checking for default MAT file version... MAT_FT_MAT5
checking enable extended sparse types... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating matio.pc
config.status: creating src/Makefile
config.status: creating getopt/Makefile
config.status: creating tools/Makefile
config.status: creating test/Makefile
config.status: creating documentation/Makefile
config.status: creating src/matioConfig.h
config.status: creating src/matio_pubconf.h
config.status: executing libtool commands
config.status: executing test/atconfig commands

   MATIO Configuration Summary
==============================================================
           C Compiler: gcc
               CFLAGS:  -g -O2
     Shared Libraries: yes
     Static Libraries: yes
  default MAT version: MAT_FT_MAT5

Features --------------------------------------------
  MAT v7.3 file support: yes
Extended sparse support: yes

Packages --------------------------------------------
                 zlib: -lz
                 hdf5: -lhdf5
               MATLAB: /cygdrive/d/Softwares/Polyspace/R2020a/bin/matlab



tulipsliu@TulipsPC /cygdrive/e/matio-1.5.17
$ make
Making all in src
make[1]: 进入目录“/cygdrive/e/matio-1.5.17/src”
make  all-am
make[2]: 进入目录“/cygdrive/e/matio-1.5.17/src”
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o snprintf.lo snprintf.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c snprintf.c  -DDLL_EXPORT -DPIC -o .libs/snprintf.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c snprintf.c -o snprintf.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o endian.lo endian.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c endian.c  -DDLL_EXPORT -DPIC -o .libs/endian.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c endian.c -o endian.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o io.lo io.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c io.c  -DDLL_EXPORT -DPIC -o .libs/io.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c io.c -o io.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o inflate.lo inflate.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c inflate.c  -DDLL_EXPORT -DPIC -o .libs/inflate.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c inflate.c -o inflate.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o read_data.lo read_data.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c read_data.c  -DDLL_EXPORT -DPIC -o .libs/read_data.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c read_data.c -o read_data.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o mat5.lo mat5.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat5.c  -DDLL_EXPORT -DPIC -o .libs/mat5.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat5.c -o mat5.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o mat4.lo mat4.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat4.c  -DDLL_EXPORT -DPIC -o .libs/mat4.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat4.c -o mat4.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o mat.lo mat.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat.c  -DDLL_EXPORT -DPIC -o .libs/mat.o
mat.c: 在函数‘Mat_VarDelete’中:
mat.c:1125:5: 警告:‘mktemp’ is deprecated: the use of `mktemp' is dangerous; use `mkstemp' instead [-Wdeprecated-declarations]
 1125 |     if ( (tmp_name = mktemp(temp)) != NULL ) {
      |     ^~
In file included from safe-math.h:77,
                 from mat.c:32:
/usr/include/stdlib.h:134:8: 附注:在此声明
  134 | char * mktemp (char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")));
      |        ^~~~~~
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat.c -o mat.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o matvar_cell.lo matvar_cell.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c matvar_cell.c  -DDLL_EXPORT -DPIC -o .libs/matvar_cell.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c matvar_cell.c -o matvar_cell.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o matvar_struct.lo matvar_struct.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c matvar_struct.c  -DDLL_EXPORT -DPIC -o .libs/matvar_struct.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c matvar_struct.c -o matvar_struct.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -I.    -g -O2 -c -o mat73.lo mat73.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat73.c  -DDLL_EXPORT -DPIC -o .libs/mat73.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -g -O2 -c mat73.c -o mat73.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=link gcc -I.    -g -O2 -no-undefined -export-symbols ./matio.sym -version-info 10:2:1   -o libmatio.la -rpath /usr/local/lib snprintf.lo endian.lo io.lo inflate.lo read_data.lo mat5.lo mat4.lo mat.lo matvar_cell.lo matvar_struct.lo mat73.lo -lhdf5 -lz -lm
libtool: link: /usr/bin/nm -B  .libs/snprintf.o .libs/endian.o .libs/io.o .libs/inflate.o .libs/read_data.o .libs/mat5.o .libs/mat4.o .libs/mat.o .libs/matvar_cell.o .libs/matvar_struct.o .libs/mat73.o   | sed -n -e 's/^.*[  ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /usr/bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //' | sort | uniq > .libs/libmatio.exp
libtool: link: if test DEF = "`/usr/bin/sed -n -e 's/^[  ]*//' -e '/^\(;.*\)*$/d' -e 's/^\(EXPORTS\|LIBRARY\)\([         ].*\)*$/DEF/p' -e q .libs/libmatio.def`" ; then cp .libs/libmatio.def .libs/cygmatio-9.dll.def; else echo EXPORTS > .libs/cygmatio-9.dll.def; cat .libs/libmatio.def >> .libs/cygmatio-9.dll.def; fi
libtool: link:  gcc -shared .libs/cygmatio-9.dll.def  .libs/snprintf.o .libs/endian.o .libs/io.o .libs/inflate.o .libs/read_data.o .libs/mat5.o .libs/mat4.o .libs/mat.o .libs/matvar_cell.o .libs/matvar_struct.o .libs/mat73.o   -lhdf5 -lz  -g -O2   -o .libs/cygmatio-9.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmatio.dll.a
libtool: link: rm -f .libs/libmatio.exp .libs/libmatio.filter
libtool: link: ar cru .libs/libmatio.a  snprintf.o endian.o io.o inflate.o read_data.o mat5.o mat4.o mat.o matvar_cell.o matvar_struct.o mat73.o
libtool: link: ranlib .libs/libmatio.a
libtool: link: ( cd ".libs" && rm -f "libmatio.la" && ln -s "../libmatio.la" "libmatio.la" )
make[2]: 离开目录“/cygdrive/e/matio-1.5.17/src”
make[1]: 离开目录“/cygdrive/e/matio-1.5.17/src”
Making all in getopt
make[1]: 进入目录“/cygdrive/e/matio-1.5.17/getopt”
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src    -DREPLACE_GETOPT=1 -g -O2 -c -o libgetopt_la-getopt_long.lo `test -f 'getopt_long.c' || echo './'`getopt_long.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../src -DREPLACE_GETOPT=1 -g -O2 -c getopt_long.c  -DDLL_EXPORT -DPIC -o .libs/libgetopt_la-getopt_long.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../src -DREPLACE_GETOPT=1 -g -O2 -c getopt_long.c -o libgetopt_la-getopt_long.o >/dev/null 2>&1
/bin/sh ../libtool  --tag=CC   --mode=link gcc -DREPLACE_GETOPT=1 -g -O2   -o libgetopt.la  libgetopt_la-getopt_long.lo  -lm
libtool: link: ar cru .libs/libgetopt.a .libs/libgetopt_la-getopt_long.o
libtool: link: ranlib .libs/libgetopt.a
libtool: link: ( cd ".libs" && rm -f "libgetopt.la" && ln -s "../libgetopt.la" "libgetopt.la" )
make[1]: 离开目录“/cygdrive/e/matio-1.5.17/getopt”
Making all in tools
make[1]: 进入目录“/cygdrive/e/matio-1.5.17/tools”
gcc -DHAVE_CONFIG_H -I. -I../src    -I../src -I../getopt    -g -O2 -c -o matdump.o matdump.c
/bin/sh ../libtool  --tag=CC   --mode=link gcc -I../src -I../getopt    -g -O2    -o matdump.exe matdump.o ../src/libmatio.la -lhdf5 -lz ../getopt/libgetopt.la -lm
libtool: link: gcc -I../src -I../getopt -g -O2 -o .libs/matdump.exe matdump.o  ../src/.libs/libmatio.dll.a -lhdf5 -lz ../getopt/.libs/libgetopt.a -L/usr/local/lib
make[1]: 离开目录“/cygdrive/e/matio-1.5.17/tools”
Making all in test
make[1]: 进入目录“/cygdrive/e/matio-1.5.17/test”
gcc -DHAVE_CONFIG_H -I. -I../src    -I../src -I../getopt   -g -O2 -c -o test_mat.o test_mat.c
/bin/sh ../libtool  --tag=CC   --mode=link gcc -I../src -I../getopt   -g -O2 -L../src  -o test_mat.exe test_mat.o ../src/libmatio.la ../getopt/libgetopt.la -lhdf5 -lz -lm
libtool: link: gcc -I../src -I../getopt -g -O2 -o .libs/test_mat.exe test_mat.o  -L../src ../src/.libs/libmatio.dll.a ../getopt/.libs/libgetopt.a -lhdf5 -lz -L/usr/local/lib
gcc -DHAVE_CONFIG_H -I. -I../src    -I../src -I../getopt   -g -O2 -c -o test_snprintf.o test_snprintf.c
/bin/sh ../libtool  --tag=CC   --mode=link gcc -I../src -I../getopt   -g -O2   -o test_snprintf.exe test_snprintf.o  -lm
libtool: link: gcc -I../src -I../getopt -g -O2 -o .libs/test_snprintf.exe test_snprintf.o
make[1]: 离开目录“/cygdrive/e/matio-1.5.17/test”
Making all in documentation
make[1]: 进入目录“/cygdrive/e/matio-1.5.17/documentation”
make[1]: 对“all”无需做任何事。
make[1]: 离开目录“/cygdrive/e/matio-1.5.17/documentation”
make[1]: 进入目录“/cygdrive/e/matio-1.5.17”
make[1]: 对“all-am”无需做任何事。
make[1]: 离开目录“/cygdrive/e/matio-1.5.17”

tulipsliu@TulipsPC /cygdrive/e/matio-1.5.17
$ cd E:/dynarewp006/hybrid-mmv-1.0

tulipsliu@TulipsPC /cygdrive/e/dynarewp006/hybrid-mmv-1.0
$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of ob ject 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 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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for R... R
checking matio.h usability... no
checking matio.h presence... no
checking for matio.h... no
configure: error: Can't find MatIO header

tulipsliu@TulipsPC /cygdrive/e/dynarewp006/hybrid-mmv-1.0

这次测试是失败的后续还会想办法

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2020-6-23 08:21:07
好像多发一次, 因为卡了一下。 两篇一样的文章。

cygwin64 是模仿 Linux 系统,实际上最近朋友也教我虚拟机运行双系统 ,另一个系统是 ubuntu 系统。也是 Linux 系统。

sudo apt-get install git    等 ubuntu 命令。

cygwin64 是在 windows 下虚拟的  Linux 环境运行 shell 程序;

包括 Rstudio 有一个 shell 也是运行 shell 程序和命令的。


比如我编译一个原始代码 ,从 R官方下载  rugarch 工具包解压文件(一般是 .tz 压缩文件解压你放在你的文件盘)
比如我的是 E:/BuildPackages/

把工具包原始代码放在上面目录 E:/BuildPackages/rugarch/

继续在上面的文件路径  

setwd("E:/BuildPackages/ ")

system("R CMD check rugarch")

去测试一下,读者会喜欢的。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群