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