Skip to content
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

Compilation on M2 Mac #3

Open
philjulian opened this issue Oct 30, 2023 · 16 comments
Open

Compilation on M2 Mac #3

philjulian opened this issue Oct 30, 2023 · 16 comments

Comments

@philjulian
Copy link

I saw your recent email via Archer about making some changes to the CMakeLists.Txt and sffuncs.h files in order to assist compilation on an M2 Mac, I still get the following:

In file included from /Users/pmj/CDP8/dev/sfutils/dirsf.c:78:
/Users/pmj/CDP8/dev/sfutils/../newsfsys/sffuncs.h:203:2: error: "Unknown byte order for this processor"
#error  "Unknown byte order for this processor"
 ^
/Users/pmj/CDP8/dev/sfutils/../newsfsys/sffuncs.h:207:2: error: "Internal: can't be both MSB and LSB"
#error  "Internal: can't be both MSB and LSB"
 ^
/Users/pmj/CDP8/dev/sfutils/dirsf.c:170:9: warning: variable 'cded' set but not used [-Wunused-but-set-variable]
    int cded = 0;       /* did we cd? */    
        ^
1 warning and 2 errors generated.
make[2]: *** [dev/sfutils/CMakeFiles/dirsf.dir/dirsf.c.o] Error 1
make[1]: *** [dev/sfutils/CMakeFiles/dirsf.dir/all] Error 2
make: *** [all] Error 2

I've attached the two edited files from the newsfsys folder in case I've put something in the wrong place, apologies if so.

CDP8_Edits.zip

@richarddobson
Copy link
Contributor

richarddobson commented Oct 30, 2023 via email

@richarddobson
Copy link
Contributor

richarddobson commented Oct 30, 2023 via email

@philjulian
Copy link
Author

Ah yes, I should have spotted that myself... :)

Corrected those and tried a fresh compilation, still no luck I'm afraid. Same errors as before.

@richarddobson
Copy link
Contributor

richarddobson commented Oct 30, 2023 via email

@philjulian
Copy link
Author

So the compilation proceedure I've been using is to create a build directory in CDP8 and from there running:

cmake -G "Unix Makefiles" ..

Which returns:

-- /Users/pmj/CDP8
-- installing to /usr/local
-- building to /Users/pmj/CDP8/NewRelease
-- LIBRARY INSTALL DIR: lib
-- Not using Custom.cmake file.
-- BUILD_BIN_DIR set to 
-- BUILD_LIB_DIR set to /Users/pmj/CDP8/build/lib
-- paprogs to be built
-- Building on OSX
-- Configuring done (0.3s)
-- Generating done (0.6s)
-- Build files have been written to: /Users/pmj/CDP8/build

After that, cmake --build .

I've attached the flags.make file from build/dev/newsfsys/CMakefiles/newsfsys.dir let me know if that sheds any light on anything.

flags.make.zip

@richarddobson
Copy link
Contributor

richarddobson commented Oct 31, 2023 via email

@philjulian
Copy link
Author

philjulian commented Oct 31, 2023

I tried going from scratch again and using cmake .. rather than what I was using with cmake -G "Unix Makefiles" .. and it returns a slightly more verbose set of information which I've attached here, notibly:

-- Looking for io.h - not found
-- Looking for values.h - not found
-- Looking for winsock.h - not found

Are these likely to be causing a problem?

Terminal Saved Output.txt

@richarddobson
Copy link
Contributor

richarddobson commented Oct 31, 2023 via email

@philjulian
Copy link
Author

Deleted the whole CDP8 folder and started from scratch but those same messages are still persisting. It could easily be something within my setup or how cmake is or isn't configured correctly for this. Bit beyond what I know how to unpick.

I'll try again but a bit stuck for now.

@richarddobson
Copy link
Contributor

richarddobson commented Oct 31, 2023 via email

@philjulian
Copy link
Author

Thanks for this, with a fresh clone of the CDP8 repo and running the cmake / make commands as before it gets to 99% complete and throws up:

/Users/pmj/CDP8/dev/externals/paprogs/listaudevs/devs.c:27:10: fatal error: 'portaudio.h' file not found #include <portaudio.h> ^~~~~~~~~~~~~ 1 error generated. make[2]: *** [dev/externals/paprogs/listaudevs/CMakeFiles/listaudevs.dir/devs.c.o] Error 1 make[1]: *** [dev/externals/paprogs/listaudevs/CMakeFiles/listaudevs.dir/all] Error 2 make: *** [all] Error 2

My portaudio installation is from the the current homebrew cask of it, is there an additional step or extra tweak?

https://formulae.brew.sh/formula/portaudio

@richarddobson
Copy link
Contributor

richarddobson commented Nov 3, 2023 via email

@philjulian
Copy link
Author

philjulian commented Nov 3, 2023

Ok, so portaudio.h is in usr/local/include but not in /usr/local/lib

Closest matches there are:

libportaudio.a libportaudio.dylib libportaudio.la

and in a sub-folder called pkgconfigis portaudio-2.0.pc

@richarddobson
Copy link
Contributor

richarddobson commented Nov 3, 2023 via email

@philjulian
Copy link
Author

philjulian commented Nov 3, 2023

May have had some success here with a couple of tweaks that may or may not be quite correct...

I found I had to add include_directories (/usr/local/include) to these two CMakeLists.txt files:

/Users/pmj/CDP8/dev/newsfsys/CMakeLists.txt as discussed
/Users/pmj/CDP8/dev/externals/paprogs/listaudevs/CMakeLists.txt

Without adding it to the latter, paprogs doesn't "see" portaudio.h

I also had to find pa_ringbuffer.h and pa_util.h from the portaudio github (under "common") as these didn't appear to be on my machine anywhere. These were added to the /usr/local/include directory.

I now get to 100% compiled albiet with quite a few warnings along the way. Log of these warnings is attached here in case it's useful.

The NewRelease folder now has 224 compiled tools in it which I assume is the correct number?

Terminal Saved Output.txt

@richarddobson
Copy link
Contributor

richarddobson commented Nov 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants