惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

博客园 - victl

gnupg的使用 KDE5 Plasma日常软件使用心得[常更常新] 终于忍不了xfce的界面,换成kde吧,超极酷!相信每个人都会爱上它的! 小米随身wifi到手,准备开搞当个ap给linux共享wifi上网! zsh会读取的配置文件 类苹果DOCK,cairo-dock++gvfs文件管理 图形实用工具grsync gparted programming 词典:goldendict 安装网络相关工具 若干大件:libreoffice, jdk, calibre 一些字体(来源:archlinuxcn) 解决archlinuxcn的keyring问题 安装fcitx输入中文 video inkscape digikam wqy-zenhei, firefox-i18n-zh-cn, flashplugin, wqy-microhei ttf-arphic-ukai ttf-arphic-uming file-roller unrar zip unzip p7zip arj etc Configuring Zsh makethe 'locate' available to the system. Configuring LAMP
spatialie运行出错的解决办法
victl · 2016-10-06 · via 博客园 - victl

如果程序链接到spatialite出现以下错误:

lt-demo2: geos_ts_c.cpp:3657: int GEOSCoordSeq_setOrdinate_r(GEOSContextHandle_t, geos::geom::CoordinateSequence*, unsigned int, unsigned int, double): Assertion `0 != cs' failed.
[1]    15401 abort (core dumped)  ./demo2

十有八九是因为spatialite依赖的库GEOS多线程出问题了,我碰到的情况是GEOS 3.5.0 + spatialite 4.3.0a。解决办法是下载spatialite 4.4.0-RC1的源码,用以下命令重新编译:

./configure --prefix=/usr --enable-libxml2  CPPFLAGS="$CPPFLAGS -DGEOS_USE_ONLY_R_API"

因为GEOS库几乎所有函数都有两个版本:非线程安全(不带'_r',比较老)和线程安全(带'_r')的版本。新版spatialite(4.4.0-RC1)编译也必须加上CPPFLAGS="$CPPFLAGS -DGEOS_USE_ONLY_R_API"这个选项才会调用线程安全的版本。

该问题我在macOS Homebrew和Archlinux官方源安装的版本里都遇到了,是个埋藏很深的雷。写在这里希望对后来者有所帮助。

ref: https://groups.google.com/forum/?hl=en&fromgroups=#!topic/spatialite-users/9-32tVQ-720