last updated at March 30, 2023

Dennou Tools for macOS

An example of how to install Dennou Tools in macOS

Updates

Introduction

This page describes examples of how to install Dennou Tools in macOS.
DCL’s dependent libraries are installed by using MacPorts and DCL is installed manually. Ruby is installed from rbenv and Ruby libraries are installed from RubyGems.

Do not install both Homebrew and MacPorts in the same system.
Some unexpected conflicts and errors may occur if both are installed together.

If you have any troubles or questions, contact Hiroki Kashimura <hiroki _(at)_ gfd-dennou.org>.

Installation steps

  1. Install Xcode from Mac App Store.
  2. In Terminal.app, execute
    $ xcode-select --install
    
    to install the Xcode command line tools.
  3. Next type
    $ sudo xcodebuild -license
    
    to agree the license of Xcode.
  4. Download XQuartz-*-*-*.dmg and install XQuartz.app。
  5. Download MacPorts-*-*-*.pkg and install MacPorts.
  6. Update the ports tree of MacPorts.
    $ sudo port selfupdate 
    
  7. Install some DCL-dependent libraries and DCL.
    $ sudo port -s install gcc12
    $ sudo port install pkgconfig
    $ sudo port install gtk3
    $ curl -O http://www.gfd-dennou.org/library/dcl/dcl-7.5.1.tar.gz
    $ tar zxvf dcl-7.5.1.tar.gz
    $ export FC=gfortran-mp-12 (for bash or zsh)
    $ export CC=gcc-mp-12 (for bash or zsh)
    $ ./configure --prefix=[directory where you want to install]
    $ make
    $ make install
    
    Then add the following options in installed "dclconfig"
     add "-L/opt/local/lib/gcc12" to ldflags
     add "-lgfortran" to ldlibs
    
  8. Install GPhys-dependent non-Ruby libraries.
    $ sudo port install fftw-3 gsl netcdf
    
  9. Install rbenv.
    $ sudo port install rbenv ruby-build 
    
  10. Install Ruby by using rbenv. (Set CC to use gcc-mp-12. Please use ruby 3.1)
    $ export CC=gcc-mp-12
    $ export DLDFLAGS "-Wl,-undefined,dynamic_lookup"
    $ rbenv install 3.1.3
    $ rbenv global 3.1.3
    $ rbenv versions
    $ gem install bundler rake rake-compiler
    
  11. Add the following lines to .zprofile to set $PATH.
      export PATH="$HOME/.rbenv:$PATH"
      eval "$(rbenv init - zsh)" 
    
  12. Reboot Terminal.app
  13. Verify which version of ruby is set for default now.
    $ ruby --version
    
  14. Install Dennou-Ruby Tools from RubyGems.
    $ export FC=gfortran-mp-12
    $ gem install ruby-dcl
    $ gem install ruby-fftw3 -- --with-fftw3-dir=/opt/local/
    $ gem install gphys
    
  15. Activate newly installed ruby commands.
    $ rbenv rehash 
    

Contact

Hiroki Kashimura
hiroki (at) gfd-dennou.org


This document was translated from LATEX by HEVEA.