Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Instantly share code, notes, and snippets.

@t-nissie
Last active May 22, 2017 06:53
Show Gist options
  • Save t-nissie/d5b51ffd3ddb5c923bd6 to your computer and use it in GitHub Desktop.
Save t-nissie/d5b51ffd3ddb5c923bd6 to your computer and use it in GitHub Desktop.
gnupackをアップグレードしたらまずはじめにやるべきこと

gnupackをアップグレードしたらまずはじめにやるべきこと

gnupackは手軽にcygwinとemacsを導入できるパッケージソフトウェア。 アーカイブファイルをc:\以下に展開するだけですぐに利用できる。

gnupack Users Guide: http://gnupack.osdn.jp/docs/UsersGuide.html

ただし、新しいバージョンのgnupackを展開してアップグレードすると c:\以下にディレクトリが積みあがっていくだけ。環境の移行には このメモに書かれている一連の操作が必要。

# ls -d1 /c/gnupack_devel-*
/c/gnupack_devel-12.00-2014.12.29/
/c/gnupack_devel-12.01-2015.01.11/
/c/gnupack_devel-13.02-2015.05.24/
/c/gnupack_devel-13.05-2015.07.19/

proxyを陽に使っているのなら、apt-cygなどのために設定が必要

If you are explicitly using a proxy server to access the Internet, you may need to set http_proxy and https_proxy environment variable for wget and git commands. For example,

$ export   ftp_proxy=http://proxy.example.com:8080/
$ export  http_proxy=http://proxy.example.com:8080/
$ export https_proxy=http://proxy.example.com:8080/

Or you can set them in /etc/wget.

Normally, you do not have to set them.

.bashrc, .emacs, .bash_history, .ssh

古いバージョンからファイルをコピー.ドットファイルを忘れないこと.

feramがコンパイルできることを確認

# export LANG=C
# apt-cyg update
# apt-cyg install gcc-fortran libfftw3-devel libfftw3-omp3 liblapack-devel
# cp /usr/lib/lapack/cyg*.dll /usr/bin   # Copy DLLs under the PATH.
# gfortran --version
GNU Fortran (GCC) 4.9.3
# cd
# mkdir -p f/feram
# cd f/feram
# wget http://sourceforge.net/projects/loto/files/feram/feram-0.24.02/feram-0.24.02.tar.xz
# tar xf feram-0.24.02.tar.xz
# cd feram-0.24.02
# mkdir Cygwin
# cd Cygwin
# ../configure CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
# make -j4
# objdump.exe -p src/feram.exe | head -n 12

src/feram.exe:     file format pei-i386

Characteristics 0x127
        relocations stripped
        executable
        line numbers stripped
        large address aware
        32 bit words

Time/Date               Mon Jan  5 05:19:47 2015
Magic                   010b    (PE32)
# cd src
# OMP_NUM_THREADS=4 ./feram_fftw_wisdom 10000 16 16 16 1 FFTW_PATIENT
# mv wisdom_new wisdom
# OMP_NUM_THREADS=4 make check

Autotools

autoconfとautomakeをインストール

# LANG=C apt-cyg install autoconf automake

cjpeg

cjpegが欲しい

# LANG=C apt-cyg install libjpeg-devel

aspell

aspellをインストールしてEmacsから使えることを確認。

# export LANG=C
# apt-cyg install aspell aspell-en

X

参考: http://calcurio.com/wordpress/?p=1394

apt-cyg install xorg-server xinit xorg-docs X-start-menu-icons

スタートメニューにXWin Serverが追加されるので、それをクリックすると Xとxtermが起動するはず。

トラブルシューティング

Xが起動しない。startxで "unable to remap *.dll" というエラーが出る

ashを直接ダブルクリックして、開いたコマンドプロンプトから /bin/rebaseallを実行。

Xが起動しない。クリップボードがどうのこうのというエラーが出る

xinit -- -multiwindow -clipboard &
export DISPLAY=:0.0
xterm &
ssh -X -Y -l kaoru foo.example.com

epstopdf

Windows 8.1の(gnupackでインストールした)Cygwinでepstopdf.plが使えた。

GhostScript (gs) はgs915w32.exeを http://www.ghostscript.com からダウンロードしてインストールした。~/.bashrcにそのgsへのPATHを

PATH=/c/Program\ Files\ \(x86\)/gs/gs9.15/bin:$PATH

などと書いておく。

epstopdf.plは/usr/local/bin/に次の変更をして置いておく。 tmpファイルについてのエラーを避けるための変更。 Cygwinでも現在はパイプを使えるみたい。

--- epstopdf.pl.original        2015-02-27 20:21:02.961047400 +0900
+++ epstopdf.pl 2015-02-27 20:33:29.795650400 +0900
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/bin/perl
  # $Id: epstopdf.pl 34293 2014-06-18 18:16:38Z karl $
  # (Copyright lines below.)
  #
@@ -179,7 +179,7 @@
  END_COPYRIGHT
  my $title = "$program $ident\n";
  
-my $on_windows = $^O =~ /^MSWin/;
+my $on_windows = 1;
  my $on_windows_or_cygwin = $on_windows || $^O eq "cygwin";
  
  ### ghostscript command name
@@ -665,7 +665,7 @@
  my $OUT; # filehandle for output (GS pipe or temporary file)
  use File::Temp 'tempfile';
  if ($::opt_gs) {
-  if (! $on_windows_or_cygwin) { # list piped open works
+  if (1) { # list piped open works
     push @GS, qw(- -c quit);
     debug "Ghostscript pipe: @GS";
     open($OUT, '|-', @GS)
/* -*-CSS-*-
* style.css for README.html of feram
* Time-stamp: <2014-08-26 15:50:24 takeshi>
* Author: Takeshi NISHIMATSU
*/
body {
color: black;
font-family: verdana, arial, helvetica, sans-serif;
}
h1, h2, h3, h4, h6 {
font-family: verdana, arial, helvetica, sans-serif;
}
h1 {
color: #dd0000;
background-color: #fff0f0;
font-size: 230%;
}
h2 {
border-top: red 5px solid;
border-bottom: red 1px solid;
padding-left: 8px;
background-color: #fff0f0;
}
h3 {
border-top: red 2px solid;
border-bottom: red 1px solid;
padding-left: 4px;
}
h4 {
border-top: red 1px solid;
padding-left: 4px;
background-color: #fff0f0;
}
h5 {
font-size: larger;
font-family: courier, verdana, arial, helvetica, sans-serif;
padding-top: 10px;
color: darkred;
}
pre {
font-family: monospace, courier, verdana, arial, helvetica, sans-serif;
font-size: 120%;
padding-right: 0.5em;
padding-left: 0.5em;
padding-top: 0.1ex;
padding-bottom: 0.1ex;
margin-left: 0.5em;
margin-right: 1.0em;
white-space: pre;
color: darkred;
background-color: #f3f3f3;
}
p img {
width: 32%;
margin: auto;
display: block;
}
div.figure div.figcaption {
width: 60%;
margin: auto;
display: block;
}
div.navi {
text-align: right;
margin-right: 1.0em;
}
div.contents {
margin-left: 10%;
}
img{
width: 30%;
margin: auto;
margin-top: 3.0em;
display: block;
}
figure figcaption{
width: 60%;
margin: auto;
margin-bottom: 3.0em;
display: block;
}
table{
border-top: 1px solid;
border-left: 1px solid;
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
text-align: center;
margin: auto;
}
th{
border-right: 1px solid;
border-bottom: 1px solid;
background-color: #fff0f0;
padding: 0.3em 1em;
}
td{
border-right: 1px solid;
border-bottom: 1px solid;
padding: 0.3em 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment