Re: building on macos

2022-05-30 Thread Jean-Christophe Helary



> On May 30, 2022, at 18:18, Alexander Burger  wrote:
> 
> Hi Jean-Christophe,
> 
>> It looks like I'm slowly getting somewhere...
>> ...
> 
> Great! :)
> 
> 
>> ./pil: line 2: exec: 
>> /Users/suzume/Documents/Repositories/pil21+/src/../bin/picolisp: cannot 
>> execute: No such file or directory
> 
> That's an easy one. It tries to bootstrap, but bin/picolisp does not exist 
> yet.
> For that reason the pre-build *.ll files are included in the distro. Just
> (re)install these.

Yes, but now, I'm back to my readline errors...

➜  pil21+ git:(master) ✗ (cd src; make)
clang -O3 -w -c -o lib.bc -D_OS='"Darwin"' -D_CPU='"x86_64"' `pkg-config 
--cflags libffi` -emit-llvm lib.c
lib.c:119:4: error: use of undeclared identifier 'rl_catch_signals'
   rl_catch_signals = 0;
   ^
lib.c:121:4: error: use of undeclared identifier 'rl_input_available_hook'
   rl_input_available_hook = rlAvail;
   ^

(etc.)

I'm using this in .profile:

## libffi
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH"
export LDFLAGS="-L/usr/local/opt/libffi/lib:$LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/libffi/include:$CPPFLAGS"

## openssl
export PATH="/usr/local/opt/openssl@3/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@3/lib:$LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include:$CPPFLAGS"

## readline
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig:$PKG_CONFIG_PATH"
export LDFLAGS="-L/usr/local/opt/readline/lib:$LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/readline/include:$CPPFLAGS"

## llvm
export PATH="/usr/local/opt/llvm@11/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm@11/lib:$LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/llvm@11/include:$CPPFLAGS"

JC :(


-- 
Jean-Christophe Helary @brandelune
https://mac4translators.blogspot.com
https://sr.ht/~brandelune/omegat-as-a-book/


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: building on macos

2022-05-30 Thread Alexander Burger
Hi Jean-Christophe,

> It looks like I'm slowly getting somewhere...
> ...

Great! :)


> ./pil: line 2: exec: 
> /Users/suzume/Documents/Repositories/pil21+/src/../bin/picolisp: cannot 
> execute: No such file or directory

That's an easy one. It tries to bootstrap, but bin/picolisp does not exist yet.
For that reason the pre-build *.ll files are included in the distro. Just
(re)install these.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: building on macos

2022-05-30 Thread Jean-Christophe Helary
It looks like I'm slowly getting somewhere...


➜  pil21+ git:(master) ✗ which opt  
/usr/local/opt/llvm@11/bin/opt
➜  pil21+ git:(master) ✗ which clang
/usr/local/opt/llvm@11/bin/clang
➜  pil21+ git:(master) ✗ which llvm-link
/usr/local/opt/llvm@11/bin/llvm-link


➜  pil21+ git:(master) ✗ (cd src; make)
./pil   lib/llvm.l main.l -bye > base.ll
./pil: line 2: /Users/suzume/Documents/Repositories/pil21+/src/../bin/picolisp: 
No such file or directory
./pil: line 2: exec: 
/Users/suzume/Documents/Repositories/pil21+/src/../bin/picolisp: cannot 
execute: No such file or directory
make: *** [base.ll] Error 126

Jean-Christophe 

