-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apple silicon build problem(s?) #294
Comments
I've used this stuff before on my M1 Macbook, without trouble. So I checked again. In any case, trying --target lgp just for a quick test shows that flavors unix, ninja, and xcode all work. I have Mac OS 12.6.8, Cmake 3.26.4, Xcode 14.2, Clang 14.0.0. Do you have the xcode command line utilities installed? A quick test is "gcc --version", that should work and will tell you the Clang version number (masquerading as gcc, which of course it isn't). |
MacOS (Ventura) 13.5.2 -- one difference
Reading the output, the mkdir usage message stands out; I added
With that debug output, it looks like the I've created a branch so it is easy to create the pull request, but my progress may be slow... |
The errors running cmake-builder.sh were because I didn't have the proper configuration for the Xcode command line tools. I ran
and all the simulators built and passed all tests. The hint for this came from looking at |
- find gnu-getopt when installed by homebrew in /opt - invoke realpath only on known path components (needed for some realpath implementation(s)) (relevant when build-flavor directory does not yet exist)
Thanks, that might make a good addition to the build documentation. |
Should I do so? If so, I'll assume the same issue & pull request. A gentle hint on how I do that with GitHub would be appreciated. I'm a cooperative development neophyte. |
Never mind on the gentle hint. I saw this:
|
- find gnu-getopt when installed by homebrew in /opt - invoke realpath only on known path components (needed for some realpath implementation(s)) (relevant when build-flavor directory does not yet exist)
- find gnu-getopt when installed by homebrew in /opt - invoke realpath only on known path components (needed for some realpath implementation(s)) (relevant when build-flavor directory does not yet exist)
Not sure if they are related but i ran into issues trying to build opensimh commit b23cde9 on my M1 mac running Sonoma. I had a string of linker issues which in the end i solved with the following command Could very well be PEBCAK but i thought i'd throw this in here just in case. Also Sonoma. |
@juiceghost were you using cmake or the makefile? It's hard to comment on your report without seeing the full build log. |
@pkoning2: @juiceghost: |
I thought the build script would recognize the presence or absence of libpng and supply a defined symbol accordingly. At least I did that on a (not yet published) simulator and I'm pretty sure it wasn't something new I added. |
@pkoning2: I think I found the issue. |
Yes, and similarly there's supposed to be a Make symbol so files depending on that library can be conditionally included in the inputs for a given simulator. |
@juiceghost: One issue with how you're invoking This is how you ought to invoke it:
I'll add a sanity check to ensure |
But why would you have to say -f Xocde if that's an optional switch, defaulting to "use make"? It should do the right thing for any flavor. |
@pkoning2: It's not an optional switch, there just isn't a default (ok, need to fix that to default to Unix Makefiles.) There also isn't a check for an unset |
Hm, I thought Unix was the default, but you're right, it doesn't say that. So either it should be the default or omitting -f should be an error, but doing the wrong thing isn't desirable... |
"Unix Makefiles" is a reasonable default? Could also probe for |
Perhaps I was thinking of other projects that use Cmake (like Wireshark). But actually, the cmake command is documented as defaulting to the Makefile generator. And that makes some sense; it's hard to imagine a Unix system without make, while build tools like Ninja are certainly readily available but not necessarily present by default. |
@pkoning2: And you're correct that CMake defaults to the Makefile generator if not otherwise specified. The "nasty" that @juiceghost tripped on is the build subdirectory not being set if the |
@pkoning2: Just how loudly should |
If you don't want to make |
@pkoning2: I suspect @juiceghost might not be at the most current version of
is in the most current version. However, earlier in the thread, he said he needed to add that line, unless I'm misreading the thread. |
I think i might have had some intermittent issues, i compiled a later commit just fine with only If i can reproduce it again on my end i will make sure to save the build log. Thanks for looking into it. |
@juiceghost: Couple of extra questions.
Does this result in a broken |
I'll try it, but note that i did not use cmake (at least not knowingly), i do not have any build-* subfolders inside |
@juiceghost: My bad... @at7heb: Couple of extra questions. Is there a cmake/build-unix or cmake/build-ninja subdirectory?
Does this result in a broken make? |
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. - Use simulator AIO only where needed by the simulator (i.e., the simulator calls/uses AIO_CHECK_EVENT in sim_instr()) - Add "USES_AIO" flag to add_simulator() to mark a simulator that acutally uses asynchronous I/O. - Build "_aio" SIMH core library variants that have AIO turned on, link with the "_aio" variant when a simulator sets USES_AIO. - Emit a warning message when WITH_ASYNC is False (CMake configuration option) to notify the user/developer that some functionality will be crippled. Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family, IMLAC and TT2500. The makefile and cmake/generate.py also updated to remain in sync with CMake. N.B.: Simulators still link with the underlying platform's threading library. SEL32 requires pthreads or equivalent threading library, independent of AIO. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue open-simh#294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. - Use simulator AIO only where needed by the simulator (i.e., the simulator calls/uses AIO_CHECK_EVENT in sim_instr()) - Add "USES_AIO" flag to add_simulator() to mark a simulator that acutally uses asynchronous I/O. - Build "_aio" SIMH core library variants that have AIO turned on, link with the "_aio" variant when a simulator sets USES_AIO. - Emit a warning message when WITH_ASYNC is False (CMake configuration option) to notify the user/developer that some functionality will be crippled. Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family, IMLAC and TT2500. The makefile and cmake/generate.py also updated to remain in sync with CMake. N.B.: Simulators still link with the underlying platform's threading library. SEL32 requires pthreads or equivalent threading library, independent of AIO. - cmake/cmake-builder.sh - New "--no-aio" flag: Build simulators without async I/O. - New "--no-aio-intrinsics" flag: Don't build async I/O using compiler compare-exchange, atomic load intrinsics. - cmake/cmake-builder.ps1 - New "-noaio" flag: Build simulators without async I/O. - New "-noaiointrinsics" flag: Don't build async I/O using compiler compare-exchange, atomic load intrinsics. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Issue #294: "apple silicon build problem(s?)": If the "--flavor/-f" flag is not specified on the command line, then complain loudly, print help and exit. The script used to default to "Unix Makefiles". Updates: - Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG library is detected/present for screen capture support. - Add "clang64" to the list of MinGW64 platforms for which the .travis/deps.sh script can install build dependencies. - Add PThread4W_FOUND to the condition that sets async I/O for Win32 when using vcpkg for build dependencies. - Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to build 64-bit Windows executables. - Use simulator AIO only where needed by the simulator (i.e., the simulator calls/uses AIO_CHECK_EVENT in sim_instr()) - Add "USES_AIO" flag to add_simulator() to mark a simulator that acutally uses asynchronous I/O. - Build "_aio" SIMH core library variants that have AIO turned on, link with the "_aio" variant when a simulator sets USES_AIO. - Emit a warning message when WITH_ASYNC is False (CMake configuration option) to notify the user/developer that some functionality will be crippled. Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family, IMLAC and TT2500. The makefile and cmake/generate.py also updated to remain in sync with CMake. N.B.: Simulators still link with the underlying platform's threading library. SEL32 requires pthreads or equivalent threading library, independent of AIO. - cmake/cmake-builder.sh - New "--no-aio" flag: Build simulators without async I/O. - New "--no-aio-intrinsics" flag: Don't build async I/O using compiler compare-exchange, atomic load intrinsics. - cmake/cmake-builder.ps1 - New "-noaio" flag: Build simulators without async I/O. - New "-noaiointrinsics" flag: Don't build async I/O using compiler compare-exchange, atomic load intrinsics. CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name must now be an absolute path. Relative paths no longer accepted. Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH was first implemented.
Context
I'm trying to build simh on a MacBook Pro with the M1 chip, Ventura 13.5.2. I use home-brew. There are build problems.
how you built the simulator or that you're using prebuilt binaries
First problem is accessing the GNU getopt. I get the following output (I've not included the output from the brew installations and updates; gnu-getopt is installed)
That is an easy fix in
cmake/cmake-builder.sh
-- add this lineThe next problem is
after running make with --help, I tried building with the --flavor xcode and ran into the next problem
These may be the tip of the iceberg...
The text was updated successfully, but these errors were encountered: