-
-
Notifications
You must be signed in to change notification settings - Fork 18
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 osx_arm64 build #61
add osx_arm64 build #61
Conversation
…nda-forge-pinning 2021.07.18.08.46.59
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
FYI - I was able to compile this locally (natively) after applying the following patch: diff --git a/recipe/build.sh b/recipe/build.sh
index c8ca87c..dc8529b 100755
--- a/recipe/build.sh
+++ b/recipe/build.sh
@@ -23,6 +23,7 @@ if [[ "$PKG_NAME" == "scotch" ]]; then
# build
cd src/
make esmumps
+ cd ..
# install
mkdir -p $PREFIX/lib/ I uploaded the resulting packages to https://anaconda.org/tobiasrobotics/ |
@conda-forge-admin please restart ci |
@matthiasdiener any chance you can give me write access to your fork? |
@conda-forge-admin please rerender |
…nda-forge-pinning 2022.02.15.20.00.46
Sure, you should have gotten an invitation. |
So it seems like this will need considerable work to get to cross-compile unfortunately. They use an executable that needs to run on the build platform to generate some header files (see https://gitlab.inria.fr/scotch/scotch/-/blob/master/src/libscotch/CMakeLists.txt#L52-111). So a native build for osx-64 has to be done first, and then the cross-compile build. General how-to if anyone is keen on giving it a go: https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html#running-executables-built-in-the-project |
Also I'm not sure why we now see a linker error in the osx-64 build:
|
Maybe it is enough to compile dummysizes/ptdummysizes with the host compiler. |
It probably is, but I'm not CMake guru enough to work that out .. @traversaro - sorry to ping you - do you have any ideas what the easiest way forward would be? |
Sorry, I had lost this mention! Fortunatly I considered "check what's the status of recursive ipopt transitive dependency on osx-64" a fun activity anyhow. :D |
So, a bit of the things that I understood: CMake build system not available
dummysize and ptdummysizeI inspected a bit what the
Then, just for cross-compilation builds we should comment out the rules to build those files from the make file (i.e. from mhttps://gitlab.inria.fr/scotch/scotch/-/blob/v6.0.9/src/libscotch/Makefile#L3079 to https://gitlab.inria.fr/scotch/scotch/-/blob/v6.0.9/src/libscotch/Makefile#L3093) as those files are already available and should not be generated as part of the build. Probaly other modifications may be necessary to handle the installation of those files. In a nutshell, we may take those headers from @Tobias-Fischer's builds, but we should add a logic to clearly fail as soon as the version of scotch is bumped, as in that case those headers should be generated again manually. |
Thank you for the great work @traversaro @Tobias-Fischer ! This is ready for review. |
|
||
# build | ||
cd src/ | ||
make ptesmumps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do the following, then you don't need the new patch.
make ptesmumps | |
make ptesmumps CCD=$CC_FOR_BUILD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understood #67 (comment) correctly, setting CCD might not be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be wrong (I am definititely not a Make expert) but in the end I went for the patch as it seemed to me that in https://gitlab.inria.fr/scotch/scotch/-/blob/v6.0.9/src/libscotch/Makefile#L64 there was some recursive make logic that was basically overwriting the CCD
value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, this fails: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=470850&view=logs&jobId=7afb22dc-3239-5456-794e-5378c2396929
+ make esmumps CCD=/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_build_env/bin/x86_64-apple-darwin13.4.0-clang
(cd libscotch ; make VERSION=6 RELEASE=0 PATCHLEVEL=9 scotch && make install)
make[1]: Entering directory '/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/work/src/libscotch'
make \
CC="arm64-apple-darwin20.0.0-clang" \
CCD="arm64-apple-darwin20.0.0-clang" \
scotch.h \
scotchf.h \
libscotch.a \
libscotcherr.a \
libscotcherrexit.a
make[2]: Entering directory '/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/work/src/libscotch'
arm64-apple-darwin20.0.0-clang -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/work=/usr/local/src/conda/scotch-6.0.9 -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho=/usr/local/src/conda-prefix -O3 -I/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -DIDXSIZE64 -DSCOTCH_RENAME -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_PTHREAD -DSCOTCH_PTHREAD -DCOMMON_PTHREAD_BARRIER -DCOMMON_TIMING_OLD -O3 -I/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -DIDXSIZE64 -DSCOTCH_RENAME -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_PTHREAD -DSCOTCH_PTHREAD -DCOMMON_PTHREAD_BARRIER -DCOMMON_TIMING_OLD -O3 -I/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -DIDXSIZE64 -DSCOTCH_RENAME -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_PTHREAD -DSCOTCH_PTHREAD -DCOMMON_PTHREAD_BARRIER -DCOMMON_TIMING_OLD -fPIC -c arch.c -o arch.o -DSCOTCH_VERSION_NUM=6 -DSCOTCH_RELEASE_NUM=0 -DSCOTCH_PATCHLEVEL_NUM=9
arm64-apple-darwin20.0.0-clang -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/work=/usr/local/src/conda/scotch-6.0.9 -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho=/usr/local/src/conda-prefix -O3 -I/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -DIDXSIZE64 -DSCOTCH_RENAME -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_PTHREAD -DSCOTCH_PTHREAD -DCOMMON_PTHREAD_BARRIER -DCOMMON_TIMING_OLD -O3 -I/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -DIDXSIZE64 -DSCOTCH_RENAME -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_PTHREAD -DSCOTCH_PTHREAD -DCOMMON_PTHREAD_BARRIER -DCOMMON_TIMING_OLD -O3 -I/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include -DIDXSIZE64 -DSCOTCH_RENAME -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_PTHREAD -DSCOTCH_PTHREAD -DCOMMON_PTHREAD_BARRIER -DCOMMON_TIMING_OLD -DSCOTCH_VERSION_NUM=6 -DSCOTCH_RELEASE_NUM=0 -DSCOTCH_PATCHLEVEL_NUM=9 dummysizes.c -o dummysizes -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -L/Users/runner/miniforge3/conda-bld/scotch-pkgs_1646774941871/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib -lm -lz -pthread -lm -lz -pthread -lm -lz -pthread
./dummysizes "-s" library.h scotch.h
/bin/sh: ./dummysizes: Bad CPU type in executable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a simpler patch could be to remove the line https://gitlab.inria.fr/scotch/scotch/-/blob/v6.0.9/src/libscotch/Makefile#L64, but to be honest I am not 100% sure of the other side effects of that patch, while the existing patch of using CC_FOR_BUILD
only when I know it was necessary it was more clear to me.
Wow, great work! Everything looks good to me, especially since the tests are passing. |
Co-authored-by: Isuru Fernando <[email protected]>
@conda-forge-admin please restart ci |
thanks for all the work guys! |
@matthiasdiener Should I merge? Please confirm. |
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)