axpbox icon indicating copy to clipboard operation
axpbox copied to clipboard

Build on Mac OS 10.13

Open AussieSusan opened this issue 3 years ago • 10 comments

I have an iMac (running MacOS 10.13 - High Sierra; it is a mid-2011 model and so cannot run anything later (*)) and I was wanting to build axpbox natively. (I've built in on a Linux 20.04 VM under Parallels). The compiler tools are as up-to=date as they can be.

Is there a specific list of the prerequisites and how to install them (I'm assuming HomeBrew is used but there seem to be issues - e.g. SDL is installed but the 'cmake' step cannot find it)?

When I try, the 'cmake' step works but the 'make' step fails almost immediately with lots of errors (mainly of the type that indicates a significant mis-match between how the code is written and what the compiler expects).

Has anyone actually does this on MacOS and can guide me?

Thanks

Susan

(*) Planning to get one of the Apple Silicon iMacs when they are available. (Sorry if this request is not appropriate for this area but I can't find any other user forum - pointers please if there is one.)

AussieSusan avatar Dec 01 '20 04:12 AussieSusan

Hello,

I can try to help you, with the steps I used on my MacBook (10.13.6 and Xcode 10.1). First of all, I used brew to install all the needed libraries. I didn't try building with the SDL, but this is something I will try soon. Anyway, provided that you created a build directory where to run cmake, here is the command used to build axpbox

cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -D CMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++ -I/usr/local/opt/libpcap/include" -D CMAKE_EXE_LINKER_FLAGS_INIT="-L/usr/local/opt/libpcap/lib" ../

regards, Fausto

On Tue, Dec 1, 2020 at 5:20 AM AussieSusan [email protected] wrote:

I have an iMac (running MacOS 10.13 - High Sierra; it is a mid-2011 model and so cannot run anything later (*)) and I was wanting to build axpbox natively. (I've built in on a Linux 20.04 VM under Parallels). The compiler tools are as up-to=date as they can be.

Is there a specific list of the prerequisites and how to install them (I'm assuming HomeBrew is used but there seem to be issues - e.g. SDL is installed but the 'cmake' step cannot find it)?

When I try, the 'cmake' step works but the 'make' step fails almost immediately with lots of errors (mainly of the type that indicates a significant mis-match between how the code is written and what the compiler expects).

Has anyone actually does this on MacOS and can guide me?

Thanks

Susan

(*) Planning to get one of the Apple Silicon iMacs when they are available. (Sorry if this request is not appropriate for this area but I can't find any other user forum - pointers please if there is one.)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lenticularis39/axpbox/issues/43, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOCZKYEUIZXWJ3MXRZFKI3SSRVIPANCNFSM4UIO5TNQ .

TheFausap avatar Dec 01 '20 05:12 TheFausap

I don't have a Mac myself but I did manage to install OS X 10.15 into a virtualbox VM. This is how the compilation looks for me, both the commands and their output.

I installed cmake and git via homebrew (brew install cmake git), nothing else. XCode was installed via the App Store.

remy@Remys-MacBook-Pro ~ % git clone https://github.com/lenticularis39/axpbox

Output:

Cloning into 'axpbox'...
remote: Enumerating objects: 158, done.
remote: Counting objects: 100% (158/158), done.
remote: Compressing objects: 100% (118/118), done.
remote: Total 788 (delta 61), reused 86 (delta 39), pack-reused 630
Receiving objects: 100% (788/788), 1.07 MiB | 1.34 MiB/s, done.
Resolving deltas: 100% (493/493), done.


remy@Remys-MacBook-Pro ~ % cd axpbox 

Create build folder:

remy@Remys-MacBook-Pro axpbox % mkdir build

Run cmake on OS X:

remy@Remys-MacBook-Pro build % cmake .. -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" 

Output:

-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for alarm
-- Looking for alarm - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for arpa/telnet.h
-- Looking for arpa/telnet.h - found
-- Looking for atexit
-- Looking for atexit - found
-- Looking for ctype.h
-- Looking for ctype.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for fopen
-- Looking for fopen - found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for fork
-- Looking for fork - found
-- Looking for fseek
-- Looking for fseek - found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for fseeko64
-- Looking for fseeko64 - not found
-- Looking for ftell
-- Looking for ftell - found
-- Looking for ftello
-- Looking for ftello - found
-- Looking for ftello64
-- Looking for ftello64 - not found
-- Looking for gmtime_s
-- Looking for gmtime_s - not found
-- Looking for inet_aton
-- Looking for inet_aton - found
-- Looking for inet.h
-- Looking for inet.h - not found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for in.h
-- Looking for in.h - not found
-- Looking for isblank
-- Looking for isblank - found
-- Looking for malloc
-- Looking for malloc - found
-- Looking for malloc.h
-- Looking for malloc.h - not found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for memset
-- Looking for memset - found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - found
-- Looking for pow
-- Looking for pow - found
-- Looking for process.h
-- Looking for process.h - not found
-- Looking for pthread_self in pthread
-- Looking for pthread_self in pthread - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for realloc
-- Looking for realloc - found
-- Looking for select
-- Looking for select - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for socket
-- Looking for socket - found
-- Looking for socket.h
-- Looking for socket.h - not found
-- Looking for sqrt
-- Looking for sqrt - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strspn
-- Looking for strspn - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/select.h
-- Looking for sys/select.h - found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for vfork
-- Looking for vfork - found
-- Looking for vfork.h
-- Looking for vfork.h - not found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for winsock2.h
-- Looking for winsock2.h - not found
-- Looking for ws2tcpip.h
-- Looking for ws2tcpip.h - not found
-- Check size of _Bool
-- Check size of _Bool - done
-- Looking for _fseeki64
-- Looking for _fseeki64 - not found
-- Looking for _ftelli64
-- Looking for _ftelli64 - not found
-- Looking for _strdup
-- Looking for _strdup - not found
-- Looking for _stricasecmp
-- Looking for _stricasecmp - not found
-- Looking for _stricmp
-- Looking for _stricmp - not found
-- Looking for pcap.h
-- Looking for pcap.h - found
-- Looking for SDL/SDL.h
-- Looking for SDL/SDL.h - not found
-- Looking for X11/X.h
-- Looking for X11/X.h - not found
-- pcap found. Networking support enabled
CMake Warning at CMakeLists.txt:114 (message):
  sdl not found.  Building without SDL graphics support


CMake Warning at CMakeLists.txt:120 (message):
  x11 not found.  Building without x11 graphics support


-- Found Git: /usr/local/bin/git (found version "2.29.2") 
-- Looking for include files time.h, sys/time.h
-- Looking for include files time.h, sys/time.h - found
-- C++ compiler flags  : -std=c++11 -stdlib=libc++ -O3 -march=native -DNDEBUG
-- C compiler flags    :  -O3
-- Linker flags        :   
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/remy/axpbox/build

Make:

remy@Remys-MacBook-Pro build % make    

Output:

Scanning dependencies of target axpbox
[  1%] Building CXX object CMakeFiles/axpbox.dir/src/AliM1543C.cpp.o
[  3%] Building CXX object CMakeFiles/axpbox.dir/src/AliM1543C_ide.cpp.o
[  5%] Building CXX object CMakeFiles/axpbox.dir/src/AliM1543C_usb.cpp.o
[  7%] Building CXX object CMakeFiles/axpbox.dir/src/AlphaCPU.cpp.o
[  8%] Building CXX object CMakeFiles/axpbox.dir/src/AlphaCPU_ieeefloat.cpp.o
[ 10%] Building CXX object CMakeFiles/axpbox.dir/src/AlphaCPU_vaxfloat.cpp.o
[ 12%] Building CXX object CMakeFiles/axpbox.dir/src/AlphaCPU_vmspal.cpp.o
[ 14%] Building CXX object CMakeFiles/axpbox.dir/src/AlphaSim.cpp.o
[ 15%] Building CXX object CMakeFiles/axpbox.dir/src/Cirrus.cpp.o
[ 17%] Building CXX object CMakeFiles/axpbox.dir/src/Configurator.cpp.o
[ 19%] Building CXX object CMakeFiles/axpbox.dir/src/DEC21143.cpp.o
[ 21%] Building CXX object CMakeFiles/axpbox.dir/src/DMA.cpp.o
[ 22%] Building CXX object CMakeFiles/axpbox.dir/src/DPR.cpp.o
[ 24%] Building CXX object CMakeFiles/axpbox.dir/src/Disk.cpp.o
[ 26%] Building CXX object CMakeFiles/axpbox.dir/src/DiskController.cpp.o
[ 28%] Building CXX object CMakeFiles/axpbox.dir/src/DiskDevice.cpp.o
/Users/remy/axpbox/src/DiskDevice.cpp:138:34: warning: format specifies type
      'ptrdiff_t' (aka 'long') but the argument has type 'unsigned long long'
      [-Wformat]
         devid_string, filename, byte_size / state.block_size, state.block_size,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/remy/axpbox/src/DiskDevice.cpp:139:10: warning: format specifies type
      'ptrdiff_t' (aka 'long') but the argument has type 'off_t'
      (aka 'long long') [-Wformat]
         cylinders, heads, sectors);
         ^~~~~~~~~
2 warnings generated.
[ 29%] Building CXX object CMakeFiles/axpbox.dir/src/DiskFile.cpp.o
/Users/remy/axpbox/src/DiskFile.cpp:192:34: warning: format specifies type
      'ptrdiff_t' (aka 'long') but the argument has type 'unsigned long long'
      [-Wformat]
         devid_string, filename, byte_size / state.block_size, state.block_size,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/remy/axpbox/src/DiskFile.cpp:193:10: warning: format specifies type
      'ptrdiff_t' (aka 'long') but the argument has type 'off_t'
      (aka 'long long') [-Wformat]
         cylinders, heads, sectors);
         ^~~~~~~~~
2 warnings generated.
[ 31%] Building CXX object CMakeFiles/axpbox.dir/src/DiskRam.cpp.o
/Users/remy/axpbox/src/DiskRam.cpp:103:24: warning: format specifies type
      'ptrdiff_t' (aka 'long') but the argument has type 'unsigned long long'
      [-Wformat]
         devid_string, byte_size / state.block_size, state.block_size,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/remy/axpbox/src/DiskRam.cpp:104:10: warning: format specifies type
      'ptrdiff_t' (aka 'long') but the argument has type 'off_t'
      (aka 'long long') [-Wformat]
         cylinders, heads, sectors);
         ^~~~~~~~~
2 warnings generated.
[ 33%] Building CXX object CMakeFiles/axpbox.dir/src/Ethernet.cpp.o
[ 35%] Building CXX object CMakeFiles/axpbox.dir/src/Flash.cpp.o
[ 36%] Building CXX object CMakeFiles/axpbox.dir/src/FloppyController.cpp.o
[ 38%] Building CXX object CMakeFiles/axpbox.dir/src/Keyboard.cpp.o
[ 40%] Building CXX object CMakeFiles/axpbox.dir/src/Main.cpp.o
[ 42%] Building CXX object CMakeFiles/axpbox.dir/src/PCIDevice.cpp.o
[ 43%] Building CXX object CMakeFiles/axpbox.dir/src/Port80.cpp.o
[ 45%] Building CXX object CMakeFiles/axpbox.dir/src/S3Trio64.cpp.o
[ 47%] Building CXX object CMakeFiles/axpbox.dir/src/SCSIBus.cpp.o
[ 49%] Building CXX object CMakeFiles/axpbox.dir/src/SCSIDevice.cpp.o
[ 50%] Building CXX object CMakeFiles/axpbox.dir/src/Serial.cpp.o
[ 52%] Building CXX object CMakeFiles/axpbox.dir/src/StdAfx.cpp.o
[ 54%] Building CXX object CMakeFiles/axpbox.dir/src/Sym53C810.cpp.o
[ 56%] Building CXX object CMakeFiles/axpbox.dir/src/Sym53C895.cpp.o
[ 57%] Building CXX object CMakeFiles/axpbox.dir/src/System.cpp.o
[ 59%] Building CXX object CMakeFiles/axpbox.dir/src/SystemComponent.cpp.o
[ 61%] Building CXX object CMakeFiles/axpbox.dir/src/TraceEngine.cpp.o
[ 63%] Building CXX object CMakeFiles/axpbox.dir/src/VGA.cpp.o
[ 64%] Building CXX object CMakeFiles/axpbox.dir/src/base/Bugcheck.cpp.o
[ 66%] Building CXX object CMakeFiles/axpbox.dir/src/base/ErrorHandler.cpp.o
[ 68%] Building CXX object CMakeFiles/axpbox.dir/src/base/Event.cpp.o
[ 70%] Building CXX object CMakeFiles/axpbox.dir/src/base/Exception.cpp.o
[ 71%] Building CXX object CMakeFiles/axpbox.dir/src/base/Mutex.cpp.o
[ 73%] Building CXX object CMakeFiles/axpbox.dir/src/base/NumberFormatter.cpp.o
/Users/remy/axpbox/src/base/NumberFormatter.cpp:336:43: warning: format
      specifies type 'unsigned long long' but the argument has type 'UIntPtr'
      (aka 'unsigned long') [-Wformat]
  std::sprintf(buffer, "%016" PRIx64 "X", (UIntPtr)ptr);
                        ~~~~~~~~~~~~      ^~~~~~~~~~~~
1 warning generated.
[ 75%] Building CXX object CMakeFiles/axpbox.dir/src/base/RWLock.cpp.o
[ 77%] Building CXX object CMakeFiles/axpbox.dir/src/base/RefCountedObject.cpp.o
[ 78%] Building CXX object CMakeFiles/axpbox.dir/src/base/Semaphore.cpp.o
[ 80%] Building CXX object CMakeFiles/axpbox.dir/src/base/Timestamp.cpp.o
[ 82%] Building CXX object CMakeFiles/axpbox.dir/src/dox.cpp.o
[ 84%] Building CXX object CMakeFiles/axpbox.dir/src/es40-cfg.cpp.o
[ 85%] Building CXX object CMakeFiles/axpbox.dir/src/es40_debug.cpp.o
[ 87%] Building CXX object CMakeFiles/axpbox.dir/src/gui/gui.cpp.o
[ 89%] Building CXX object CMakeFiles/axpbox.dir/src/gui/gui_win32.cpp.o
[ 91%] Building CXX object CMakeFiles/axpbox.dir/src/gui/gui_x11.cpp.o
[ 92%] Building CXX object CMakeFiles/axpbox.dir/src/gui/keymap.cpp.o
[ 94%] Building CXX object CMakeFiles/axpbox.dir/src/gui/scancodes.cpp.o
[ 96%] Building CXX object CMakeFiles/axpbox.dir/src/gui/sdl.cpp.o
[ 98%] Building CXX object CMakeFiles/axpbox.dir/src/lockstep.cpp.o
[100%] Linking CXX executable axpbox
[100%] Built target axpbox

Compiled successfully:

remy@Remys-MacBook-Pro build % ./axpbox 
AXPBox Alpha Emulator (commit 7ca7af04529c11eaf5462b2eb210f9d68710f6ed)
Usage: ./axpbox run|configure <options>

Not sure if I can get 10.13 to install inside a virtualbox VM.

I see @TheFausap has raised bug #44 in which he states that there are problems with SDL on OS X so you maybe could try to build without SDL.

Could you maybe attach the output during the build steps to the issue, including cmake and it's reported compiler versions?

RaymiiOrg avatar Dec 01 '20 10:12 RaymiiOrg

(Sorry if this request is not appropriate for this area but I can't find any other user forum - pointers please if there is one.)

No, there is no other forum - feel free to post questions here.

lenticularis39 avatar Dec 01 '20 17:12 lenticularis39

The only Macs I have are PowerPC-based, since I'm not interested in Intel Macs (may get an ARM one in the future), and the earliest version macOS-Simple-KVM supports is Mojave, so getting a High Sierra VM is non-trivial. I could try to make a PowerPC/Intel universal binaries that should run on macOS up to High Sierra.

lenticularis39 avatar Dec 01 '20 17:12 lenticularis39

The only Macs I have are PowerPC-based, since I'm not interested in Intel Macs (may get an ARM one in the future), and the earliest version macOS-Simple-KVM supports is Mojave, so getting a High Sierra VM is non-trivial. I could try to make a PowerPC/Intel universal binaries that should run on macOS up to High Sierra.

I suppose the idea of a universal binary is a great one! :)

TheFausap avatar Dec 01 '20 17:12 TheFausap

I suppose the idea of a universal binary is a great one! :)

It's definitely interesting, but it wouldn't be of much use nowadays, since macOS Catalina and higher doesn't support 32 bit binaries and I suppose not many people want to run AXPbox on a PowerPC Mac. I'll see how it goes once I have a GCC capable of building CMake 3 (building it right now - it takes some time to build GCC on the 7447A).

lenticularis39 avatar Dec 01 '20 18:12 lenticularis39

@Fausto - thank you so much - the missing magic was those pre-processor declarations I think - using them resulted in a successful build. @Raymii - that is pretty much the log I got using the commands suggested by @Fausto. My problem now is connecting the console but I want to see if that is a known issue before either starting a new thread or continuing this one Susan

AussieSusan avatar Dec 01 '20 21:12 AussieSusan

Susan, here is the trick: use xterm (installing X11 Quartz). Uncompress the zip file in the same dir where you have the emulator. This is also a nice VT100 emulation, for the EDIT under VMS. The script calls xterm. In the es40.cfg use these entries

./vmsterm.sh -port 21264 and ./vmsterm.sh -port 21265

If you run everything in a xterm will be smoother than the standard mac os terminal app.

vmsterm.zip

TheFausap avatar Dec 01 '20 23:12 TheFausap

@TheFausap - thank you so much. That is working perfectly. Susan

AussieSusan avatar Dec 02 '20 19:12 AussieSusan

Susan, here is the trick: use xterm (installing X11 Quartz). Uncompress the zip file in the same dir where you have the emulator. This is also a nice VT100 emulation, for the EDIT under VMS. The script calls xterm. In the es40.cfg use these entries

./vmsterm.sh -port 21264 and ./vmsterm.sh -port 21265

If you run everything in a xterm will be smoother than the standard mac os terminal app.

vmsterm.zip

This resolved all of my issues trying to get the emulator to start up after building the axpbox binary.

shawnmbradley avatar May 31 '22 22:05 shawnmbradley