unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* compilation error on Apple M1
@ 2022-12-25 23:32 Damien Mattei
  2022-12-25 23:58 ` Damien Mattei
  2022-12-26  7:40 ` Aleix Conchillo Flaqué
  0 siblings, 2 replies; 7+ messages in thread
From: Damien Mattei @ 2022-12-25 23:32 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

hello,

on Apple M1 i have this error:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48:
note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
  CC       libguile_3.0_la-net_db.lo
  CC       libguile_3.0_la-socket.lo
  CC       libguile_3.0_la-regex-posix.lo
  CCLD     libguile-3.0.la
Undefined symbols for architecture arm64:
  "_iconv", referenced from:
      _mem_cd_iconveh_internal in libgnu.a(striconveh.o)
     (maybe you meant: _str_iconveh, _mem_iconveh ,
_scm_port_acquire_iconv_descriptors , _iconveh_open , _iconveh_close ,
_mem_cd_iconveh , _str_cd_iconveh , _scm_port_release_iconv_descriptors )
  "_iconv_close", referenced from:
      _iconveh_open in libgnu.a(striconveh.o)
      _iconveh_close in libgnu.a(striconveh.o)
  "_iconv_open", referenced from:
      _iconveh_open in libgnu.a(striconveh.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[3]: *** [libguile-3.0.la] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

any idea about this arm64?

regards,
Damien

[-- Attachment #2: Type: text/html, Size: 2190 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compilation error on Apple M1
  2022-12-25 23:32 Damien Mattei
@ 2022-12-25 23:58 ` Damien Mattei
  2022-12-26  5:45   ` Colin Woodbury
  2022-12-26  7:40 ` Aleix Conchillo Flaqué
  1 sibling, 1 reply; 7+ messages in thread
From: Damien Mattei @ 2022-12-25 23:58 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

while trying to compile guile 3.0.7 on Apple M1...

On Mon, Dec 26, 2022 at 12:32 AM Damien Mattei <damien.mattei@gmail.com>
wrote:

> hello,
>
> on Apple M1 i have this error:
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48:
> note: expanded from macro '__deprecated_msg'
>         #define __deprecated_msg(_msg)
> __attribute__((__deprecated__(_msg)))
>                                                       ^
> 1 warning generated.
>   CC       libguile_3.0_la-net_db.lo
>   CC       libguile_3.0_la-socket.lo
>   CC       libguile_3.0_la-regex-posix.lo
>   CCLD     libguile-3.0.la
> Undefined symbols for architecture arm64:
>   "_iconv", referenced from:
>       _mem_cd_iconveh_internal in libgnu.a(striconveh.o)
>      (maybe you meant: _str_iconveh, _mem_iconveh ,
> _scm_port_acquire_iconv_descriptors , _iconveh_open , _iconveh_close ,
> _mem_cd_iconveh , _str_cd_iconveh , _scm_port_release_iconv_descriptors )
>   "_iconv_close", referenced from:
>       _iconveh_open in libgnu.a(striconveh.o)
>       _iconveh_close in libgnu.a(striconveh.o)
>   "_iconv_open", referenced from:
>       _iconveh_open in libgnu.a(striconveh.o)
> ld: symbol(s) not found for architecture arm64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[3]: *** [libguile-3.0.la] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
>
> any idea about this arm64?
>
> regards,
> Damien
>

[-- Attachment #2: Type: text/html, Size: 2699 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compilation error on Apple M1
  2022-12-25 23:58 ` Damien Mattei
@ 2022-12-26  5:45   ` Colin Woodbury
  0 siblings, 0 replies; 7+ messages in thread
From: Colin Woodbury @ 2022-12-26  5:45 UTC (permalink / raw)
  To: Damien Mattei; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]

A fix for M1 chips was recently added to the master branch. Can you try compiling that instead of 3.0.7?

iPhoneから送信

> 2022/12/25 15:59、Damien Mattei <damien.mattei@gmail.com>のメール:
> 
> 
> while trying to compile guile 3.0.7 on Apple M1...
> 
>> On Mon, Dec 26, 2022 at 12:32 AM Damien Mattei <damien.mattei@gmail.com> wrote:
>> hello,
>> 
>> on Apple M1 i have this error:
>> 
>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
>>         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
>>                                                       ^
>> 1 warning generated.
>>   CC       libguile_3.0_la-net_db.lo
>>   CC       libguile_3.0_la-socket.lo
>>   CC       libguile_3.0_la-regex-posix.lo
>>   CCLD     libguile-3.0.la
>> Undefined symbols for architecture arm64:
>>   "_iconv", referenced from:
>>       _mem_cd_iconveh_internal in libgnu.a(striconveh.o)
>>      (maybe you meant: _str_iconveh, _mem_iconveh , _scm_port_acquire_iconv_descriptors , _iconveh_open , _iconveh_close , _mem_cd_iconveh , _str_cd_iconveh , _scm_port_release_iconv_descriptors )
>>   "_iconv_close", referenced from:
>>       _iconveh_open in libgnu.a(striconveh.o)
>>       _iconveh_close in libgnu.a(striconveh.o)
>>   "_iconv_open", referenced from:
>>       _iconveh_open in libgnu.a(striconveh.o)
>> ld: symbol(s) not found for architecture arm64
>> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>> make[3]: *** [libguile-3.0.la] Error 1
>> make[2]: *** [all] Error 2
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all] Error 2
>> 
>> any idea about this arm64?
>> 
>> regards,
>> Damien

[-- Attachment #2: Type: text/html, Size: 3393 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compilation error on Apple M1
  2022-12-25 23:32 Damien Mattei
  2022-12-25 23:58 ` Damien Mattei
@ 2022-12-26  7:40 ` Aleix Conchillo Flaqué
  2022-12-26 11:13   ` Damien Mattei
  1 sibling, 1 reply; 7+ messages in thread
From: Aleix Conchillo Flaqué @ 2022-12-26  7:40 UTC (permalink / raw)
  To: Damien Mattei; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2550 bytes --]

Hi Damien,

This looks like a linking issue probably related to how things are
installed in your system, not with Guile itself. And the issue seems to be
with libiconv. Usually that comes with macOS itself and is located in
/usr/lib/libiconv.2.dylib.

Building Guile on M1 is definitely possible and works. I would suggest
using Homebrew which already has all Guile dependencies figured out.
Actually, I just recently added the Apple Silicon chip fix that Colin
mentions to Homebrew as well (
https://github.com/Homebrew/homebrew-core/pull/118698), because even if you
solve the issue you are currently getting you are going to run into the
next one (which is that you need to disable JIT which makes Guile very slow
unless you apply that fix).

Also, if you use Guile from Homebrew you will benefit from Guile Homebrew
which has all these packages ready to be used:
https://github.com/aconchillo/homebrew-guile/tree/master/Formula

Some people dislike Homebrew very much and refuse to install it, so I
totally understand if that's the case.

Best,

Aleix

On Sun, Dec 25, 2022 at 3:33 PM Damien Mattei <damien.mattei@gmail.com>
wrote:

> hello,
>
> on Apple M1 i have this error:
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48:
> note: expanded from macro '__deprecated_msg'
>         #define __deprecated_msg(_msg)
> __attribute__((__deprecated__(_msg)))
>                                                       ^
> 1 warning generated.
>   CC       libguile_3.0_la-net_db.lo
>   CC       libguile_3.0_la-socket.lo
>   CC       libguile_3.0_la-regex-posix.lo
>   CCLD     libguile-3.0.la
> Undefined symbols for architecture arm64:
>   "_iconv", referenced from:
>       _mem_cd_iconveh_internal in libgnu.a(striconveh.o)
>      (maybe you meant: _str_iconveh, _mem_iconveh ,
> _scm_port_acquire_iconv_descriptors , _iconveh_open , _iconveh_close ,
> _mem_cd_iconveh , _str_cd_iconveh , _scm_port_release_iconv_descriptors )
>   "_iconv_close", referenced from:
>       _iconveh_open in libgnu.a(striconveh.o)
>       _iconveh_close in libgnu.a(striconveh.o)
>   "_iconv_open", referenced from:
>       _iconveh_open in libgnu.a(striconveh.o)
> ld: symbol(s) not found for architecture arm64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[3]: *** [libguile-3.0.la] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
>
> any idea about this arm64?
>
> regards,
> Damien
>

[-- Attachment #2: Type: text/html, Size: 4860 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compilation error on Apple M1
  2022-12-26  7:40 ` Aleix Conchillo Flaqué
@ 2022-12-26 11:13   ` Damien Mattei
  0 siblings, 0 replies; 7+ messages in thread
From: Damien Mattei @ 2022-12-26 11:13 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 4763 bytes --]

Hello Alex and Colin,

i was thinking also at the beginning of an M1 incompatibility but it seems
that my system was just missing some libraries:

libiconv (and before gc (garbage collector) ,libunistring,...)

i first use homebrew but each time i use it , it is useless for
compiling,and i had also to install the libs from source (i suppose the
homeberew lib version do not include headers for dev or something else or
put them in non standart locations...)

i cloned the guile at

git clone https://git.savannah.gnu.org/git/guile.git

and compile with

./configure --enable-mini-gmp (because i often have problem to install
correctly GMP for any program,not only guile)

and then it missed makeinfo, so i installed texinfo with homebrew this time

and then i continue the 'make' and it worked to compile but now i have

 an error at install i do not understand:

/usr/bin/install -c -m 644 weak-set.h weak-table.h weak-vector.h
'/usr/local/include/guile/3.0/libguile'
 .././build-aux/install-sh -c -d '/usr/local/include/guile/3.0/libguile'
 /usr/bin/install -c -m 644 version.h scmconfig.h
'/usr/local/include/guile/3.0/libguile'
/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-data-hook
 /usr/bin/install -c -m 644
libguile-3.0-gdb.scm				/usr/local/lib/libguile-3.0.a-gdb.scm
sed: -e: No such file or directory
make[5]: *** [install-data-hook] Error 1
make[4]: *** [install-data-am] Error 2
make[3]: *** [install-am] Error 2
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

note: i still have to disable JIT as alex mention it, i will do it at last.


In fact i was using guile 3.0.7. since many years from homebrew but at
some point i needed

 libguile.h for testing interaction from guile and C and the opposite
like in the examples

of the site:
https://www.gnu.org/software/guile/manual/html_node/C-Extensions.html


Damien

On Mon, Dec 26, 2022 at 8:41 AM Aleix Conchillo Flaqué <aconchillo@gmail.com>
wrote:

> Hi Damien,
>
> This looks like a linking issue probably related to how things are
> installed in your system, not with Guile itself. And the issue seems to be
> with libiconv. Usually that comes with macOS itself and is located in
> /usr/lib/libiconv.2.dylib.
>
> Building Guile on M1 is definitely possible and works. I would suggest
> using Homebrew which already has all Guile dependencies figured out.
> Actually, I just recently added the Apple Silicon chip fix that Colin
> mentions to Homebrew as well (
> https://github.com/Homebrew/homebrew-core/pull/118698), because even if
> you solve the issue you are currently getting you are going to run into the
> next one (which is that you need to disable JIT which makes Guile very slow
> unless you apply that fix).
>
> Also, if you use Guile from Homebrew you will benefit from Guile Homebrew
> which has all these packages ready to be used:
> https://github.com/aconchillo/homebrew-guile/tree/master/Formula
>
> Some people dislike Homebrew very much and refuse to install it, so I
> totally understand if that's the case.
>
> Best,
>
> Aleix
>
> On Sun, Dec 25, 2022 at 3:33 PM Damien Mattei <damien.mattei@gmail.com>
> wrote:
>
>> hello,
>>
>> on Apple M1 i have this error:
>>
>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48:
>> note: expanded from macro '__deprecated_msg'
>>         #define __deprecated_msg(_msg)
>> __attribute__((__deprecated__(_msg)))
>>                                                       ^
>> 1 warning generated.
>>   CC       libguile_3.0_la-net_db.lo
>>   CC       libguile_3.0_la-socket.lo
>>   CC       libguile_3.0_la-regex-posix.lo
>>   CCLD     libguile-3.0.la
>> Undefined symbols for architecture arm64:
>>   "_iconv", referenced from:
>>       _mem_cd_iconveh_internal in libgnu.a(striconveh.o)
>>      (maybe you meant: _str_iconveh, _mem_iconveh ,
>> _scm_port_acquire_iconv_descriptors , _iconveh_open , _iconveh_close ,
>> _mem_cd_iconveh , _str_cd_iconveh , _scm_port_release_iconv_descriptors )
>>   "_iconv_close", referenced from:
>>       _iconveh_open in libgnu.a(striconveh.o)
>>       _iconveh_close in libgnu.a(striconveh.o)
>>   "_iconv_open", referenced from:
>>       _iconveh_open in libgnu.a(striconveh.o)
>> ld: symbol(s) not found for architecture arm64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>> make[3]: *** [libguile-3.0.la] Error 1
>> make[2]: *** [all] Error 2
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all] Error 2
>>
>> any idea about this arm64?
>>
>> regards,
>> Damien
>>
>

[-- Attachment #2: Type: text/html, Size: 8043 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compilation error on Apple M1
@ 2022-12-26 13:19 dsmich
  0 siblings, 0 replies; 7+ messages in thread
From: dsmich @ 2022-12-26 13:19 UTC (permalink / raw)
  To: 'Damien Mattei'; +Cc: 'guile-devel'

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]



	-----------------------------------------From: "Damien Mattei" 
To: "guile-devel"
Cc: 
Sent: Monday December 26 2022 6:13:42AM
Subject: Re: compilation error on Apple M1

> sed: -e: No such file or directory

The bsd sed is different than gnu sed. There was a few patches sent
out a while ago (by RhodiumToad?) that improved building on *bsd.

I wonder if those will help?

 -Dale



[-- Attachment #2: Type: text/html, Size: 683 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: compilation error on Apple M1
       [not found] <2a517d79541e8c54b889639b3290b0eefd7dc22b@webmail>
@ 2022-12-26 23:35 ` Damien Mattei
  0 siblings, 0 replies; 7+ messages in thread
From: Damien Mattei @ 2022-12-26 23:35 UTC (permalink / raw)
  To: dsmich; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 3666 bytes --]

those last years i installed guile on at least 3 mac system,without problem
with read line
readline installed by homebrew ,the homebrew version seems to use gnu
readline:
https://formulae.brew.sh/formula/readline
https://tiswww.case.edu/php/chet/readline/rltop.html
simply by adding that:
(use-modules (ice-9 readline))
(activate-readline)
so i surprised of this problem,
but again with homebrew it is perhaps better to install from the source
too, i will try tomorrow...

i succeed in making work the first part of this :
https://www.gnu.org/software/guile/manual/html_node/C-Extensions.html

with a few modifications:
gcc `pkg-config --cflags guile-3.0` -shared -o libbessel.so -fPIC
 -lguile-3.0 bessel.c

instead of:

gcc -shared -o libbessel.so -fPIC bessel.c

perhaps updating the doc

Regards,

Damien




On Mon, Dec 26, 2022 at 10:46 PM <dsmich@roadrunner.com> wrote:

> Well, Apple also has a readline implementation that is similar but not
> quite the same as gnu readline.  You might need to install that along with
> maybe telling ./configure to use the gnu version.
>
> Just a guess..
>
> Actually, Guile looks for some specific symbols that the Apple lib doesn't
> provide, but Guile doesn't actually use those symbols.  At one time (well
> over 10 years ago) I got Guile to work fine with the Apple readline by
> removing those specific ./configure checks.
>
> But you are probably better off by installing gnu readline.
>
> -Dale
>
>
> -----------------------------------------
> From: "Damien Mattei"
> To: dsmich@roadrunner.com
> Cc:
> Sent: Monday December 26 2022 9:31:47AM
> Subject: Re: compilation error on Apple M1
>
> hello Dale,
>
> yes i had to install gsed (gnu sed):
> brew install gsed
>
> now it is almost ok
> but i do not understand anymore how to make work readline and this strange
> error:
>
> scheme@(guile-user)> (use-modules (ice-9 readline))
> While compiling expression:
> In procedure dlopen: file "guile-readline.dylib", message
> "dlopen(guile-readline.dylib, 0x0005): tried: 'guile-readline.dylib' (no
> such file), '/System/Volumes/Preboot/Cryptexes/OSguile-readline.dylib' (no
> such file), '/usr/lib/guile-readline.dylib' (no such file, not in dyld
> cache), 'guile-readline.dylib' (no such file),
> '/usr/local/lib/guile-readline.dylib' (no such file),
> '/usr/lib/guile-readline.dylib' (no such file, not in dyld cache)"
> scheme@(guile-user)>
> the second try made no error:
> scheme@(guile-user)> (use-modules (ice-9 readline))
> scheme@(guile-user)
> but it does not work the usual way:
> scheme@(guile-user)> (activate-readline)
> ;;; <stdin>:3:1: warning: possibly unbound variable `activate-readline'
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> Unbound variable: activate-readline
>
> Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
> scheme@(guile-user) [1]>
>
> <https://www.gnu.org/software/guile/manual/html_node/Loading-Readline-Support.html>
> https://www.gnu.org/software/guile/manual/html_node/Loading-Readline-Support.html
> but it is so long time since my initial config of readline for guile that
> perheaps i miss a step.
>
> Regards,
> Damien
>
> On Mon, Dec 26, 2022 at 2:19 PM <dsmich@roadrunner.com> wrote:
>
>>
>>
>> -----------------------------------------
>> From: "Damien Mattei"
>> To: "guile-devel"
>> Cc:
>> Sent: Monday December 26 2022 6:13:42AM
>> Subject: Re: compilation error on Apple M1
>>
>>
>> > sed: -e: No such file or directory
>>
>> The bsd sed is different than gnu sed.  There was a few patches sent out
>> a while ago (by RhodiumToad?) that improved building on *bsd.
>>
>> I wonder if those will help?
>>
>>   -Dale
>>
>>
>>
>>

[-- Attachment #2: Type: text/html, Size: 7640 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-26 23:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2a517d79541e8c54b889639b3290b0eefd7dc22b@webmail>
2022-12-26 23:35 ` compilation error on Apple M1 Damien Mattei
2022-12-26 13:19 dsmich
  -- strict thread matches above, loose matches on Subject: below --
2022-12-25 23:32 Damien Mattei
2022-12-25 23:58 ` Damien Mattei
2022-12-26  5:45   ` Colin Woodbury
2022-12-26  7:40 ` Aleix Conchillo Flaqué
2022-12-26 11:13   ` Damien Mattei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).