> On May 30, 2022, at 0:09, Jean-Christophe Helary  
> wrote:
> 
> Thank you.
> 
> It looks like it was a clang issue.
> 
> I'll check that later next week. And *will* come back here to report :-)
> 
> JC
> 
>> On May 29, 2022, at 23:23, Frithjof Schulze  wrote:
>> 
>> Hi all,
>> 
>> I never used Picolisp on a MacOS system, but tried the Makefile.macos today. 
>> I needed to do a few changes, because my version of Homebrew uses other 
>> patches, but then everything worked fine with the llvm, readline, libffi and 
>> openssl versions from brew. 
>> 
>> % make clean
>> % export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
>> % which clang
>> /opt/homebrew/opt/llvm/bin/clang
>> % which opt
>> /opt/homebrew/opt/llvm/bin/opt
>> % make -f Makefile.macos
>> % ./bin/picolisp 
>> : (bye)
>> % 
>> 
>> w
>> 
>> --- Makefile.macos   2022-05-29 15:47:48.0 +0200
>> +++ Makefile.macos.orig  2022-05-29 16:14:59.0 +0200
>> @@ -7,7 +7,7 @@
>> ASM = opt -O3  # llvm-as
>> LLC = llc
>> LINK = llvm-link
>> -MAIN = -lm -ldl -lreadline -lffi -lncurses -L/opt/homebrew/opt/readline/lib
>> +MAIN = -lm -ldl -lreadline -lffi -lncurses -L/usr/local/opt/readline/lib
>> SHARED =
>> STRIP = strip
>> 
>> @@ -44,7 +44,7 @@
>>  mv base.map $(LIB)/map
>> 
>> lib.bc: pico.h lib.c
>> -$(CC) -O3 -w -c -o lib.bc -D_OS='"$(OS)"' -D_CPU='"$(CPU)"' 
>> -I/opt/homebrew/opt/libffi/include -I/opt/homebrew/opt/readline/include 
>> -emit-llvm lib.c
>> +$(CC) -O3 -w -c -o lib.bc -D_OS='"$(OS)"' -D_CPU='"$(CPU)"' 
>> -I/usr/local/opt/libffi/include -I/usr/local/opt/readline/include -emit-llvm 
>> lib.c
>> 
>> # Extension libraries
>> $(LIB)/ext.so: ext.bc
>> @@ -76,11 +76,11 @@
>> 
>> # Gate
>> $(BIN)/ssl: ssl.c
>> -$(CC) -O3 -w -o $(BIN)/ssl ssl.c -lssl -lcrypto 
>> -L/opt/homebrew/opt/openssl/lib -I/opt/homebrew/opt/openssl/include
>> +$(CC) -O3 -w -o $(BIN)/ssl ssl.c -lssl -lcrypto 
>> -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
>>  $(STRIP) $(BIN)/ssl
>> 
>> $(BIN)/httpGate: httpGate.c
>> -$(CC) -O3 -w -o $(BIN)/httpGate httpGate.c -lssl -lcrypto 
>> -L/opt/homebrew/opt/openssl/lib -I/opt/homebrew/opt/openssl/include
>> +$(CC) -O3 -w -o $(BIN)/httpGate httpGate.c -lssl -lcrypto 
>> -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
>>  $(STRIP) $(BIN)/httpGate
>> 
>> # Clean up
>> 
>> Cheers,
>> Frithjof
>> 
>>> Am 29.05.2022 um 15:28 schrieb Jean-Christophe Helary 
>>> :
>>> 
>>> 
>>> 
 On May 29, 2022, at 22:12, Mike  wrote:
 
> ➜ pil21+ git:(master) ✗ cd src
> ➜ src git:(master) ✗ rm *.bc
> ➜ src git:(master) ✗ make
> opt -O3 -o base.bc base.ll
> clang -O3 -w -c -o lib.bc -D_OS='"Darwin"' -D_CPU='"x86_64"' `pkg-config 
> --cflags libffi` -emit-llvm lib.c
> llvm-link -o picolisp.bc base.bc lib.bc
> /opt/local/libexec/llvm-10/bin/llvm-link: lib.bc: error: Unknown 
> attribute kind (68) (Producer: 'APPLE_1_1300.0.29.30_0' Reader: 'LLVM 
> 10.0.1')
> /opt/local/libexec/llvm-10/bin/llvm-link: error: loading file 'lib.bc'
> make: *** [picolisp.bc] Error 1
 
 show output:
 ===
 $ which opt
 $ which clang 
 $ which llvm-link
 ===
>>> 
>>> 
>>> ➜ src git:(master) ✗ which opt
>>> /opt/local/bin/opt
>>> ➜ src git:(master) ✗ which clang
>>> /usr/bin/clang
>>> ➜ src git:(master) ✗ which llvm-link 
>>> /opt/local/bin/llvm-link
>>> 
>>> It looks like clang is not the one we might want ?
>>> 
>>> ➜ src git:(master) ✗ clang --version
>>> Apple clang version 13.0.0 (clang-1300.0.29.30)
>>> Target: x86_64-apple-darwin20.6.0
>>> Thread model: posix
>>> InstalledDir: /Library/Developer/CommandLineTools/usr/bin
>>> 
>>> -- 
>>> Jean-Christophe Helary @brandelune
>>> https://mac4translators.blogspot.com
>>> https://sr.ht/~brandelune/omegat-as-a-book/
>>> 
>>> 
>>> --
>>> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>> 
> 
> -- 
> Jean-Christophe Helary @brandelune
> https://mac4translators.blogspot.com
> https://sr.ht/~brandelune/omegat-as-a-book/
> 
> 
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

-- 
Jean-Christophe Helary @brandelune
https://mac4translators.blogspot.com
https://sr.ht/~brandelune/omegat-as-a-book/


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe