Building gmtmex on Linux

オープン
#8 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
c, linux, matlab

調査の方向性

README と gmtmex.c、gmtmex_parser.c、gmt.m のエントリポイントを、報告されている Ubuntu 18.04、MATLAB R2019a、GMT 6.1.0 のビルドコマンドと併せて確認してください。動作する Linux のビルドおよびランタイムライブラリの設定を文書化し、手順が gmtmex.mexa64 の生成方法と使用方法を正確に説明していることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

While searching for documentation regarding building gmtmex on Linux, I noticed that the readme was looking for volunteers. With the steps outlined below, I am able to get GMT to work with my MATLAB project on Ubuntu 18.04. I am sure there is a more elegant way of achieving this, however, I thought it best to share this solution, since it does appear to work well.

With both MATLAB R2019a and GMT Version 6.1.0_3ede8d1_2019.08.04 installed in /home, in the gmtmex directory cloned from GitHub:

  1. Built gmtmex object file as
    gcc -I$GMT_dir/include/gmt -I$MATLAB_dir/extern/include -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=c99 -DGMT_MATLAB -I$GMT_dir/include/gmt -c gmtmex.c

  2. Built gmtmex_parser object file as
    gcc -I$GMT_dir/include/gmt -I$MATLAB_dir/extern/include -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=c99 -DGMT_MATLAB -I$GMT_dir/include/gmt -c gmtmex_parser.c

  3. Compiled mex file as
    $MATLAB_dir/bin/mex -DGMT_MATLAB -I$GMT_dir/include/gmt -I/$GMT_dir/include/gmt/lib -I$MATLAB_dir/extern/include gmtmex.o gmtmex_parser.o -L$GMT_dir/lib -lgmt -L$MATLAB_dir/bin/glnxa64 -lmx -lmex -output gmtmex.mexa64

Copied over the gmt.m and generated gmtmex.mexa64 files to $GMT_dir/bin, added $GMT_dir along with subfolders to MATLAB path.

In order to prevent runtime errors associated with MATLAB not being able to find shared libraries, launch MATLAB as:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GMT_dir/lib
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtiff.so.5:/usr/lib/x86_64-linux-gnu/libstdc++.so.6
$MATLAB_dir/bin/matlab

I hope this proves to be helpful. Please let me know in case further tests are required.

主要言語
MATLAB
スター
53
フォーク
19
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GenericMappingTools/gmtmex のほかの issue

GenericMappingTools/gmtmex の issue をすべて見る

似ている issue

MATLAB の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。