Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-13 Thread Mike Kilmer
Yup:

$ rm linker_options

$ make linker_options
echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  
-lmpfr -lgmp  > linker_options

Nice!

Thanks, again. Very much.


Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-13 Thread Henrik Grubbström

On Tue, 12 Mar 2024, Mike Kilmer wrote:


Brilliant.


Great.


Removing the offending library path (LDFLAGS="$LDFLAGS
-L/usr/local/opt/postgresql@15/lib") and reconfiguring worked
beautifully.

Incidentally there were a bunch of brewed paths I had removed in
debugging (most of which contained the @). Postrges was actually the
only remaining one, I hadn't removed.


The problemetic sed-expression has now been fixed in in git for
Pike 7.8, 8.0 and master (aka 9.0). Please confirm that it works.


Thank you both (and Chris) very much.

Really excited to finally start interacting with the language!


/grubba

--
Henrik Grubbström   gru...@roxen.com
Roxen Internet Software AB

Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-12 Thread Mike Kilmer
Brilliant.

Removing the offending library path (LDFLAGS="$LDFLAGS 
-L/usr/local/opt/postgresql@15/lib") and reconfiguring worked beautifully.

Incidentally there were a bunch of brewed paths I had removed in debugging 
(most of which contained the @). Postrges was actually the only remaining one, 
I hadn't removed.

Thank you both (and Chris) very much.

Really excited to finally start interacting with the language!

Mike

Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-12 Thread william

On 2024-03-12 10:13, Henrik Grubbström wrote:


The above are probably just two different ways to report the same 
error.


It looks like the above it output for the Makefile command:

	@linkopts="`pwd`/module.a `echo '$(MODULE_LDFLAGS)' | sed -e 
's@$(BASE_LDFLAGS)@@'`"; \

...

I suspect that there is an '@' in the definition of MODULE_LDFLAGS
at the beginning of .../modules/Gmp/Makefile in your build tree.


Yep, I think this is the problem (from his config.log for Gmp):

BASE_LDFLAGS=-L/usr/local/opt/postgresql@15/lib

homebrew strikes again!



/grubba




Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-12 Thread Henrik Grubbström

On Tue, 12 Mar 2024, Mike Kilmer wrote:


With you and Chris' help, got Pike 9!


Congrats.


Needed to also manually add  -lmpfr.

I hadn't noticed that the missing set of symbols was different after 
adding -lgmp flag manually.


[...]


Additionally, tried installing gnu-sed and running with that instead of native 
osX version and get a different sed error when running `make linker_options`:

sed: -e expression #1, char 332: unknown option to `s'
echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  > 
linker_options

As opposed to native which gets:

sed: 1: "s@-L/usr/local/opt/ruby ...": bad flag in substitute command: '@'
echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  > 
linker_options


The above are probably just two different ways to report the same error.

It looks like the above it output for the Makefile command:

	@linkopts="`pwd`/module.a `echo '$(MODULE_LDFLAGS)' | sed -e 
's@$(BASE_LDFLAGS)@@'`"; \

...

I suspect that there is an '@' in the definition of MODULE_LDFLAGS
at the beginning of .../modules/Gmp/Makefile in your build tree.

/grubba

--
Henrik Grubbström   gru...@grubba.org
Roxen Internet Software AB  gru...@roxen.com

Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-12 Thread Mike Kilmer
With you and Chris' help, got Pike 9!

Needed to also manually add  -lmpfr.

I hadn't noticed that the missing set of symbols was different after adding 
-lgmp flag manually.

Maybe v8 wasn't depending on mpfr.

Is there a command/process you'd recommend I run to troubleshoot the sed issue?

On our other colleague, John's (older) Mac, Pike 9 compiled fine, BTW.

Thanks much, Bill.

Mike

> On Mar 11, 2024, at 9:22 PM, Mike Kilmer  wrote:
> 
> Confirming that when I manually add -lgmp to the linker_options, v8 will 
> build. Not v9.
> 
> When v8 configures, I believe that modules/linker_options *does* include the 
> -lgmp flag, which gmp/linker_options needs manual add.
> 
> Checking again, but I think that with v9, the flag is missing in both files.
> 
> Again, though, even having manually inserted it in both places. In v9, 
> missing symbols when trying to build.
> 
> In addition to last update, here are some relevant looking files from the 
> build modules:
> 
> https://gist.github.com/MikeiLL/59203c766452c8c763d04ec35b638a34
> 
> Additionally, tried installing gnu-sed and running with that instead of 
> native osX version and get a different sed error when running `make 
> linker_options`:
> 
> sed: -e expression #1, char 332: unknown option to `s'
> echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  
> > linker_options
> 
> As opposed to native which gets:
> 
> sed: 1: "s@-L/usr/local/opt/ruby ...": bad flag in substitute command: '@'
> echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  
> > linker_options



Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-11 Thread Mike Kilmer
Confirming that when I manually add -lgmp to the linker_options, v8 will build. 
Not v9.

When v8 configures, I believe that modules/linker_options *does* include the 
-lgmp flag, which gmp/linker_options needs manual add.

Checking again, but I think that with v9, the flag is missing in both files.

Again, though, even having manually inserted it in both places. In v9, missing 
symbols when trying to build.

In addition to last update, here are some relevant looking files from the build 
modules:

https://gist.github.com/MikeiLL/59203c766452c8c763d04ec35b638a34
More Pike Install Build Modules (manually added -lgmp in both linker_options)
gist.github.com

Additionally, tried installing gnu-sed and running with that instead of native 
osX version and get a different sed error when running `make linker_options`:

sed: -e expression #1, char 332: unknown option to `s'
echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  > 
linker_options

As opposed to native which gets:

sed: 1: "s@-L/usr/local/opt/ruby ...": bad flag in substitute command: '@'
echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  > 
linker_options

Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-11 Thread Mike Kilmer
Okay. Seems like we're getting there:

echo Lang: $LANG
echo Locale: $LOCALE
Lang: en_US.UTF-8
Locale:

make linker_options
sed: 1: "s@-L/usr/local/opt/ruby ...": bad flag in substitute command: '@'
echo /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a  > 
linker_options

So perhaps it is a SED error, but a different one than that linked in the issue.

echo $LDFLAGS
-L/usr/local/opt/ruby/lib -L/usr/local/opt/postgresql@15/lib 
-L/usr/local/opt/icu4c/lib -L/usr/local/lib

On version 8, manually adding -lgmp to linker_options seemed to work, but on 
version 9 not (maybe I'm doing something wrong this time).

This is what I have in Gmp/linker_options:

/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a -lgmp

Same in modules/linker_options:

/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a -lgmp


> On Mar 11, 2024, at 5:08 PM, will...@welliver.org wrote:
> 
> Yes, that's sort of what I was getting at. The error seems like it's not 
> trying to link the gmp library. Is the library present in your 
> /usr/local/lib? You could try adding -lgmp to modules/linker_options and 
> modules/Gmp/linker_options? If you can avoid triggering a rewrite of those 
> files, it should try to link with -lgmp added.
> 
> A little more detail:
> 
> MODULE_LDFLAGS is used as input to the linker_options make target in the 
> modules/Gmp directory, which is then used to generate the 
> modules/linker_options file, which is used to statically link a few modules 
> into the pike binary (Gmp and Stdio, in particular).
> 
> linker_options is generated by running MODULE_LDFLAGS through a sed command, 
> and if the sed command fails, it doesn't include any libs. Is it possible 
> you're running into this:
> 
> https://git.lysator.liu.se/pikelang/pike/-/issues/10082
> 
> ?
> 
> Can you run the following commands in the build/.../modules/Gmp directory and 
> upload all of the results somewhere?
> 
> echo Lang: $LANG
> echo Locale: $LOCALE
> rm linker_options
> make linker_options
> cat linker_options
> 
> Bill
> 
> On 2024-03-11 10:15, Mike Kilmer wrote:
>> Poking around further, linker_options contains:
>> /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a
>> Chris says that his (Debian) install includes the -lgmp option at the
>> end of that path.
>> config.status contains:
>> S["LIBS"]=" -lgmp"
>> Makefile:
>> MODULE_LDFLAGS=-L/usr/local/opt/ruby/lib
>> -L/usr/local/opt/postgresql@15/lib -L/usr/local/opt/icu4c/lib \
>> -L/usr/local/lib -framework Foundation -framework System -framework
>> CoreServices \
>> -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3
>> \
>>  -ldl -lutil -lm -lpoll -framework CoreServices -lgmp
>> gmp_machine.h:
>>> #define HAVE_GMP_H 1
>>> #define HAVE_LIBGMP 1
>> Mike



Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-11 Thread william
Yes, that's sort of what I was getting at. The error seems like it's not 
trying to link the gmp library. Is the library present in your 
/usr/local/lib? You could try adding -lgmp to modules/linker_options and 
modules/Gmp/linker_options? If you can avoid triggering a rewrite of 
those files, it should try to link with -lgmp added.


A little more detail:

MODULE_LDFLAGS is used as input to the linker_options make target in the 
modules/Gmp directory, which is then used to generate the 
modules/linker_options file, which is used to statically link a few 
modules into the pike binary (Gmp and Stdio, in particular).


linker_options is generated by running MODULE_LDFLAGS through a sed 
command, and if the sed command fails, it doesn't include any libs. Is 
it possible you're running into this:


https://git.lysator.liu.se/pikelang/pike/-/issues/10082

?

Can you run the following commands in the build/.../modules/Gmp 
directory and upload all of the results somewhere?


echo Lang: $LANG
echo Locale: $LOCALE
rm linker_options
make linker_options
cat linker_options

Bill

On 2024-03-11 10:15, Mike Kilmer wrote:

Poking around further, linker_options contains:

 /Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a

Chris says that his (Debian) install includes the -lgmp option at the
end of that path.

config.status contains:

 S["LIBS"]=" -lgmp"

Makefile:

 MODULE_LDFLAGS=-L/usr/local/opt/ruby/lib
-L/usr/local/opt/postgresql@15/lib -L/usr/local/opt/icu4c/lib \
 -L/usr/local/lib -framework Foundation -framework System -framework
CoreServices \
 
-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3

\
  -ldl -lutil -lm -lpoll -framework CoreServices -lgmp




 gmp_machine.h:


#define HAVE_GMP_H 1

#define HAVE_LIBGMP 1

 Mike




Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-11 Thread william

Can you please post the contents of build/.../modules/Gmp/config.log?

I think, if build/.../modules/linker_options doesn't have -lgmp, then 
there's a problem in the configuration phase. Maybe the include files 
can be found but the lib can't? I can't imagine configure would have 
succeeded but I guess that's possible.



On 2024-03-10 22:43, Mike Kilmer wrote:

Happy to. Also adding pike@roxen.com back in as we'd gotten off of it.

Gist of output is here.
https://gist.github.com/MikeiLL/7b0e1ff30f909a6194908c025234e3a3


On Mar 10, 2024, at 8:21 PM, William Welliver 
wrote:

Hi Mike,

I think there’s possibly been a bit of a miscommunication. When
you run “make” in the git cloned directory, does that process
complete successfully, or do you get an error? A git checkout
requires a working pike to compile and may need to build a minimal
pike in order to do that. That minimal pike is (if memory serves)
called tpike. I’m just trying to understand where you’re having
problems. Maybe you can upload the output of the make process
somewhere we can refer to?

For anyone following, tool -L is kind of like ldd on some other
systems. You will note that your homebrew copy of pike uses the gmp
dynamic library.

Sent from my iPhone


On Mar 10, 2024, at 8:52 PM, Mike Kilmer  wrote:




I don't think there's a problem with your libgmp (actually, it would
be the libgmp.dylib not libgmp.a unless you've specifically disabled
the generation of dynamic libraries when building the gmp library),
I think it's that -lgmp isn't being added when the pike binary is
being generated. If you can run otool -L on the pike binary in your
build directory and send that to me, I think we can rule the library
in or out.

Hi, William.

Ccing Chris, my Pike (but not Mac) guru.

I believe you had explaining that otool would be run on a binary
after successful build, and the only one of those I have is the
brewed one, so ran on that. Please pardon if I misunderstood.

otool -L ...Cellar.../bin/pike

/usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version
15.0.0, current version 15.1.0)
/usr/lib/libutil.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1319.100.3)


/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices

(compatibility version 1.0.0, current version 1228.0.0)


/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

(compatibility version 150.0.0, current version 1971.0.0)




Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-11 Thread Mike Kilmer
Poking around further, linker_options contains:

/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a

Chris says that his (Debian) install includes the -lgmp option at the end of 
that path.

config.status contains:

S["LIBS"]=" -lgmp"

Makefile:

MODULE_LDFLAGS=-L/usr/local/opt/ruby/lib 
-L/usr/local/opt/postgresql@15/lib -L/usr/local/opt/icu4c/lib \
-L/usr/local/lib -framework Foundation -framework System -framework 
CoreServices \

-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3
 \
 -ldl -lutil -lm -lpoll -framework CoreServices -lgmp

gmp_machine.h:

#define HAVE_GMP_H 1
#define HAVE_LIBGMP 1

Mike

Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-10 Thread Mike Kilmer
Happy to. Also adding pike@roxen.com  back in as we'd 
gotten off of it.

Gist of output is here. 
https://gist.github.com/MikeiLL/7b0e1ff30f909a6194908c025234e3a3

> On Mar 10, 2024, at 8:21 PM, William Welliver  wrote:
> 
> Hi Mike,
> 
> I think there’s possibly been a bit of a miscommunication. When you run 
> “make” in the git cloned directory, does that process complete successfully, 
> or do you get an error? A git checkout requires a working pike to compile and 
> may need to build a minimal pike in order to do that. That minimal pike is 
> (if memory serves) called tpike. I’m just trying to understand where you’re 
> having problems. Maybe you can upload the output of the make process 
> somewhere we can refer to?
> 
> For anyone following, tool -L is kind of like ldd on some other systems. You 
> will note that your homebrew copy of pike uses the gmp dynamic library.
> 
> Sent from my iPhone
> 
>> On Mar 10, 2024, at 8:52 PM, Mike Kilmer  wrote:
>> 
>> 
>> 
>>> 
>>> I don't think there's a problem with your libgmp (actually, it would be the 
>>> libgmp.dylib not libgmp.a unless you've specifically disabled the 
>>> generation of dynamic libraries when building the gmp library), I think 
>>> it's that -lgmp isn't being added when the pike binary is being generated. 
>>> If you can run otool -L on the pike binary in your build directory and send 
>>> that to me, I think we can rule the library in or out.
>> 
>> Hi, William.
>> 
>> Ccing Chris, my Pike (but not Mac) guru.
>> 
>> I believe you had explaining that otool would be run on a binary after 
>> successful build, and the only one of those I have is the brewed one, so ran 
>> on that. Please pardon if I misunderstood.
>> 
>> otool -L ...Cellar.../bin/pike
>> 
>>  /usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 15.0.0, 
>> current version 15.1.0)
>>  /usr/lib/libutil.dylib (compatibility version 1.0.0, current version 
>> 1.0.0)
>>  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
>> version 1319.100.3)
>>  
>> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 
>> (compatibility version 1.0.0, current version 1228.0.0)
>>  
>> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>  (compatibility version 150.0.0, current version 1971.0.0)
>> 



Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-09 Thread Mike Kilmer
I appreciate your patience, Bill.

Contents of the linker_options is:

/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/Gmp/module.a
-L/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/lib/. 
-R/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/lib/. 
-L/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/lib/ 
-R/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/lib/ 
-L/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/lib//server 
-R/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/lib//server 
/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/_Debug/module.a
modules/_Image_TIFF/dummy.o
/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/_Stdio/module.a
/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/_math/module.a
/Users/mikekilmer/pike/build/darwin-22.6.0-x86_64/modules/system/module.a

I've tried building Gmp from scratch, downloading and running `make install`.

And the output ends with:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
 file: /usr/local/lib/libgmp.a(mp_clz_tab.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
 file: /usr/local/lib/libgmp.a(obprintf.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
 file: /usr/local/lib/libgmp.a(obvprintf.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
 file: /usr/local/lib/libgmp.a(obprntffuns.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
 file: /usr/local/lib/libgmp.a(repl-vsnprintf.o) has no symbols

If I run strings on the first file in the above list and grep "gmpz", many are 
present:

___gmpz_legendre
___gmpz_abs
___gmpz_add
___gmpz_add_ui
___gmpz_addmul
___gmpz_submul
...abridged
___gmpz_urandomb
___gmpz_urandomm
___gmpz_xor


ls -la /usr/local/lib/ | grep gmp
-rwxr-xr-x 1 mikekilmer  staff   576K Mar  9 16:28 libgmp.10.dylib*
-rw-r--r-- 1 mikekilmer  staff   960K Mar  9 16:28 libgmp.a
lrwxr-xr-x 1 mikekilmer  staff15B Mar  9 16:28 libgmp.dylib@ -> 
libgmp.10.dylib
-rwxr-xr-x 1 mikekilmer  staff   1.1K Mar  9 16:28 libgmp.la*

Tried reinstalling via Homebrew with -s flag to compile from source.

Saw this: ./configure --enable-cxx --with-pic --build=westmere-apple-darwin22

(Had to `brew link --overwrite gmp`)

Side note:
$ Unexpected '.la' files:
 /usr/local/lib/libgmp.la 

Which I imagine is from the non-brew build and can be deleted.

Still getting same build error:

Undefined symbols for architecture x86_64:
  "___gmp_set_memory_functions", referenced from:
  _pike_module_Gmp_init in module.a(mpz_glue.o)

Confirmed ("it's *in* there"):

$ strings /usr/local/lib/libgmp.a | grep ___gmp_set_memory_functions
___gmp_set_memory_functions

Scratching my head. It's like the symbol is there but _pike_module_Gmp_init 
can't recognize/access it.




Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-09 Thread william

Ah, sorry.

Once you build pike (assuming that you've built it and then it won't 
install or start), build/darwin-ver-arch/pike is the uninstalled pike 
binary. You'd run otool -L on that file. bin/pike is a shell script that 
will let you start up pike without installing it by setting arguments 
and environment variables... you won't be able to run otool on that 
because it's just a shell script, not a binary.


So for me, I've cloned the pike repo, installed the prerequisite 
libraries using homebrew (nettle + gmp) and then done a make. Running 
make will do the configuration, build, etc and if it was successful, you 
can run something like:


otool -L build/darwin-version-arch/pike

And there should be a line that has the path to the gmp library. If it's 
not there, something is going wrong in the configure/build phase (look 
in your modules/Gmp/linker_options and -lgmp should be there, and 
possibly -lmpfr depending on how your gmp is set up.)


*If* your pike binary is not linked with gmp, then that is a completely 
logical explanation for why you're getting those errors. Why it's not 
being linked against gmp is then the question we need to find an answer 
for.


If, on the other hand gmp is being linked into your pike binary, then 
there's something wrong with your gmp library and we'd need to figure 
out what's going on there. I think that's probably unlikely, since you 
tried using the home-brew version and it works fine with the home-brew 
compiled pike.


So, try to run otool -L on the pike binary you've built and we'll have a 
better idea about what's going on.


Bill

On 2024-03-09 10:27, Mike Kilmer wrote:

Thank you so much Bill. Feeling optimistic.

And pretty ignorant. When you say, `path/to/pike` I'm not sure what
you mean, in other words, which item in either

Downloaded or Cloned:

ANNOUNCE COPYING  README   build/   lib/
refdoc/
CHANGES  COPYRIGHTREADME-GIT   buildid.txt  man/ src/
COMMITTERS   Makefile bin/ index.html   packaging/
tools/

Am I running `otool` on?

Tried /bin/pike and also looked in build and src, but still missing
something.




Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-09 Thread Mike Kilmer
Thank you so much Bill. Feeling optimistic.

And pretty ignorant. When you say, `path/to/pike` I'm not sure what you mean, 
in other words, which item in either

Downloaded or Cloned:

ANNOUNCE COPYING  README   build/   lib/ refdoc/
CHANGES  COPYRIGHTREADME-GIT   buildid.txt  man/ src/
COMMITTERS   Makefile bin/ index.html   packaging/   tools/

Am I running `otool` on?

Tried /bin/pike and also looked in build and src, but still missing something.

> On Mar 9, 2024, at 8:46 AM, H. William Welliver  wrote:
> 
> 
> Just want to confirm that on a fresh install of Ventura on M2, pike head 
> builds fine using home-brew provided nettle/gmp. I think there must be 
> something strange going on in your build environment...
> 
> You can confirm that the gmp library is linked by using otool -L 
> /path/to/pike:
> 
> otool -L ./pike  
> ./pike:
>   /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 
> (compatibility version 300.0.0, current version 1953.255.0)
>   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
> version 1319.0.0)
>   
> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 
> (compatibility version 1.0.0, current version 1228.0.0)
>   /usr/local/opt/mpfr/lib/libmpfr.6.dylib (compatibility version 9.0.0, 
> current version 9.1.0)
>   /usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 16.0.0, 
> current version 16.0.0)
>   /usr/lib/libutil.dylib (compatibility version 1.0.0, current version 
> 1.0.0)
>   /usr/lib/libnetwork.dylib (compatibility version 1.0.0, current version 
> 1.0.0)
>   
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
> (compatibility version 150.0.0, current version 1953.255.0)
> 
> Bill
> 
>> On Mar 8, 2024, at 11:05 PM, Mike Kilmer > > wrote:
>> 
>> Hi, all.
>> 
>> Nice to meet you.
>> 
>> Any Mac users around?
>> 
>> Was able to easily install Pike v8 with homebrew, but am trying to compile 
>> from source on my Mac (Ventura) and struggling with it not finding the GMP 
>> libraries.
>> 
>> Tried download as well as git clone git://pike-git.lysator.liu.se/pike.git 
>> and configure/making from there.
>> 
>> Trying to compile the master branch I get:
>> 
>> * GMP is homebrew installed with libraries added to env: LDFLAGS="$LDFLAGS 
>> -L/usr/local/Cellar/gmp/6.3.0/lib" 
>> * Content of `build/darwin-22.6.0-x86_64/modules/Gmp/linker_options`:
>>  
>> /Users/mikekilmer/Pike-v9.0-snapshot/build/darwin-22.6.0-x86_64/modules/Gmp/module.a
>> * Also tried compiling GMP manually into /usr/local/lib/ and it reports that 
>> many of the files contain no symbols
>>  however, for example /usr/local/lib/libgmp.a contains strings that look 
>> like symbols: eg ___gmp_randseed
>> 
>> Error:
>> Undefined symbols for architecture x86_64:
>>   "___gmp_set_memory_functions", referenced from:
>>   _pike_module_Gmp_init in module.a(mpz_glue.o)
>> Etc...
>> 
>> After checking out 8.0, (or 8.1) `make` yields this:
>> 
>> ...
>> configure.in:35 : warning: _AC_CONFIG_SUBDIRS: you 
>> should use literals
>> ./lib/autoconf/status.m4:1096: AC_CONFIG_SUBDIRS is expanded from...
>> configure.in:35 : the top level
>> ...
>> 
>> Configure arguments:
>> Use `make CONFIGUREARGS="..." ...' to change them.
>> They will be retained in the build directory.
>> 
>> Wondering if a virtual linux solution may be necessary.
>> 
>> Any thoughts?
>> 
>> Thanks much.
> 



Re: On Mac Ventura, Pike v9 missing GMP symbols

2024-03-09 Thread H. William Welliver

Just want to confirm that on a fresh install of Ventura on M2, pike head builds 
fine using home-brew provided nettle/gmp. I think there must be something 
strange going on in your build environment...

You can confirm that the gmp library is linked by using otool -L /path/to/pike:

otool -L ./pike  
./pike:
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 
(compatibility version 300.0.0, current version 1953.255.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1319.0.0)

/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 
(compatibility version 1.0.0, current version 1228.0.0)
/usr/local/opt/mpfr/lib/libmpfr.6.dylib (compatibility version 9.0.0, 
current version 9.1.0)
/usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 16.0.0, 
current version 16.0.0)
/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 
1.0.0)
/usr/lib/libnetwork.dylib (compatibility version 1.0.0, current version 
1.0.0)

/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
(compatibility version 150.0.0, current version 1953.255.0)

Bill

> On Mar 8, 2024, at 11:05 PM, Mike Kilmer  wrote:
> 
> Hi, all.
> 
> Nice to meet you.
> 
> Any Mac users around?
> 
> Was able to easily install Pike v8 with homebrew, but am trying to compile 
> from source on my Mac (Ventura) and struggling with it not finding the GMP 
> libraries.
> 
> Tried download as well as git clone git://pike-git.lysator.liu.se/pike.git 
>  and configure/making from there.
> 
> Trying to compile the master branch I get:
> 
> * GMP is homebrew installed with libraries added to env: LDFLAGS="$LDFLAGS 
> -L/usr/local/Cellar/gmp/6.3.0/lib" 
> * Content of `build/darwin-22.6.0-x86_64/modules/Gmp/linker_options`:
>   
> /Users/mikekilmer/Pike-v9.0-snapshot/build/darwin-22.6.0-x86_64/modules/Gmp/module.a
> * Also tried compiling GMP manually into /usr/local/lib/ and it reports that 
> many of the files contain no symbols
>   however, for example /usr/local/lib/libgmp.a contains strings that look 
> like symbols: eg ___gmp_randseed
> 
> Error:
> Undefined symbols for architecture x86_64:
>   "___gmp_set_memory_functions", referenced from:
>   _pike_module_Gmp_init in module.a(mpz_glue.o)
> Etc...
> 
> After checking out 8.0, (or 8.1) `make` yields this:
> 
> ...
> configure.in:35: warning: _AC_CONFIG_SUBDIRS: you should use literals
> ./lib/autoconf/status.m4:1096: AC_CONFIG_SUBDIRS is expanded from...
> configure.in:35: the top level
> ...
> 
> Configure arguments:
> Use `make CONFIGUREARGS="..." ...' to change them.
> They will be retained in the build directory.
> 
> Wondering if a virtual linux solution may be necessary.
> 
> Any thoughts?
> 
> Thanks much.