Mathematica中文论坛-非官方

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 13753|回复: 4

豆粑粑 ubuntu 18.04 install "snap-higher-order"

[复制链接]

525

主题

594

帖子

2980

积分

金牌会员

Rank: 6Rank: 6

积分
2980
发表于 2019-4-7 08:29:07 | 显示全部楼层 |阅读模式
本帖最后由 meatball1982 于 2019-4-7 09:13 编辑

install "snap-higher-order" on ubuntu 18.04


https://www.twblogs.net/a/5b8b1af32b717718832d534d




make all

then

nvalid use of incomplete type ‘struct __exception’


add the following to

snap-higher-order/glib-core/bd.cpp
there is still lots of warning, but it works.
according to :
  1. https://github.com/snap-stanford/snap/issues/146
复制代码
and
  1. https://github.com/rkrohn/redditmodel/commit/d1cedbc3471fc2901d4239b30317d0b458b2ae99
复制代码



12 #elif defined(GLib_GLIBC) || defined(GLib_BSD)
13 struct __exception {
14         int    type;      /* Exception type */
15     char*  name;      /* Name of function causing exception */
16     double arg1;      /* 1st argument to function */
17     double arg2;      /* 2nd argument to function */
18     double retval;    /* Function return value */
19 };
20
21 int _matherr(struct __exception* e){



回复

使用道具 举报

525

主题

594

帖子

2980

积分

金牌会员

Rank: 6Rank: 6

积分
2980
 楼主| 发表于 2019-4-7 09:12:53 | 显示全部楼层
本帖最后由 meatball1982 于 2019-4-8 09:51 编辑

make arpack
modify the ARmake.inc

https://www.linuxquestions.org/q ... n-libraries-440794/


MAKE=/usr/bin/make
FFLAGS        = -O

我的ARmake.inc放上来了。自己参考修改。
别,生成的libarpack_linux.a
sudo cp libarpack_linux.a /usr/lib

ARmake.zip

1.39 KB, 下载次数: 3

回复 支持 反对

使用道具 举报

525

主题

594

帖子

2980

积分

金牌会员

Rank: 6Rank: 6

积分
2980
 楼主| 发表于 2019-4-8 09:40:22 | 显示全部楼层
本帖最后由 meatball1982 于 2019-4-8 09:48 编辑

真是一个大坑,
在虚拟机上。
  1. g++ -std=c++98 -Wall -O3 -DNDEBUG -fopenmp -DF77_POST -o motifclustermain motifclustermain.cpp ../../snap-adv/motifcluster.cpp ../../snap-core/Snap.o -I../../snap-core -I../../snap-adv -I../../glib-core -I../../snap-exp  -larpack -lrt /usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.a
复制代码
加了最后这一句。
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.a
否则会一堆gfortran不认谁的错。
“undefined reference to '_gfortran_st_write'




在自己的机器上。
  1. g++ -std=c++98 -Wall -O3 -DNDEBUG -fopenmp -DF77_POST -o motifclustermain motifclustermain.cpp ../../snap-adv/motifcluster.cpp ../../snap-core/Snap.o -I../../snap-core -I../../snap-adv -I../../glib-core -I../../snap-exp  -larpack -lrt /usr/lib/gcc/x86_64-linux-gnu/4.8.5/libgfortran.so
复制代码
最后加的是
/usr/lib/gcc/x86_64-linux-gnu/4.8.5/libgfortran.so
否则会出现。
can not be used when making a PIE object; recompile with -fPIC
一类的错误。
应该是两个机器的gcc不太一样的原因。.so .a的区别,我暂时不知道。可能还得看看c++的书。应该一个动态的,一个是静态的,根据自己的机器,尝试一下。
另外,ARpack里的UTIL下的second.f

  1. *     .. External Functions ..
  2.       REAL               ETIME
  3. <font color="#ff0000">*      EXTERNAL           ETIME</font>
  4. *     ..
  5. *     .. Executable Statements ..
  6. *

  7. <font color="#ff0000">*      T1 = ETIME( TARRAY )</font>
  8.       T  = TARRAY( 1 )

  9.       RETURN
复制代码
我也给注释了一下。根说,这个函数总出错,大体看了一下,应该是个计时用的。对程序的结果影响不大。


回复 支持 反对

使用道具 举报

525

主题

594

帖子

2980

积分

金牌会员

Rank: 6Rank: 6

积分
2980
 楼主| 发表于 2019-5-6 13:56:40 | 显示全部楼层
home 的x220是

  1. g++ -std=c++98 -Wall -O3 -DND
  2. EBUG -fopenmp -DF77_POST -o motifclustermain motifclustermain.cpp ../../snap-adv/motifcluster.cpp ../../snap-core/Snap.o -I../../snap-core -I../../snap-adv -I../../glib-core -I../../snap-exp  -larpack -lrt /usr/lib/gcc/x86_64-linux-gnu/5.4.0/libgfortran.so
复制代码
回复 支持 反对

使用道具 举报

525

主题

594

帖子

2980

积分

金牌会员

Rank: 6Rank: 6

积分
2980
 楼主| 发表于 2019-5-6 14:03:41 | 显示全部楼层
meatball1982 发表于 2019-4-7 09:12
make arpack
modify the ARmake.inc
  1. sudo cp /usr/lib/libarpack_linux.a /usr/lib/libarpack.a
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Mathematica中文论坛-非官方 ( 辽ICP备16001491号-1

GMT+8, 2024-3-29 21:05 , Processed in 0.120739 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表