Discussion:
[Simh] Installing SDL2 on Mac To Build SIMH
Rob Jarratt
2018-02-16 20:23:22 UTC
Permalink
I don't have a Mac but I need someone to be able to build SIMH on his Mac
and be able to link SDL2. I have looked at this page:
https://www.libsdl.org/download-2.0.php



I don't understand if you need runtime or dev libraries, I have tried
opening both dmg files with 7Zip and I can't find anything in either that
looks like a libsdl2.a file. What am I looking for and where would I put the
file to be able to link it? Compile already works.



Regards



Rob
Clem Cole
2018-02-16 20:31:30 UTC
Permalink
If you have brew installed try: brew install sdl2


ᐧ
I don’t have a Mac but I need someone to be able to build SIMH on his Mac
https://www.libsdl.org/download-2.0.php
I don’t understand if you need runtime or dev libraries, I have tried
opening both dmg files with 7Zip and I can’t find anything in either that
looks like a libsdl2.a file. What am I looking for and where would I put
the file to be able to link it? Compile already works.
Regards
Rob
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
Mark Pizzolato
2018-02-16 20:50:06 UTC
Permalink
Post by Rob Jarratt
I don't have a Mac but I need someone to be able to build SIMH on
his Mac and be able to link SDL2. I have looked at this page: https://www.libsdl.org/download-2.0.php
I don't understand if you need runtime or dev libraries, I have tried
opening both dmg files with 7Zip and I can't find anything in either
that looks like a libsdl2.a file. What am I looking for and where would
I put the file to be able to link it? Compile already works.
Rob,

The normal simh makefile knows how to find the necessary SDL pieces on all *nix platforms (including MacOS X). Building a simulator that could use the functionality provided by libSDL produces messages at build time advising if all of the potentially useful features aren't available and how to get the useful pieces on the platform the build is running on. All your simulator needs to do is follow the pattern used by other simulators. If, libSDL isn't being used directly by the simulator proper and only your frontpanel application, then the makefile structure would be is similar just for the frontpanel build target. Show me what you're trying and I'll make some suggestions.

- Mark
Paul Koning
2018-02-16 21:19:23 UTC
Permalink
Post by Mark Pizzolato
Post by Rob Jarratt
I don't have a Mac but I need someone to be able to build SIMH on
his Mac and be able to link SDL2. I have looked at this page: https://www.libsdl.org/download-2.0.php
I don't understand if you need runtime or dev libraries, I have tried
opening both dmg files with 7Zip and I can't find anything in either
that looks like a libsdl2.a file. What am I looking for and where would
I put the file to be able to link it? Compile already works.
Rob,
The normal simh makefile knows how to find the necessary SDL pieces on all *nix platforms (including MacOS X).
Unfortunately it doesn't handle the simple case of installing the pieces from source. I have SDL and SDL2 in /usr/local/lib, which is the default for GNU packages built from source. SIMH doesn't find it. Which is odd, because /usr/local/lib is also the standard spot on other Unix systems such as Linux.

"brew" and/or "port" use other paths like /opt, but I don't want to use those tools. It would be good if built-from-source dependencies are recognized.

As for the prebuilt libraries, I wonder if all you get is shared libraries. On Linux those are *.so files, but on Mac OS they are *.dylib.

paul
Rob Jarratt
2018-02-16 21:58:23 UTC
Permalink
-----Original Message-----
Sent: 16 February 2018 21:19
Subject: Re: [Simh] Installing SDL2 on Mac To Build SIMH
Post by Mark Pizzolato
Post by Rob Jarratt
I don't have a Mac but I need someone to be able to build SIMH on his
https://www.libsdl.org/download-2.0.php
I don't understand if you need runtime or dev libraries, I have tried
opening both dmg files with 7Zip and I can't find anything in either
that looks like a libsdl2.a file. What am I looking for and where
would I put the file to be able to link it? Compile already works.
Rob,
The normal simh makefile knows how to find the necessary SDL pieces on
all
*nix platforms (including MacOS X).
Unfortunately it doesn't handle the simple case of installing the pieces
from
source. I have SDL and SDL2 in /usr/local/lib, which is the default for
GNU
packages built from source. SIMH doesn't find it. Which is odd, because
/usr/local/lib is also the standard spot on other Unix systems such as
Linux.
"brew" and/or "port" use other paths like /opt, but I don't want to use
those
tools. It would be good if built-from-source dependencies are recognized.
As for the prebuilt libraries, I wonder if all you get is shared
libraries. On Linux
those are *.so files, but on Mac OS they are *.dylib.
I don't think I saw a .dylib either.

Regards

