Problem running CLUMPP on Apple M1 processor

355 views
Skip to first unread message

redg...@gmail.com

unread,
Oct 28, 2021, 8:15:28 PM10/28/21
to structure-software
Hello,

I am getting the following error trying to execute the CLUMPP executable:

```zsh: bad CPU type in executable: ./CLUMPP```

I am using a MacOS Big Sur 11.4 with the Apple M1 processor.

I did not have any problems running CLUMPP on my older Mac so I think it has to do with the M1 chip. I double checked that I have Rosetta2 installed and that the exe file has the proper permissions. Is this a problem with compilation, if so does anyone have a compiled executable? Thanks in advance

banta....@gmail.com

unread,
Oct 28, 2021, 10:39:45 PM10/28/21
to structure-software
Ideas: 

(1) Run Windows in virtualization using Parallels and access STRUCTURE from there. Similarly, you could run Ubuntu or Debian Linux under Parallels, as both have ARM versions that can easily be installed through Parallels. The problem for either solution is that STRUCTURE is an old and out-of-date program, and so it very likely relies on x86 architecture in some ways that cannot be overcome. In essence, you may run into the same problems running STRUCTURE on these operating systems as you're encountering under Mac OS, as they're all relying on ARM architecture.

^^^^^^ This solution will probably not work. See #2.

(2) *Emulate* (rather than virtualize) an x86 version of Windows or Linux. You'll take a performance hit for emulating, but it should work. 

I would recommend using the program UTM as your emulator (https://apps.apple.com/us/app/utm-virtual-machines/id1538878817), which for $10 gives you a user-friendly GUI on top of the open-source program QEMU. As I understand UTM is available for M1 Macs. 

Here are the instructions to install Ubuntu Linux under UTM: https://mac.getutm.app/gallery/ubuntu-20-04 . HOWEVER, MODIFY THOSE INSTRUCTIONS BY CHOOSING THE x86_64 ARCHITECTURE (or even better the i386 version if it will let you), NOT THE ARM ARCHITECTURE FROM THE DROP-DOWN MENU.

If you are brave enough to try this solution, and brave enough to emulate Ubuntu Linux, I do have some tutorials for installing and running STRUCTURE under Ubuntu Linux. The relevant tutorials are: https://www.youtube.com/watch?v=r9LNgU-ZiSo and https://www.youtube.com/watch?v=F-2xuPQyjYA .

(3) The path of least resistance is to leave STRUCTURE behind and, dare I say it?, use a more modern (read: actively-maintained) program. May I suggest the LEA package in R instead? http://membres-timc.imag.fr/Olivier.Francois/tutoRstructure.pdf

Good luck!
Josh

Francisco Pina Martins

unread,
Oct 31, 2021, 3:54:59 PM10/31/21
to structure-software
Dear all,

Let me just add that STRUCTURE compiles and runs perfectly fine in ArchLinux ARM (tested on a Raspberry Pi 4). There seems to be no x86 dependent code in there. That means it should also compile just fine on an based M1 Apple machine.
CLUMPP, however is a different beast.

a) It's distributed as a 32bit binary
b) It is not open source

The fact that it is a 32bit binary, means Rosetta2 won't be able to run it. Also, any recent version of OSX, even if on an x86 (Intel) CPU won't be able to run it, since Apple has dropped 32bit support some time ago.
Since the code is (unfortunately) proprietary, it also means you can't use the source code to compile it yourself, because it is not available. Only the authors can do that.
If you can get a GNU/Linux based OS running on your M1 machine (even if in a virtualized environment), you can get it to run. Otherwise you will likely have to use another machine to run CLUMPP.

Best,

Francisco

Josh Banta

unread,
Oct 31, 2021, 4:28:37 PM10/31/21
to structure...@googlegroups.com
Dear Francisco,

Ah, yes! I see now that the original post was referring to CLUMPP, not STRUCTURE. It is great to know that STRUCTURE runs under ARM-based processors.

Regarding CLUMPP: would an ARM-based OS (for instance, Arch Linux on a Raspberry Pi) be able to run a 32-bit program like CLUMPP? If so, then the person could install, e.g., ARM-based Ubuntu as a virtualized environment using Parallels and run CLUMPP from there. However, if ARM-based Linux cannot run it, then it would require x86-based Linux emulation (which, it should be noted, is different from virtualization and requires different software).

Best,
Josh

Vikram Chhatre

unread,
Oct 31, 2021, 8:21:37 PM10/31/21
to structure-software
Just to add to the already productive discussion above (or below), it's worth asking the CLUMPP authors for the source code. Most academics won't hesitate sharing the code especially for literature they have already published.

V

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/structure-software/5BDD8391-51F2-4FD1-AF5E-8FEAF2105B28%40gmail.com.

Francisco Pina Martins

unread,
Nov 1, 2021, 3:41:10 PM11/1/21
to structure-software
Dear Josh,

Like you stated, it is not possible to run x86 binaries *natively* on an ARM system. That being said, there are some efforts to getting something similar to rosetta 2 on GNU/Linux systems. Box86 comes to mind, but there are others. Albeit these projects are focused on gaming, they can be used for other things like running CLUMPP. In this case, the advantage over Mac OS is that Box86 can run both i386 (32bit) and x86_64 (64bit) GNU/Linux binaries. This might be a moot point, however, since CLUMPP is distributed as both 32 and 64bit binary under GNU/Linux. I have not yet had the chance to test it, but it sure sounds like an interesting project.

All these are, however, "stop-gap" measures, and the only real solution to the problem is what Vikram's proposed. Have the source code released under an open-source license, so that the community can compile it for whatever platforms are deemed necessary, and eventually take maintenance of the program (which hasn't had an update in over 10 years, IIRC).

If you do take such a course of action, please let us how it worked out in a follow-up post!

Best,

Francisco
Reply all
Reply to author
Forward
0 new messages