-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fixes ADMB compiling on Linux arm64 #278
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling ADMB v13.0 and the dev-13.1 branch fails on Linux (Ubuntu) running on a 64 bit ARM processor: ``` make contrib-libs make[4]: Entering directory '/home/ubuntu/admb/contrib' make --directory=ecolib CXXFLAGS= LDFLAGS= OPTION= CONTRIB_OBJS_DIR=../../build/objects-x86_64-linux-g++11 make[5]: Entering directory '/home/ubuntu/admb/contrib/ecolib' ../../admb -c -o ../../build/objects-x86_64-linux-g++11/saflp-contrib-Gompertz.obj Gompertz.cpp *** Compile: Gompertz.cpp g++ -c -std=c++17 -O3 -D_USE_MATH_DEFINES -I. -I"/home/ubuntu/admb/build/admb/include" -o../../build/objects-x86_64-linux-g++11/saflp-contrib-Gompertz.obj Gompertz.cpp Assembler messages: Fatal error: can't create ../../build/objects-x86_64-linux-g++11/saflp-contrib-Gompertz.obj: No such file or directory Error: Could not compile Gompertz.cpp make[5]: *** [../admb-rules.mak:37: ../../build/objects-x86_64-linux-g++11/saflp-contrib-Gompertz.obj] Error 1 make[5]: Leaving directory '/home/ubuntu/admb/contrib/ecolib' make[4]: *** [GNUmakefile:291: contrib-ecolib] Error 2 make[4]: Leaving directory '/home/ubuntu/admb/contrib' make[3]: *** [GNUmakefile:162: all] Error 2 make[3]: Leaving directory '/home/ubuntu/admb/contrib' make[2]: *** [Makefile:99: g++-contribs] Error 2 make[2]: Leaving directory '/home/ubuntu/admb' make[1]: *** [Makefile:93: g++-dist] Error 2 make[1]: Leaving directory '/home/ubuntu/admb' make: *** [Makefile:5: dist] Error 2 ``` The relevant bit from that error message seems to be that `../../build/objects-x86_64-linux-g++11/saflp-contrib-Gompertz.obj` does not exist. Note the incorrect architecture part of the path that reads `x86_64` (64 bit Intel/AMD). In previous steps in the compilation that architecture part was correctly set to `arm64`. Example lines from earlier in the compilation: ``` g++ -c -std=c++17 -O3 -Wall -Wextra -Wconversion -Wno-unused-parameter -D_USE_MATH_DEFINES -I../build/admb/include -o ../build/objects-arm64-linux-g++11/saflp-linad99-fvar_a10.obj linad99/fvar_a10.cpp g++ -c -std=c++17 -O3 -Wall -Wextra -Wconversion -Wno-unused-parameter -D_USE_MATH_DEFINES -I../build/admb/include -o ../build/objects-arm64-linux-g++11/saflp-linad99-fvar_a11.obj linad99/fvar_a11.cpp g++ -c -std=c++17 -O3 -Wall -Wextra -Wconversion -Wno-unused-parameter -D_USE_MATH_DEFINES -I../build/admb/include -o ../build/objects-arm64-linux-g++11/saflp-linad99-fvar_a13.obj linad99/fvar_a13.cpp ``` Looks like the fault may be on lines 62-66 in the file `amdb/contrib/GNUmakefile`: ``` ifeq ($(UNAME_S),Linux) ifeq (i686,$(findstring i686,$(shell $(CXX) -dumpmachine))) OSNAME=-i686-linux else OSNAME=-x86_64-linux endif endif ``` Here the architecture defaults to x86_64 if it is not i686 which trips up the compilation inside `amdb/contrib/`. ARM is not an option. For comparison in the file `amdb/src/GNUmakefile` the arm64 architecture is handled correctly: ``` ifeq ($(UNAME_S),Linux) ifeq (i686,$(findstring i686,$(shell $(CXX) -dumpmachine))) OSNAME=-i686-linux else ifeq (x86_64,$(findstring x86_64,$(shell $(CXX) -dumpmachine))) OSNAME=-x86_64-linux else OSNAME=-arm64-linux endif endif endif ``` Tested on: + Ubuntu running as a Docker container on a Mac with a M2 Apple processor + Ubuntu 20.04 running on an t4a.xlarge EC2 AWS instance with a ARM Graviton3 processor
Thanks @jonrh, Can you also add the changes for admb.sh? |
The equivalent sh/bash Linux architecture checks seem to already be in place so no change should be needed?
Lines 136 to 149 in a65f1c9
Lines 135 to 148 in a65f1c9
Looks like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue #277. This is a minimal change that brings the make instructions in line with
admb/src/GNUMakefile
andadmb/scripts/admb.sh
.