From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pikachu Hy via "Developers list for Guile, the GNU extensibility library" Newsgroups: gmane.lisp.guile.devel Subject: Build Guile 1.8 with CMake Date: Sun, 09 Aug 2020 19:51:29 +0800 Message-ID: <173d30fb89a.109fe82d512719.4820149487358189035@zoho.com.cn> Reply-To: Pikachu Hy Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17599"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: ZohoCN Mail To: "guile-devel" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Aug 09 15:38:40 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k4lX5-0004Uu-C1 for guile-devel@m.gmane-mx.org; Sun, 09 Aug 2020 15:38:39 +0200 Original-Received: from localhost ([::1]:53802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4lX4-0004Vg-EJ for guile-devel@m.gmane-mx.org; Sun, 09 Aug 2020 09:38:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4jrg-0003aC-2y for guile-devel@gnu.org; Sun, 09 Aug 2020 07:51:48 -0400 Original-Received: from sender2-pp-o92.zoho.com.cn ([163.53.93.251]:25301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k4jrc-00052z-58 for guile-devel@gnu.org; Sun, 09 Aug 2020 07:51:47 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1596973892; cv=none; d=zoho.com.cn; s=zohoarc; b=HbaJ7OwREPMUoKCuiji/XMbCY4b/XHLA1Gu2UpqdxQCDQfNje2wNApIQviLFLY43vsWdyclAjKie7/W7taKOJDCQcjt8YEG3hAFtohoINeS/khW4+Z/h+1EN+4Cf7EujOD565eCa+FY2wuYGuMuXt9nMSaLfpRhoL2uuvSkcNos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1596973892; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=LMpZyDSHLyrYcHaWQWYDhLt1ywOdSH4Lss7MOTFr7Io=; b=XKJBNLnnETomLgpMvuUXKQSszepuq6KqKYGJkD8jdYXdLh+jd73a+xZPQxlWANY1Ym4fXvCX+aHxAWMGNNt++zAEEkFjvBTDHPWwVhmgzcF8EnosmbwWsaD4dqTWlJ+4HHyXy1Dn3hp37clh/QMYyjw4bJwQTkhzO41w11IbL40= ARC-Authentication-Results: i=1; mx.zoho.com.cn; spf=pass smtp.mailfrom=pikachuhy@zoho.com.cn; dmarc=pass header.from= header.from= Original-Received: from mail.baihui.com by mx.zoho.com.cn with SMTP id 1596973889693656.6811071534883; Sun, 9 Aug 2020 19:51:29 +0800 (CST) Original-Received: from [223.104.21.246] by mail.zoho.com.cn with HTTP;Sun, 9 Aug 2020 19:51:29 +0800 (CST) Importance: Medium X-Mailer: ZohoCN Mail Received-SPF: pass client-ip=163.53.93.251; envelope-from=pikachuhy@zoho.com.cn; helo=sender2-pp-o92.zoho.com.cn X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 07:51:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 09 Aug 2020 09:37:56 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20577 Archived-At: hi, I'd like to introduce my guile cmake build scripts to you: https://github.com/PikachuHy/guile Its final target is to provide an MSVC-version guile, which is basic work of MSVC-version TeXmacs. At present, you can use my cmake scripts to build guile 1.8 in ubuntu 20.04 and Windows mingw32. In the future, I will continue to explore the way of providing well-running version guile 1.8 in Windows. TL;DR Motivation TeXmacs is an useful scientific editing platform, which depends on Guile 1.8 now. I'm a heavy user of TeXmacs and almost use it everyday. When the error occurs in TeXmacs, it's a terrible user experience. Thus, I want to debug TeXmacs and custom it. Unfortunately, building a debug environment is not easy, especially my work heavily depends on Windows System. There are many mingw version guiles in GitHub(search with keywords: guile mingw). https://github.com/jralls/guile https://github.com/mkeeter/guile-mingw/ https://github.com/cygwinports-extras/mingw64-i686-guile https://github.com/slowphil/mingw-w64-guile1.8 My work bases on mingw-w64-guile1.8, which is used by Windows-version TeXmacs and use the mirror of guile https://github.com/texmacs/guile Implementation Current code host in: https://github.com/PikachuHy/guile Main scripts: CMakeLists.txt libguile/CMakeLists.txt cmake/* and others for test Main difficulty: How to generate config.h? I use a stupid but useful way, write all check cases one by one. https://github.com/PikachuHy/guile/blob/1.8-cmake/cmake/AutotoolCheck.cmake I think this maybe helpful for other projects when writing cmake script. Another difficulty: How to generate xxx.x (e.g. alist.x) In original code, it used a generated sh script named guile-snarf. I write a python script with the same function to finish this work. https://github.com/PikachuHy/guile/blob/1.8-cmake/cmake/gen_dot_x.py Notice that, I also write cmd scripts and sh scripts for the same work. But finally, I choose python-version scripts as my default scripts. Result My development IDE is CLion 2020.2 with its bundled cmake. In ubuntu 20.04 Guile is built successfully and all examples run well. All tests run successfully except document-related test. I build the latest TeXmacs successfully and it runs well with both static and dynamic Guile library. In windows 10 Version 10.0.19041 Build 19041, msys2/mingw64 (CLion check: w64 8.0) Guile is built successfully, but crashes. https://github.com/PikachuHy/guile/issues/5 The main problem is the lengths of long and pointers differ. In windows 10 Version 10.0.19041 Build 19041, msys2/mingw32 (CLion check: w64 8.0) Guile is built successfully and run well. Howerver, some examples run crash. (e.g. box-dynamic) When I built the latest TeXmacs, I met the problem: sys/socket.h: No such file or directory https://github.com/PikachuHy/guile/issues/12 https://stackoverflow.com/questions/13694233/sys-socket-h-in-mingw32 In windows 10 Version 10.0.19041 Build 19041, MSVC Guile is compiled fail for no MSVC gmp library. https://github.com/PikachuHy/guile/issues/10 We should firstly compile the MSVC-version gmp. I find that, https://wiki.sagemath.org/windows/msvc32-2008-gmp Conclusion and Future work This is just the first step to build MSVC-version guile(and MSVC-version TeXmacs). Now we can use cmake to build guile, it is convenient to debug in CLion. (Although CLion supports Makefile in 2020.2). Next work is to write cmake scripts for gmp and provide a well-running version guile in Windows. Happy Hacking PikachuHy