High,

that was a very useful remark, how could one have the idea that default of gcc is x86_64 on an arm64 machine. It was also hard to find out that my version is

armv8.5-a

(any standard way to find that out by some command or whatever for a later documentation of my trial and errors?)

I proceeded as Gregory has suggested, not know what concrete things one has to do for

   But you have also configure target options for that:
   ./configure --help
   |snip]
   System types:
      --build=BUILD     configure for building on BUILD [guessed]
      --host=HOST       cross-compile to build programs to run on HOST [BUILD]
      --target=TARGET   configure for building compilers for TARGET [HOST]

I checked the configure log file, and for me this seems ok, e.g.

ac_cv_target=arm-apple-darwin22.3.0

FRICAS='/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0'

fricas_targetdir='/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0'

 host='arm-apple-darwin22.3.0'


But the gmake failed, as the directory is not created  (again referring to x86):

~/fricas-1.3.8$ make
cd ./src && /Applications/Xcode.app/Contents/Developer/usr/bin/make BUILD_DATE="`date`" all-src gcc -march=armv8.5-a -g -dynamiclib -single_module bsdsignal.o cfuns-c.o sockio-c.o  -o /Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so ld: warning: ignoring file bsdsignal.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64 ld: warning: ignoring file cfuns-c.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64 ld: warning: ignoring file sockio-c.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64 ld: can't open output file for writing: /Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so, errno=2 for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so] Error 1
make[1]: *** [all-lib] Error 2
make: *** [all-src] Error 2

Regards Johannes


Am 25.03.23 um 19:48 schrieb Grégory Vanuxem:
Hello,

It seems the C code files are compiled for the x86_64 target arch. Do
you have a compatible gcc for your arch?

You can try to export something like (in bash) before configure step.:

export CC='gcc -march=armv9-a’

Or something like that.
For example on my machine:

┌──(greg㉿ellipse)-[~/Git/jlfricas]
└─$ export CC='gcc -march=x86-64'

┌──(greg㉿ellipse)-[~/Git/jlfricas]
└─$ ./configure  --enable-gmp
checking build system type... x86_64-linux-gnu
checking host system type... x86_64-linux-gnu
checking target system type... x86_64-linux-gnu
checking for in-tree build on case insensitive file system... no
checking for make... make
checking for gcc... gcc -march=x86-64
checking whether the C compiler works... yes

 From the doc:
=================================================
march=name[+extension…]

This specifies the name of the target ARM architecture. GCC uses this
name to determine what kind of instructions it can emit when
generating assembly code. This option can be used in conjunction with
or instead of the -mcpu= option.

Permissible names are: ‘armv4t’, ‘armv5t’, ‘armv5te’, ‘armv6’,
‘armv6j’, ‘armv6k’, ‘armv6kz’, ‘armv6t2’, ‘armv6z’, ‘armv6zk’,
‘armv7’, ‘armv7-a’, ‘armv7ve’, ‘armv8-a’, ‘armv8.1-a’, ‘armv8.2-a’,
‘armv8.3-a’, ‘armv8.4-a’, ‘armv8.5-a’, ‘armv8.6-a’, ‘armv9-a’,
‘armv7-r’, ‘armv8-r’, ‘armv6-m’, ‘armv6s-m’, ‘armv7-m’, ‘armv7e-m’,
‘armv8-m.base’, ‘armv8-m.main’, ‘armv8.1-m.main’, ‘armv9-a’, ‘iwmmxt’
and ‘iwmmxt2’.
=================================================

But you have also configure target options for that:
./configure --help
|snip]
System types:
   --build=BUILD     configure for building on BUILD [guessed]
   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
   --target=TARGET   configure for building compilers for TARGET [HOST]

Hope that helps. Otherwise, you'll have to install a C compiler that
can produce arm binaries.

__
Greg

Le sam. 25 mars 2023 à 15:23, Johannes Prof. Dr. Grabmeier, TH DEG
<[email protected]>  a écrit :
Thanks for all the hints, which helped me to proceed:

