Cycling74 / min-devkit

Tools, documentation, and reference implementation of a Max Package built using the Min-API.
MIT License
158 stars 31 forks source link

i386 issues on Mac build Xcode 9 #114

Closed DanBennettDev closed 5 years ago

DanBennettDev commented 5 years ago

I'm testing a mac build of an object developed with the devkit (developed on win and I'm generally a win user). I get this error on build

The i386 architecture is deprecated. You should update your ARCHS build setting to remove the i386 architecture

The source of the issue seems to be within the min-lib files that get pulled on build. It seems to be due to the line ARCHS = (x86_64,i386); in the project files from the devkit that get generated /build/source/min-lib/MinLib.xcodeproj/project.pbxproj

As a workaround: If I copy replace ARCHS = (x86_64,i386); > ARCHS = (x86_64); in this file the build works. But I have to do this after the first build step (cmake -G Xcode ..) - I don't think I can fix my own repo so that this will build without problem.

tap commented 5 years ago

Hi Dan,

Do you know what branch / revision you are using?

I've been working primarily with the tap/ui branch recently. At least on that branch, we are now only building for 64-bit by default as both Max 8 and Live 10 only support 64-bit.

DanBennettDev commented 5 years ago

sory "revision" was the magic word here - I need to remember how to update my submodules. Having updated them this issue goes away

tap commented 5 years ago

Great! glad to hear it!

DanBennettDev commented 5 years ago

quick follow up - I gather previous versions of MAX for macOS are 32bit, and the latest revision of min is 64bit? What's the recommended branch & revision to work on if we want to compile versions of externals for MAX 7 owners?

tap commented 5 years ago

Good question. I should write up something about this for the wiki. There is nothing in the Min API at this point that will prohibit your extern from running in Max 7.

I just pushed some changes to both the Min-API and the Max-API submodules to support overriding the default architecture on the Mac. With those changes you can still build externs for 32-bit and 64-bit. To do so you will need to modify your cmake files by adding a line that specifies the architectures prior to including the "pretarget" file. Here is an example, where line 5 has been inserted to build both 32- and 64-bit binaries:

Copyright 2018 The Min-DevKit Authors. All rights reserved.

Use of this source code is governed by the MIT License found in the

License.md file.

cmake_minimum_required(VERSION 3.0) set(CMAKE_OSX_ARCHITECTURES x86_64;i386)

set(C74_MIN_API_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../min-api) include(${C74_MIN_API_DIR}/script/min-pretarget.cmake)

...

The only caveat is that Xcode will probably start complaining because Apple has deprecated 32-bit builds, though how harshly it complains will depend on your version of Xcode.

best, Tim

On Wed, Oct 10, 2018 at 11:46 AM Dan Bennett notifications@github.com wrote:

quick follow up - I gather previous versions of MAX for macOS are 32bit, and the latest revision of min is 64bit? What's the recommended branch & revision to work on if we want to compile versions of externals for MAX 7 owners?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Cycling74/min-devkit/issues/114#issuecomment-428645856, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGsRao2Z3afKBKId_bklbq5Fk4HbxVYks5ujiRugaJpZM4XVErl .

DanBennettDev commented 5 years ago

Ok great thanks - really helpful. I'll give this a crack tomorrow. I have so little need to use Cmake outside of MAX externals, but I'm beginning to think it's worth spending a wet afternoon or two on understanding it better from the bottom up.

DanBennettDev commented 5 years ago

Thanks for this - I just updated all submodules, changed my CMAKE files and tried a build. I got it to build on XCode 9.x, with just i386 warnings rather than errors. But the resulting external still throws the "mach-o, but wrong architecture" error when loaded in max 7.

I'm using a static library though - could this be the issue? (e.g. that the library is still being built 64bit?) I added the same set(CMAKE_OSX_ARCHITECTURES x86_64;i386) instruction in the CMAKE file for the library to try to avoid this, but I might be missing some other setup issue?

tap commented 5 years ago

Hmmm... It's hard to guess what's going on. If you want to send me the project I can take a look. If don't want it in the public thread my email is tim@cycling74.com

DanBennettDev commented 5 years ago

Thanks - dropped you a message. Currently private repos until I've ironed out bugs - will be opening up soon.