Building gmtmex on Linux
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- build-system, documentation
Research direction
Review the README and the gmtmex.c, gmtmex_parser.c, and gmt.m entry points alongside the reported Ubuntu 18.04, MATLAB R2019a, and GMT 6.1.0 build commands. Document the working Linux build and runtime-library setup, then verify that the instructions accurately describe producing and using gmtmex.mexa64.
Written by the indexing model from the issue text.
Description
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:
-
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 -
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 -
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.
- Dominant language
- MATLAB
- Stars
- 53
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GenericMappingTools/gmtmex
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
GenericMappingTools/gmtmex#33 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
GenericMappingTools/gmtmex#31 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
GenericMappingTools/gmtmex#30 · 1 comment ·
-
Inability to free what GMT_Encode_Options returnMay be free again @PaulWessel claimed this 2064 days ago, and no pull request is open. Open
GenericMappingTools/gmtmex#18 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
GenericMappingTools/gmtmex#12 · 6 comments ·
All issues in GenericMappingTools/gmtmex
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
MohammadRaziei/ctoon#12 ·
-
easy first-contributor first-contributors good first issue help wanted matlab up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
fork-commit-merge/fork-commit-merge#8766 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
UniprJRC/DSwithMATLAB#253 ·
-
area: math-chaos priority: P1 size: S type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ibra-kdbra/Math-Problems#309 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100