1. Downloaded and installed binary of sbcl-2.1.2 for Darwin on ARM64 successful!
2. configure: still problem with the case sensitive file system check, I 
commented this check out in configure
3. Then configure runs successful in a terminal (next mistake I made, I userd 
iterm, probably some how with x86 background/emulation so uname -m gave x_86 
and not arm 64, this is ok in terminal
4. but make fails, somehow it will again is confused with x86_64.

Any ideas?



DAASE=/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0 
FRICAS=/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0 
FRICAS_INITFILE='' 
/Users/jgrabmeier/fricas-1.3.8/build/arm-apple-darwin22.3.0/bin/interpsys
Checking for foreign routines
FRICAS="/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0"
spad-lib="/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so"
foreign routines found

debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "main thread" RUNNING {7006170243}>:
   Error opening shared object 
"/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so":
   
dlopen(/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so,
 0x000A): tried: 
'/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so' 
(mach-o file, but is an incompatible architecture (have 'x86_64', need 
'arm64')), 
'/System/Volumes/Preboot/Cryptexes/OS/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so'
 (no such file), 
'/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so' 
(mach-o file, but is an incompatible architecture (have 'x86_64', need 
'arm64')).

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
   0: [ABORT] Exit from the current thread.

(SB-SYS:DLOPEN-OR-LOSE #S(SB-ALIEN::SHARED-OBJECT :PATHNAME 
#P"/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so" 
:NAMESTRING "/Users/jgrabmeier/fricas-1.3.8/target/arm-apple-darwin22.3.0/lib/libspad.so" 
:HANDLE NIL :DONT-SAVE NIL))
0]





Waldek Hebisch schrieb am Freitag, 24. März 2023 um 14:25:13 UTC+1:
On Fri, Mar 24, 2023 at 11:41:14AM +0100, Prof. Dr. Johannes Grabmeier wrote:
Dear all,

thanks  to Qian, I did what you suggested, but I do not know whether it
works as I encountered new problems.

checking for in-tree build on case insensitive file system... configure:
error: in tree build on case insensitive file system is not supported. Use
out-of-source-tree build instead.

how do I use "out-of-source-tree build" instead?

Then I get the error message:

checking Lisp implementation... mmap: Cannot allocate memory
ensure_space: failed to validate 1073741824 bytes at 0x1000000000
(hint: Try "ulimit -a"; maybe you should increase memory limits.)
sed: config_cl.out: No such file or directory
configure: error: Unable to determine Lisp flavor

Next attempt was to update SBCL to actual version 2.3.2, same error
Just quick remark: do not try sbcl-2.3.2 with FriCAS-1.3.8, it is
expected to fail. Instead, use sbcl-2.3.1 or earlier (or latest
FriCAS from git repo).

~/sbcl$ sh make.sh
mmap: Cannot allocate memory
ensure_space: failed to validate 1073741824 bytes at 0x1000000000
(hint: Try "ulimit -a"; maybe you should increase memory limits.)
No working host Common Lisp implementation.
See ./INSTALL, the "SOURCE DISTRIBUTION" section

and this memory error also occurs, when I wanted to run my old FriCAS
version, which I once compiled on my old Macbook.


Principle thaughts: x86 is Intel, but Apple now has its own M2 chip, so
allone for that reasons an x86 binary probably does not work. So I have to
use and fix the compile problem with case insensitive file system (it is
case sensitive!) and the SBCL memory problem.


Any ideas an help is really appreciated. Thanks a lot.
Apple includes x86 emulation, so x86 binary has non zero chance of
working. But native version would probably avoid some troubles.

The messages suggest that already sbcl has problem, FriCAS needs
working Lisp, so this must be resolved first. For native sbcl
normal way is to compile it using earler version of sbcl.
sbcl folks provide binary of sbcl-2.1.2 for Darwin on ARM64, which
theortically should work.

--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web 
visithttps://groups.google.com/d/msgid/fricas-devel/5a12e6da-7420-4a14-b14f-323903274f7cn%40googlegroups.com.

--
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier,
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Fax: +49-(0)-991-2979592

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/6324bbac-d565-d633-95c2-3b1c3f72721f%40grabmeier.net.

Reply via email to