From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pikachuhy@163.com Newsgroups: gmane.lisp.guile.devel,gmane.editors.texmacs.devel Subject: Build Guile 1.8 with CMake Date: Sun, 9 Aug 2020 16:12:28 +0800 (CST) Message-ID: <5F2FAC54.44DA61.26521@m12-15.163.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15895"; mail-complaints-to="usenet@ciao.gmane.io" Cc: texmacs-dev@gnu.org To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Aug 09 15:38:10 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 1k4lWb-00040h-JA for guile-devel@m.gmane-mx.org; Sun, 09 Aug 2020 15:38:09 +0200 Original-Received: from localhost ([::1]:51990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4lWZ-0003kt-Tc for guile-devel@m.gmane-mx.org; Sun, 09 Aug 2020 09:38:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4gRn-0001GP-8t for guile-devel@gnu.org; Sun, 09 Aug 2020 04:12:51 -0400 Original-Received: from m12-15.163.com ([220.181.12.15]:57575) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k4gRg-0000kC-CX for guile-devel@gnu.org; Sun, 09 Aug 2020 04:12:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=MIME-Version:Subject:From:Message-Id:Date; bh=avAJF ZG9CjaOYvj0LEDkYkAEP0+HXXez7eKjUxa3ExE=; b=Q4b1acJYrn6FSOKoFY6Ki 1bUMSzSnYcNXSqRwIi0S8tlIETLMHcrTOhlsSxL6rD5U5t5vXtmjbkcDYLtZ3kfI 1LIe1BxqUuwDuvV1PAtvr26TtmP4dJWzFcapRNuU8qKntaA3Q6wK1GDsTzBn9Kmt XgME2QZqqFf4BMHZbzIcfo= Original-Received: from [192.168.233.1] (unknown [223.104.21.246]) by smtp11 (Coremail) with SMTP id D8CowACnx9NSrC9fJMw+FA--.11583S2; Sun, 09 Aug 2020 15:57:07 +0800 (CST) X-CM-TRANSID: D8CowACnx9NSrC9fJMw+FA--.11583S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJw43XrW5Ar1UXw4xWr18Grg_yoWrJryDpa 1rK342grW0qw4UJw1vkF1UGr40qanxJw15W34rGw4rXrnFga409rWSk3yay3srWw1kGF42 9w1Fv3yrWa18AFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UuGQkUUUUU= X-Originating-IP: [223.104.21.246] X-CM-SenderInfo: 5slntupkxk5qqrwthudrp/1tbiNBR7+1aD5DtyUQAAsJ Received-SPF: pass client-ip=220.181.12.15; envelope-from=pikachuhy@163.com; helo=m12-15.163.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/09 03:57:10 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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:20575 gmane.editors.texmacs.devel:6050 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