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

Add configuration for linux arm64 #58

Merged
merged 6 commits into from
Feb 23, 2024
Merged

Conversation

fangohr
Copy link
Owner

@fangohr fangohr commented Jan 8, 2024

We would like to compile OOMMF in a container running linux (so that the Docker image for OOMMF can be multi-architecture and in particular support the Mac M1/M2/M3 processors [i.e. the aarch64=arm64 architecture).

Input from Mike Donahue led to this branch (to track the changes). Rough steps:

  • create a name for the combination of linux and arm64 (that's oommf/config/names/linux-arm64.tcl)
  • create appropriate file for configuration (that's oommf/config/platforms/linux-arm64.tcl)
  • modify that file until compilation succeeds

Only significant change: replace "x86_64" with "arm64".
(recommendation from Mike)
@fangohr fangohr changed the title Add configuration for linux arm64 DRAFT: Add configuration for linux arm64 Jan 8, 2024
@fangohr
Copy link
Owner Author

fangohr commented Jan 8, 2024

Continuous integration:

  • We have no continuous integration for linux-arm64.
  • The failing pipeline in-docker-repeat-oommf-update can be ignored (that's issue SpinTEvolve not working with OOMMF 2.1a0 #55) .
  • The other pipelines are passing and should not be affected by the changes in this branch in any case.

@fangohr
Copy link
Owner Author

fangohr commented Jan 8, 2024

The current state is as follows:

  1. platform detection works:
oommfuser@bb3eff7dbc27:/io/oommf/oommf$ tclsh oommf.tcl +platform
<477> oommf   warning:
OOMMF_ROOT is /usr/local/oommf/oommf
Running app is /io/oommf/oommf/oommf.tcl
Is that what you intend?
OOMMF release 2.0b0
Platform Name:		linux-arm64
Tcl name for OS:	Linux 5.15.49-linuxkit
C++ compiler:   	/usr/bin/g++
Shell details ---
 tclsh (running): 	/usr/bin/tclsh
                  	(links to /usr/bin/tclsh8.6)
                  	 --> Version 8.6.13, 64 bit, threaded
 tclsh (OOMMF): 	/usr/bin/tclsh8.6
                  	 --> Version 8.6.13, 64 bit, threaded
 tclConfig.sh:        	/usr/lib/aarch64-linux-gnu/tclConfig.sh
                      	 --> Version 8.6.13
 wish (OOMMF):        	/usr/bin/wish8.6
 tkConfig.sh:         	/usr/lib/aarch64-linux-gnu/tkConfig.sh
                      	 --> Tk Version 8.6.13
OOMMF threads:         	Yes: Default thread count = 4
OOMMF API index:       	20181207
Temp file directory: 	/tmp

Relevant environment variables:
  OOMMFTCL = /usr/local/oommf/oommf/oommf.tcl
  OOMMF_ROOT = /usr/local/oommf/oommf

@fangohr
Copy link
Owner Author

fangohr commented Jan 8, 2024

Configuration is not good enough to compile yet:

oommfuser@bb3eff7dbc27:/io/oommf/oommf$ tclsh oommf.tcl pimake
<494> oommf   warning:
OOMMF_ROOT is /usr/local/oommf/oommf
Running app is /io/oommf/oommf/oommf.tcl
Is that what you intend?
<496> pimake   warning:
OOMMF_ROOT is /usr/local/oommf/oommf
Running app is /io/oommf/oommf/app/pimake/pimake.tcl
Is that what you intend?
Making directory '/io/oommf/oommf/app/mmdisp/linux-arm64' ...
Making directory '/io/oommf/oommf/app/mmsolve/linux-arm64' ...
Making directory '/io/oommf/oommf/app/omfsh/linux-arm64' ...
Making directory '/io/oommf/oommf/app/oxs/linux-arm64' ...
Making directory '/io/oommf/oommf/pkg/oc/linux-arm64' ...
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/oc -o linux-arm64/varinfo.o /io/oommf/oommf/pkg/oc/varinfo.cc
g++ linux-arm64/varinfo.o -lm -o linux-arm64/varinfo
Updating /io/oommf/oommf/pkg/oc/linux-arm64/ocport.h ...
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/app/mmdisp -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/vf -o linux-arm64/mmdispcmds.o /io/oommf/oommf/app/mmdisp/mmdispcmds.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/app/mmdisp -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/vf -I/io/oommf/oommf/pkg/nb -o linux-arm64/mmdispsh.o /io/oommf/oommf/app/mmdisp/mmdispsh.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/app/mmdisp -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/vf -o linux-arm64/bitmap.o /io/oommf/oommf/app/mmdisp/bitmap.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/app/mmdisp -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/colormap.o /io/oommf/oommf/app/mmdisp/colormap.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/app/mmdisp -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/vf -o linux-arm64/display.o /io/oommf/oommf/app/mmdisp/display.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/app/mmdisp -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/psdraw.o /io/oommf/oommf/app/mmdisp/psdraw.cc
Updating /io/oommf/oommf/pkg/vf/./tclIndex ...
Making directory '/io/oommf/oommf/pkg/vf/linux-arm64' ...
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/vf -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/nb -o linux-arm64/fileio.o /io/oommf/oommf/pkg/vf/fileio.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/vf -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/nb -o linux-arm64/mesh.o /io/oommf/oommf/pkg/vf/mesh.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/vf -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/ptsearch.o /io/oommf/oommf/pkg/vf/ptsearch.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/vf -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -I/io/oommf/oommf/pkg/nb -o linux-arm64/vecfile.o /io/oommf/oommf/pkg/vf/vecfile.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/vf -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/vf.o /io/oommf/oommf/pkg/vf/vf.cc
Deleting linux-arm64/libvf.a in /io/oommf/oommf/pkg/vf ...
ar cr linux-arm64/libvf.a linux-arm64/fileio.o linux-arm64/mesh.o linux-arm64/ptsearch.o linux-arm64/vecfile.o linux-arm64/vf.o
ranlib linux-arm64/libvf.a
Updating /io/oommf/oommf/pkg/nb/./tclIndex ...
Making directory '/io/oommf/oommf/pkg/nb/linux-arm64' ...
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/errhandlers.o /io/oommf/oommf/pkg/nb/errhandlers.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/chanwrap.o /io/oommf/oommf/pkg/nb/chanwrap.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/crc.o /io/oommf/oommf/pkg/nb/crc.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/dstring.o /io/oommf/oommf/pkg/nb/dstring.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/evoc.o /io/oommf/oommf/pkg/nb/evoc.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/floatvec.o /io/oommf/oommf/pkg/nb/floatvec.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/functions.o /io/oommf/oommf/pkg/nb/functions.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/imgobj.o /io/oommf/oommf/pkg/nb/imgobj.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/messagelocker.o /io/oommf/oommf/pkg/nb/messagelocker.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/nb.o /io/oommf/oommf/pkg/nb/nb.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/stopwatch.o /io/oommf/oommf/pkg/nb/stopwatch.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/tclobjarray.o /io/oommf/oommf/pkg/nb/tclobjarray.cc
g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/tclcommand.o /io/oommf/oommf/pkg/nb/tclcommand.cc
Making directory '/io/oommf/oommf/pkg/xp/linux-arm64' ...
g++ -c -DNDEBUG -I/io/oommf/oommf/pkg/xp -DXP_USE_MPFR=0 -o linux-arm64/build_port.o /io/oommf/oommf/pkg/xp/build_port.cc
<496> pimake 2.0b0 Platform error:
Expected option, but saw 'build_port'
1 Error(s) detected
----------- 2024-Jan-08 12:06:01
Stack:
Expected option, but saw 'build_port'
    while executing
"Platform Link  -obj build_port -sub CONSOLE  -lm  -out build_port"
    (while building target '/io/oommf/oommf/pkg/xp/linux-arm64/build_port')
    (while building target '/io/oommf/oommf/pkg/xp/linux-arm64/xpport.h')
    (while building target '/io/oommf/oommf/pkg/nb/linux-arm64/xpfloat.o')
    (while building target '/io/oommf/oommf/pkg/nb/linux-arm64/libnb.a')
    (while building target '/io/oommf/oommf/app/mmdisp/linux-arm64/condispsh')
    (while building target '/io/oommf/oommf/app/mmdisp/linux-arm64/appindex.tcl')
    (while building target '/io/oommf/oommf/app/mmdisp/all')
    (procedure "Recursive" line 5)
    invoked from within
"Recursive all"
    (while building target '/io/oommf/oommf/app/all')
    (procedure "Recursive" line 5)
    invoked from within
"Recursive all"
    (while building target '/io/oommf/oommf/all')
    ('MakeRule' proc 'Build' line 51)
    invoked from within
"MakeRule Build $target"
-----------
Additional info: OC Platform
oommfuser@bb3eff7dbc27:/io/oommf/oommf$ 

(I have run pimake distclean and pimake upgade before.)

@fangohr
Copy link
Owner Author

fangohr commented Jan 8, 2024

Attempting to repeat the last two g++ calls (in hopefully the right directory) does not seem to be a problem:

oommfuser@bb3eff7dbc27:/io/oommf$ cd oommf/pkg/nb/
oommfuser@bb3eff7dbc27:/io/oommf/oommf/pkg/nb$ g++ -c -DNDEBUG -O1 -Wno-non-template-friend -I/io/oommf/oommf/pkg/nb -I/io/oommf/oommf/pkg/oc -I/io/oommf/oommf/pkg/oc/linux-arm64 -I/usr/include/tcl8.6 -o linux-arm64/tclcommand.o /io/oommf/oommf/pkg/nb/tclcommand.cc
oommfuser@bb3eff7dbc27:/io/oommf/oommf/pkg/nb$ g++ -c -DNDEBUG -I/io/oommf/oommf/pkg/xp -DXP_USE_MPFR=0 -o linux-arm64/build_port.o /io/oommf/oommf/pkg/xp/build_port.cc
oommfuser@bb3eff7dbc27:/io/oommf/oommf/pkg/nb$ ls linux-arm64/
build_port.o  crc.o      errhandlers.o  floatvec.o   imgobj.o         nb.o         tclcommand.o
chanwrap.o    dstring.o  evoc.o         functions.o  messagelocker.o  stopwatch.o  tclobjarray.o
oommfuser@bb3eff7dbc27:/io/oommf/oommf/pkg/nb$ 

@fangohr
Copy link
Owner Author

fangohr commented Jan 11, 2024

It should now be possible to recreate the setup used for the output above by following instructions in dev/issues/59/readme.txt (https://github.com/fangohr/oommf/blob/add-configuration-for-linux-arm64/dev/issues/59/readme.txt)

@fangohr
Copy link
Owner Author

fangohr commented Feb 23, 2024

Update, with the help of Mike Donahue the Linux ARM64 configuration seems to work now. After compilation:

oommfuser@e537de7ab904:/io/repo/oommf$ ./oommf.tcl +platform
OOMMF release 2.0b0
Platform Name:		linux-arm64
Tcl name for OS:	Linux 5.15.49-linuxkit
C++ compiler:   	/usr/bin/g++
Shell details ---
 tclsh (running): 	/usr/bin/tclsh
                  	(links to /usr/bin/tclsh8.6)
                  	 --> Version 8.6.12, 64 bit, threaded
 tclsh (OOMMF): 	/usr/bin/tclsh8.6
                  	 --> Version 8.6.12, 64 bit, threaded
 filtersh:           	/io/repo/oommf/app/omfsh/linux-arm64/filtersh
                  	 --> Version 8.6.12, 64 bit, threaded
 tclConfig.sh:        	/usr/lib/aarch64-linux-gnu/tclConfig.sh
                      	 --> Version 8.6.12
 wish (OOMMF):        	/usr/bin/wish8.6
 tkConfig.sh:         	/usr/lib/aarch64-linux-gnu/tkConfig.sh
                      	 --> Tk Version 8.6.12
OOMMF threads:         	Yes: Default thread count = 4
OOMMF API index:       	20181207
Temp file directory: 	/tmp

@fangohr fangohr changed the title DRAFT: Add configuration for linux arm64 Add configuration for linux arm64 Feb 23, 2024
@fangohr fangohr merged commit 7d739ec into master Feb 23, 2024
4 of 5 checks passed
@fangohr fangohr deleted the add-configuration-for-linux-arm64 branch February 23, 2024 23:40
fangohr added a commit that referenced this pull request Mar 15, 2024
- readding the files developed in #58
- those files will be released with the next oommf release but are not available
  yet for 21a0
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

Successfully merging this pull request may close these issues.

None yet

1 participant