Re: Compiling with Scons on Mac arm64

Mats Wichmann <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
On 2/2/22 10:56, Mats Wichmann wrote:
> On 2/1/22 10:36, Paola Ferrario wrote:
>> Hi all!
>> I’m having a problem compiling my C++ application using Scons on a Mac
>> with M1 processor. 
>> Specifically, it seems that it tries to compile for a x86_64
>> architecture, since I see a lot of warnings such as 
>> "warning: ignoring file ..., building for macOS-x86_64 but attempting to
>> link with file built for macOS-arm64”
>> when linking to third-party libraries, correctly compiled in the arm64
>> architecture. After the warnings, the compilation ends with error 
>> “ld: symbol(s) not found for architecture x86_64”
>>
>> I was wondering if there is a flag I can pass to the compiler to specify
>> the architecture. I’ve tried with 
>>
>> -arch=arm64
>>
>> but it doesn’t work.
>> What should I do?

You checked in objects in your toy, and they show this:

source/nexus.o:                              Mach-O 64-bit x86_64
object, flags:<|SUBSECTIONS_VIA_SYMBOLS>

so the build is somehow targeting x86_64.  Any chance you can show a log
of the build?  I don't have an M1 Mac available - I think Bill does though.


Also this:

    p = subprocess.Popen(cmd, shell=True,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE)

    ## If the stdout is empty, the execution of the command failed
    version = p.stdout.read()
    if version == '':
        Abort("Failed to establish Geant4 version.")


subprocess, unless told otherwise, will sent back bytes, so to be valid
that comparison needs to be:

if version == b"":

for the other branch it's decoded, so that's fine.


_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.