Re: where is the MacPorts gcc?

2024-05-04 Thread Kenneth Wolcott
HI Ryan;

  I'll try to create a MNWE (Minimal Non-Working Example) but it will
take some time as I suspect that involves the gsl library.

Thanks,
Ken W

On Sat, May 4, 2024 at 12:22 AM Ryan Schmidt  wrote:
>
> On May 3, 2024, at 23:12, Kenneth Wolcott wrote:
> >
> > I want to compile some C code using gcc to compare against clang.
> >
> > This code I want to compile needs gsl/gsl_vector.h so I used -lgsl to
> > compile with clang and it complained at runtime: "dyld[16321]: missing
> > symbol called".
>
> Since using gcc on macOS is unusual and possibly fraught with its own unique 
> problems, and you encounter the issue with clang as well, let's focus on 
> clang first.
>
> Can you provide a minimal reproduction recipe? A .c file and the command you 
> used to compile and link it that demonstrates the problem and that we can try 
> on our systems?
>
>


Re: where is the MacPorts gcc?

2024-05-04 Thread Ryan Schmidt
On May 3, 2024, at 23:12, Kenneth Wolcott wrote:
> 
> I want to compile some C code using gcc to compare against clang.
> 
> This code I want to compile needs gsl/gsl_vector.h so I used -lgsl to
> compile with clang and it complained at runtime: "dyld[16321]: missing
> symbol called".

Since using gcc on macOS is unusual and possibly fraught with its own unique 
problems, and you encounter the issue with clang as well, let's focus on clang 
first. 

Can you provide a minimal reproduction recipe? A .c file and the command you 
used to compile and link it that demonstrates the problem and that we can try 
on our systems?




Re: where is the MacPorts gcc?

2024-05-04 Thread Ryan Schmidt
On May 4, 2024, at 02:06, Eric Gallager wrote:
> 
> `ar` and `nm` are wrappers around the corresponding tools from
> binutils/cctools; 

ar manipulates archives. nm shows you what symbols are in an object file. More 
about that in their documentation:

https://sourceware.org/binutils/docs/binutils/ar.html

https://sourceware.org/binutils/docs/binutils/nm.html




Re: where is the MacPorts gcc?

2024-05-04 Thread Eric Gallager via macports-users
`ar` and `nm` are wrappers around the corresponding tools from
binutils/cctools; GCC wraps them for use in its LTO system, I'm pretty
sure. You probably want to do `port select gcc` and then choose one of
the options available to symlink gcc into place without its suffix. If
it's dyld giving you your error, though, switching compilers probably
won't help, but I guess you can always try anyways...

On Sat, May 4, 2024 at 12:12 AM Kenneth Wolcott
 wrote:
>
> I want to compile some C code using gcc to compare against clang.
>
> This code I want to compile needs gsl/gsl_vector.h so I used -lgsl to
> compile with clang and it complained at runtime: "dyld[16321]: missing
> symbol called".
>
> what are "ar" and "nm" in the following?
>
> I think "mp" means multiple precision...
>
> find /opt/local/bin -type f -print | grep gcc | grep -v ranlib
> /opt/local/bin/arm64-apple-darwin23-gcc-ar-mp-13
> /opt/local/bin/gcc-mp-12
> /opt/local/bin/arm64-apple-darwin23-gcc-ar-mp-12
> /opt/local/bin/gcc-mp-13
> /opt/local/bin/arm64-apple-darwin23-gcc-13.2.0
> /opt/local/bin/gcc-nm-mp-13
> /opt/local/bin/gcc-nm-mp-12
> /opt/local/bin/arm64-apple-darwin23-gcc-mp-12
> /opt/local/bin/arm64-apple-darwin23-gcc-mp-13
> /opt/local/bin/arm64-apple-darwin23-gcc-nm-mp-12
> /opt/local/bin/arm64-apple-darwin23-gcc-nm-mp-13
> /opt/local/bin/gcc-ar-mp-12
> /opt/local/bin/gcc-ar-mp-13
> /opt/local/bin/arm64-apple-darwin23-gcc-12.3.0
>
> Thanks,
> Ken Wolcott


Re: where is the MacPorts gcc?

2024-05-04 Thread Ryan Schmidt
On May 3, 2024, at 23:12, Kenneth Wolcott wrote:
> 
> I think "mp" means multiple precision...

The "mp" suffix in gcc file names means "MacPorts". This is anachronistic now 
but it made sense back when gcc was included in Xcode. We wanted the executable 
"gcc-4.2" to mean Apple's fork of gcc-4.2 from Xcode even if the user had 
installed the gcc42 port (since Apple's fork supported things most users 
expected, like support for -arch flags) so we added the "mp" suffix to ours to 
differentiate them.