Rob
Paul Koning
2018-02-16 22:05:30 UTC
Permalink
Post by Rob Jarratt
...
I don't think I saw a .dylib either.
Ok, the thing you downloaded from the SDL website is a .dmg file, which is a Mac OS disk image. When opened it reveals a "framework" -- a directory meant to be moved into /Library/Frameworks where the Mac version of the compiler knows how to find it -- the -F switch points to the framework if I remember right, and headers and libraries are then found there.

There is an "SDL" file which is a shared library. It appears that shared libraries within frameworks don't have an extension, nor a "lib" prefix, but "file" reveals it as a shared library file.

You could tweak the makefile to use the framework, or build libSDL Unix style, at which point you may still need some (smaller) Makefile tweaks.

paul
Rob Jarratt
2018-02-17 10:32:32 UTC
Permalink
-----Original Message-----
Sent: 16 February 2018 22:06
Subject: Re: [Simh] Installing SDL2 on Mac To Build SIMH
Post by Rob Jarratt
...
I don't think I saw a .dylib either.
Ok, the thing you downloaded from the SDL website is a .dmg file, which is
a
Mac OS disk image. When opened it reveals a "framework" -- a directory
meant to be moved into /Library/Frameworks where the Mac version of the
compiler knows how to find it -- the -F switch points to the framework if
I
remember right, and headers and libraries are then found there.
There is an "SDL" file which is a shared library. It appears that shared
libraries
within frameworks don't have an extension, nor a "lib" prefix, but "file"
reveals
it as a shared library file.
You could tweak the makefile to use the framework, or build libSDL Unix
style,
at which point you may still need some (smaller) Makefile tweaks.
paul
Are you saying that when using a "framework" the standard SIMH makefile
won't find it but that getting the sources and making them would allow the
SIMH makefile to work?

Regards

Rob
Mark Pizzolato
2018-02-17 10:56:42 UTC
Permalink
Post by Rob Jarratt
-----Original Message-----
Sent: 16 February 2018 22:06
Subject: Re: [Simh] Installing SDL2 on Mac To Build SIMH
Post by Rob Jarratt
...
I don't think I saw a .dylib either.
Ok, the thing you downloaded from the SDL website is a .dmg file, which is
a
Mac OS disk image. When opened it reveals a "framework" -- a directory
meant to be moved into /Library/Frameworks where the Mac version of the
compiler knows how to find it -- the -F switch points to the framework if
I
remember right, and headers and libraries are then found there.
There is an "SDL" file which is a shared library. It appears that shared
libraries
within frameworks don't have an extension, nor a "lib" prefix, but "file"
reveals
it as a shared library file.
You could tweak the makefile to use the framework, or build libSDL Unix
style,
at which point you may still need some (smaller) Makefile tweaks.
paul
Are you saying that when using a "framework" the standard SIMH makefile
won't find it but that getting the sources and making them would allow the
SIMH makefile to work?
The simh makefile explicitly attempts to avoid dependent packages that users
build locally on their own. The goal is to get users to use OS vendor provided
packages. The point here is that when the OS (or other parties) build specific
packages, those package builds are well tested and somewhat professionally
maintained. When a user builds a package locally, they may or may not do it
right and when they have problems I don't want to hear about them.

If someone, like Paul, really wants to locally build some package for reasons
beyond the needs of simh, they certainly can, and when they do that, they
also get to personally coerce simh to use it.

- Mark

Rob Jarratt
2018-02-17 10:29:01 UTC
Permalink
-----Original Message-----
Sent: 16 February 2018 20:50
Subject: RE: [Simh] Installing SDL2 on Mac To Build SIMH
Post by Rob Jarratt
I don't have a Mac but I need someone to be able to build SIMH on his
https://www.libsdl.org/download-2.0.php
I don't understand if you need runtime or dev libraries, I have tried
opening both dmg files with 7Zip and I can't find anything in either
that looks like a libsdl2.a file. What am I looking for and where
would I put the file to be able to link it? Compile already works.
Rob,
The normal simh makefile knows how to find the necessary SDL pieces on all
*nix platforms (including MacOS X). Building a simulator that could use
the
functionality provided by libSDL produces messages at build time advising
if all
of the potentially useful features aren't available and how to get the
useful
pieces on the platform the build is running on. All your simulator needs
to do is
follow the pattern used by other simulators. If, libSDL isn't being used
directly
by the simulator proper and only your frontpanel application, then the
makefile
structure would be is similar just for the frontpanel build target. Show
me what
you're trying and I'll make some suggestions.
- Mark
In this case it is actually for SIMH itself and not the front panel (that
can come later), so it is using the standard makefile. I don't have the
output to hand, but it looked to me like it was able to compile but could
not link. I don't think SDL2 is installed properly and I don't know how that
is supposed to be done.

Regards

Rob
Loading...