taotao0330的个人博客分享 http://blog.sciencenet.cn/u/taotao0330

博文

GTS install on mac

已有 3451 次阅读 2016-3-23 22:24 |系统分类:科研笔记

1. Install Glib

  Run in Terminal:

  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

  Run:

  brew install glib

 (the installation path: /usr/local/Cellar/glib)



2. test Glib

  Run:

  gcc `pkg-config --cflags --libs glib-2.0` -o test test.c


  test.c: 

  #include <stdio.h>

  #include <glib.h>

  int main(int argc, char** argv) {

     GList* list = NULL;

      list = g_list_append(list, "Hello world!");

      char* str = g_list_first(list)->data;

      printf("The first item is '%s'n", str);

      return 0;

  }


3. Install GTS

  code: https://sourceforge.net/projects/gts/

 

  Run:

  cd gts-0.7.6

  ./configure

  make

  make install



4. Test GTS

  in 'example' folder and Run:

  ./cartesian --help




reference:

http://macappstore.org/glib/

http://askubuntu.com/questions/90338/how-to-compile-a-helloworld-glib-program 

http://stackoverflow.com/questions/11466904/using-glib-library-in-c-program

http://gts.sourceforge.net/install.html 





https://wap.sciencenet.cn/blog-452843-964490.html

上一篇:mac PETSc 安装
下一篇:linux 解压 rar
收藏 IP: 134.61.37.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-20 06:31

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部